May 2018
Intermediate to advanced
554 pages
13h 51m
English
Kubernetes assigns the domain name for the pod as <IP address>.<Namespace name>.pod.cluster.local. Because it uses the pod's IP address, FQDN is not guaranteed to be present permanently, but it is nice to have in case an application needs FQDN.
Let's deploy apache2 (httpd) on chap8-domain1 and chap8-domain2, as follows:
$ kubectl run my-apache --image=httpd --namespace chap8-domain1deployment "my-apache" created$ kubectl run my-apache --image=httpd --namespace chap8-domain2deployment "my-apache" created
Type kubectl get pod -o wide to capture an IP address for those pods:
$ kubectl get pods -o wide --namespace=chap8-domain1NAME READY STATUS RESTARTS AGE IP NODEmy-apache-55fb679f49-qw58f 1/1 Running 0 27s 172.17.0.4 minikube ...