To communicate with the database pods in our diagram below, our "mginxpod" needs to go through the "database-service" service that will forward the request to one of its database pods.
To be able to get the IP address of the "database-service", our pod needs to ask the "kube-dns" service.
Our pods and services:
To be able to see the pods and services in the cluster, we use the below command:
Our DNS service:
We display our DNS service that lives in the "kube-system" namespace using the below command: