Skip to content

Instantly share code, notes, and snippets.

@egeneralov
Created June 4, 2020 17:33
Show Gist options
  • Save egeneralov/4309aec2994af7e025330509905e824e to your computer and use it in GitHub Desktop.
Save egeneralov/4309aec2994af7e025330509905e824e to your computer and use it in GitHub Desktop.
#!/bin/sh -xe
for NAME in $(kubectl get nodes -o name | awk -F \/ '{print $2}'); do
cat << EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
name: kube-support-$NAME
namespace: kube-system
spec:
terminationGracePeriodSeconds: 1
containers:
- name: debian
image: debian:buster
command: ["/bin/sleep"]
args: ["infinity"]
volumeMounts:
- name: host
mountPath: /host
securityContext:
privileged: true
volumes:
- name: host
hostPath:
path: /
type: Directory
nodeSelector:
kubernetes.io/hostname: $NAME
tolerations:
- operator: "Exists"
EOF
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment