theshire/kubernetes/tools/wipeone.yaml

36 lines
815 B
YAML

---
apiVersion: v1
kind: Pod
metadata:
name: disk-wipe-one
namespace: kube-system
spec:
restartPolicy: Never
nodeName: shadowfax
containers:
- name: disk-wipe
image: docker.io/library/alpine:3.19.1
securityContext:
privileged: true
resources: {}
env:
- name: CEPH_DISK
value: "/dev/nvme2n1"
command:
[
"/bin/sh",
"-c"
]
args:
- apk add --no-cache sgdisk util-linux parted;
sgdisk --zap-all $CEPH_DISK;
blkdiscard $CEPH_DISK;
dd if=/dev/zero bs=1M count=1000 oflag=direct of=$CEPH_DISK;
partprobe $CEPH_DISK;
volumeMounts:
- mountPath: /mnt/host_var
name: host-var
volumes:
- name: host-var
hostPath:
path: /var