Skip to content

Instantly share code, notes, and snippets.

Created September 11, 2023 18:10
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Obtain coredump from an application
kubectl get pods -A -o wide | grep dns
kube-system   kube-dns-5bfd847c64-bkkhf                           4/4     Running   0             80m    gke-vanilla-default-pool-ddebe65c-pkzw   <none>           <none>
kubectl debug -n kube-system -it kube-dns-5bfd847c64-bkkhf --image=busybox:1.28 --target=dnsmasq
Targeting container "dnsmasq". If you don't see processes from this container it may be because the container runtime doesn't support this feature.
Defaulting debug container name to debugger-qz6cb.
If you don't see a command prompt, try pressing enter.
/ #
/ # ps axf
    1 root      0:00 /dnsmasq-nanny -v=2 -logtostderr -configDir=/etc/k8s/dns/dnsmasq-nanny -restartDnsmasq=true -- -k --cache-size=1000 --no-negcache --dns-forward-max=1500 --log-facility=- --server=/cluster.local/ --server=/ --server=/ --max-ttl=30 --max-cache-ttl=30
   10 root      0:00 /usr/sbin/dnsmasq -k --cache-size=1000 --no-negcache --dns-forward-max=1500 --log-facility=- --server=/cluster.local/ --server=/ --server=/ --max-ttl=30 --max-cache-ttl=30
   12 root      0:00 sh
   18 root      0:00 ps axf
/ #
# ulimit -c
mkdir /dumps

on the host

echo "/dumps/core.%e.%p" > /proc/sys/kernel/core_pattern

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment