Skip to content

apiserver pod is not able to resolve internal DNS: Name or service not known #3772

Description

@viovanov

Run minikube, then create a pod (using apiserver's image), then run:

kubectl exec -it test-pod -- sh -c "ping kubernetes"

The output correctly says:

PING kubernetes.default.svc.cluster.local (10.96.0.1) 56(84) bytes of data.

When trying to do the same thing on the api server:

kubectl exec -it kube-apiserver-minikube --namespace kube-system -- /bin/sh -c "ping kubernetes"

We get:

ping: kubernetes: Name or service not known

This happens because the resolv.conf in the apiserver pod is not pointing to the DNS service.
Why is this the case? Admission controllers (webhook servers) don't work if the apiserver can't resolve services.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/dnsDNS issueshelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/bugCategorizes issue or PR as related to a bug.lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.priority/backlogHigher priority than priority/awaiting-more-evidence.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions