---
# pod.yaml
apiVersion: v1
kind: Pod
metadata:
labels:
run: netshoot
name: netshoot
spec:
hostPID: true
hostIPC: true
hostNetwork: true
volumes:
- name: host-fs
hostPath:
path: /
containers:
- image: nicolaka/netshoot
name: netshoot
command: ["/bin/sh", "-c", "sleep infinity"]
securityContext:
privileged: true
allowPrivilegeEscalation: true
volumeMounts:
- name: host-fs
mountPath: /host
restartPolicy: Never
nodeSelector:
kubernetes.io/hostname: <<< PUT NODE NAME HERE >>>
kubectl apply -g pod.yaml
kubectl exec -it netshoot -- bash
chroot /host/ bash