Discovering Services
Learn the process of discovering Services.
Discovering Services using DNS and environment variables
Services can be discovered through two principal modes:
- Environment variables
- DNS
Every Pod gets environment variables for each of the active Services. They are provided in the same format as what Docker links expect, as well as with the simpler Kubernetes-specific syntax.
Let's get environment variables for go-demo-2-db :
The output is limited to the environment variables related to the go-demo-2-db Service. It is as follows:
The first five variables use the Docker format. If you have already worked with Docker networking, you must be familiar with the way Swarm (standalone) and Docker Compose operate. The later ...