Skip to content

Instantly share code, notes, and snippets.

@elmariofredo
Created March 24, 2020 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elmariofredo/d29d935e2220bcfbb1716ef86d436839 to your computer and use it in GitHub Desktop.
Save elmariofredo/d29d935e2220bcfbb1716ef86d436839 to your computer and use it in GitHub Desktop.
K8s debug pods
apiVersion: v1
kind: Pod
metadata:
name: dnsutils
namespace: default
spec:
containers:
- name: dnsutils
image: gcr.io/kubernetes-e2e-test-images/dnsutils:1.3
command:
- sleep
- "3600"
imagePullPolicy: IfNotPresent
securityContext:
privileged: true
volumeMounts:
- name: resolvconf
mountPath: /resolv.conf
restartPolicy: Always
volumes:
- name: resolvconf
hostPath:
# directory location on host
path: /etc/resolv.conf
# this field is optional
type: File
apiVersion: v1
kind: Pod
metadata:
name: hostmount
namespace: default
spec:
containers:
- name: busybox
image: busybox
resources:
limits:
cpu: 200m
memory: 100Mi
requests:
cpu: 100m
memory: 50Mi
stdin: true
securityContext:
privileged: true
volumeMounts:
- name: host-root-volume
mountPath: /host
readOnly: true
volumes:
- name: host-root-volume
hostPath:
path: /
hostNetwork: true
hostPID: true
restartPolicy: Always
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment