I am able to connect to a service end point by doing 'exec' into any pod of the cluster and then using IP of the service as below:
root@employee-7bbb797cbf-579tr:/usr/apps# curl 10.110.13.105:8080/employee/hello hello from employee
However, following fails:
root@employee-7bbb797cbf-579tr:/usr/apps# curl employee:8080/employee/hello
it is unable to resolve if the service name is used instead of IP.
What could be missing here?
I verified all recommendations on the official link: https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/
All the checks were ok. E.g. kubectl logs -f -n kube-system coredns-76f75df574-jg9cn .:53 [INFO] plugin/reload: Running configuration SHA512 = 591cf328cccc12bc490481273e738df59329c62c0b729d94e8b61db9961c2fa5f046dd37f1cf888b953814040d180f52594972691cd6ff41be96639138a43908 CoreDNS-1.11.1 linux/amd64, go1.20.7, ae2bbc2 [INFO] Reloading [INFO] plugin/reload: Running configuration SHA512 = c0af6acba93e75312d34dc3f6c44bf8573acff497d229202a4a49405ad5d8266c556ca6f83ba0c9e74088593095f714ba5b916d197aa693d6120af8451160b80 [INFO] Reloading complete [INFO] 127.0.0.1:34979 - 61529 "HINFO IN 4479489531102655118.4960636751153247633. udp 57 false 512" NXDOMAIN qr,rd,ra 132 0.003152382s
Core-dns is in Running state and Calico is CNI being used on kubeadm installation.
The service definition is: apiVersion: v1 kind: Service metadata: name: employee labels: app: employee spec: type: ClusterIP ports:
- port: 8080 targetPort: 8080 protocol: TCP selector: app: employee