Skip to content

Instantly share code, notes, and snippets.

@johananl
Last active January 6, 2020 11:11
Show Gist options
  • Save johananl/40cfe70f3d1f749dbeae6922d041852b to your computer and use it in GitHub Desktop.
Save johananl/40cfe70f3d1f749dbeae6922d041852b to your computer and use it in GitHub Desktop.
Privileged DaemonSet

Privileged DaemonSet

kubectl apply -f privileged-ds.yaml
kubectl exec -it debug-xxxxx sh
chroot /host
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: debug
labels:
k8s-app: debug
spec:
selector:
matchLabels:
name: debug
template:
metadata:
labels:
name: debug
spec:
hostNetwork: true
containers:
- name: debug
image: alpine
command: [ "sleep", "100000" ]
securityContext:
privileged: true
volumeMounts:
- name: host
mountPath: /host
volumes:
- name: host
hostPath:
path: /
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment