Hi everyone,
Given a pod of a statefulset that is starting: do you know if there is there is causal relation between “readiness probe tells the pod is now ready” and “headless service name is resolvable inside the pod”?
The reason for that question is I have a mongodb replicaset complaining during startup:
getaddrinfo(“mymongo-mongodb-primary-0.mymongo-mongodb-headless.mongodb”) failed: Name or service not known.
Then, because the headless service name of the pod is not resolvable, the pod can’t determine that it is part of the MongoDB replica set and fails to initialize properly:
This node is not a member of the config
I’ve written a little C program that will wait until “mymongo-mongodb-primary-0.mymongo-mongodb-headless.mongodb” is resolvable (by calling getaddrinfo) before launching mongod, but that does not happen (I waited 1 minute max after the pod is started).
If I disable the readiness probe then the little program eventually manages to resolve “mymongo-mongodb-primary-0.mymongo-mongodb-headless.mongodb” (let’s say 10 seconds after the pod is started).
Is it a known behavior?
I can observe it on a 1.17.5 cluster (3 nodes, 2 masters) installed with Kubespray 1 month ago. I upgraded it to 1.18.3 (with Kubespray) but it is still the same.
Thanks for any insight!
Bruno.