Created
July 9, 2018 19:53
-
-
Save turkenh/59c644bd110b50382f18db63aa6566bb to your computer and use it in GitHub Desktop.
Kubernetes Pod to debug docker of the Node
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-docker | |
spec: | |
nodeSelector: | |
kubernetes.io/hostname: <nodename> | |
containers: | |
- name: dind | |
image: docker:stable | |
args: | |
- sleep | |
- "36000" | |
securityContext: | |
privileged: true | |
volumeMounts: | |
- name: dockerrun | |
mountPath: /var/run/docker.sock | |
terminationGracePeriodSeconds: 30 | |
volumes: | |
- name: dockerrun | |
hostPath: | |
path: /var/run/docker.sock |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To access filesystem of a failed pod:
kubectl get pods -a -o wide
docker ps -a |grep <some string from pod name>
docker commit <container-id> temp-image
docker run -ti --entrypoint=sh temp-image