Score:0

Why does 'kubectl' sometimes return a *node* name instead of the *pod* name if the specified pod no longer exists in the cluster?

cn flag
ebr

Sometimes kubectl get pod some-pod-1234abc returns an error like: Error from server (NotFound): pods "ip-192-168-55-196.us-east-1.compute.internal" not found. This is surprising because the error references a node, not a pod name. This happens very rarely, and seems to be (I've yet to verify this with certainty) happening only for pods that were recently deleted.

What conditions could cause this to happen? this is a Kubernetes 1.20 cluster in AWS EKS, using Spot instances. I am not concerned with the pods being deleted, but am trying to understand why the node name is returned by kubectl in the message, instead of the pod name.

in flag
You can try dialing up the verbosity of kubectl to see what, exactly, it is requesting. Usually the mention of Node names when trying to interact with Pod resources is for the logs, since it needs to contact kubelet on port 10254 to obtain the logs, but I don't recall ever having seen that behavior with just a `get pods` operation
Wytrzymały Wiktor avatar
it flag
Hello @ebr. Any updates?
ebr avatar
cn flag
ebr
@WytrzymałyWiktor check Rajesh Dutta's answer below. It makes sense that the pod gets a DNS entry that *looks* like a node name, but in fact is simply a standard internal DNS name used by AWS networking
Score:2
br flag

This is expected behavior. That is how a Pod is registered in DNS(AAAA record).

Syntax: pod-ip-address.namespace.pod.cluster

In my understanding:

Pod

  • ip-address = ip-192-168-55-196
  • namespace = us-east-1
  • Cluster = compute.internal

Check this link.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.