<p>I have a newbie question about Docker and Kubernetes.</p>

<p>For example I have three PHP services in different containers. Nginx and php-fpm are in different containers too for each PHP service (1 process = 1 container).</p>

<p>Each PHP service should know the DNS name of the other PHP services in the cluster - how can I solve this? How should I configure the cluster and containers/pods to make it possible?</p>

<p>Thank you in advance for you help.</p>

<p>Sincerely, </p>

<p>gtw000</p>

<p>Kubernetes services create a DNS record that resolves to an IP. When you communicate with this IP the request reaches one of the pods the service is targeted on.</p>

<p>For example, if you have the following services: svc1, svc2 and svc3
svc1 should be a resolvable hostname that directs the traffic to one of svc1's pods
The same goes for svc2 and svc3</p>

<p>Please read further on <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">K8s Services Docs</a></p>
