| 1234567891011121314151617181920212223242526272829303132333435 | #!/bin/bashif [ $# -ne 1 ]; then  echo "Incorrect number of arguments"fiNODE=$1DIR=$2echo "Resetting $DIR on ${NODE}"NODEIP=$(kubectl get nodes -o wide | grep ${NODE} | grep -v "INTERNAL-IP" | awk '{print $6}')echo "Node IP: $NODEIP"echo "Creating ceph-wipe pod to clear $DIR on $NODE (${NODEIP})"cat <<EOF | kubectl apply -f -apiVersion: v1kind: Podmetadata:  name: ceph-wipe-${NODE}spec:  restartPolicy: Never  nodeName: ${NODE}  containers:  - name: ceph-wipe-${NODE}    image: busybox    securityContext:      privileged: true    command: ["/bin/sh", "-c", "rm -rf ${DIR}"]EOFkubectl wait --timeout=900s --for=jsonpath='{.status.phase}=Succeeded' pod ceph-wipe-${NODE}kubectl delete pod ceph-wipe-${NODE}
 |