I am new to k8 and I am learning how DNS works inside a k8 cluster. I am able to get the contents of /etc/resolv.conf
of a random pod in the default namespace but I am unable to get the contents /etc/resolv.conf
of coredns pod in kube-system
namespace.
$>kubectl exec kubia-manual-v2 -- cat /etc/resolv.conf
Output:
nameserver 10.96.0.10
$>kubectl exec coredns-74ff55c5b-c8dk6 --namespace kube-system -- cat /etc/resolv.conf
Output:
OCI runtime exec failed: exec failed: container_linux.go:370: starting container process caused: exec: "cat": executable file not found in $PATH: unknown
command terminated with exit code 126
It looks like the cat
system binary is not present in the $PATH
. So, I wanted to know how can I get the contents of /etc/resol.conf
of coredns pod.
image
that is being used by thecore-dns
pod, mostly likely it doesn't have thecat
binary with the image. – Failcat
package or check if core-dns pod hashead
ortail
package which can also be used to print file contents. – Medium