Created
April 20, 2018 12:14
-
-
Save ffledgling/c5cbe1ba079bcd850d8964cbf7b2c8d7 to your computer and use it in GitHub Desktop.
Get a rootcontainer on a kubernetes node. Useful for debugging, when you don't have access to or can't install stuff on the actual node. `kubectl apply -f root-container.yaml` and `kubectl exec -it debug-pod /bin/bash` to execute.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: debug-pod | |
spec: | |
hostNetwork: true | |
nodeSelector: | |
kubernetes.io/hostname: kubenode.example.com | |
containers: | |
- name: myshell | |
image: "ubuntu:16.04" | |
command: | |
- /bin/sleep | |
- "30000" | |
securityContext: | |
privileged: true | |
capabilities: | |
add: | |
- NET_ADMIN | |
- SYS_ADMIN | |
volumeMounts: | |
- mountPath: /host-root | |
name: test-volume | |
volumes: | |
- name: test-volume | |
hostPath: | |
# directory location on host | |
path: / | |
# this field is optional | |
type: Directory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment