| 123456789101112131415161718192021222324252627282930313233343536373839404142 | #!/bin/bashif [ $# -ne 1 ]; then  echo "Incorrect number of arguments"fiNODE=$1echo "Resetting ${NODE}"NODEIP=$(kubectl get nodes -o wide | grep ${NODE} | grep -v "INTERNAL-IP" | awk '{print $6}')DISKS=$(talosctl -n ${NODEIP} disks | awk '{print $2}' | grep -v DEV | grep -v "/dev/sdg" | grep -v "/dev/mmc")echo "Disks: $DISKS"echo "Node IP: $NODEIP"for d in $DISKS ; doecho "Creating disk-wipe pod to clear $d on $NODE (${NODEIP})"cat <<EOF | kubectl apply -f -apiVersion: v1kind: Podmetadata:  name: disk-wipespec:  restartPolicy: Never  nodeName: ${NODE}  containers:  - name: disk-wipe    image: busybox    securityContext:      privileged: true    command: ["/bin/sh", "-c", "dd if=/dev/zero bs=1M count=100 oflag=direct of=${d}"]EOFkubectl wait --timeout=900s --for=jsonpath='{.status.phase}=Succeeded' pod disk-wipekubectl delete pod disk-wipedonetalosctl -n ${NODEIP} reboot
 |