| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 | #!/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 disks -n ${NODEIP} | grep -v DEV | grep -v usb | grep -v "2.0 TB" | grep -v "/dev/mmc" | awk '{print $2}')DISKS=$(talosctl disks -n ${NODEIP} | grep -v DEV | grep -v '*$' | awk '{print $2}')talosctl disks -n ${NODEIP} | grep -v DEV | grep -v '*$'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-wipedone#talosctl -n ${NODEIP} reboot
 |