May 2018
Intermediate to advanced
554 pages
13h 51m
English
The preceding example shows only one IP address, because we have been setup only one Pod. What happens if you increase an instance using the kubectl scale command?
Let's increase the Apache instances on chap8-domain1 from 1 to 3, then see how the headless service DNS works:
//specify --replicas=3 $ kubectl scale deploy my-apache --namespace=chap8-domain1 --replicas=3deployment "my-apache" scaled//Now there are 3 Apache Pods$ kubectl get pods --namespace=chap8-domain1 -o wideNAME READY STATUS RESTARTS AGE IP NODEmy-apache-55fb679f49-c8wg7 1/1 Running 0 1m 172.17.0.7 minikubemy-apache-55fb679f49-cgnj8 1/1 Running 0 1m 172.17.0.8 minikubemy-apache-55fb679f49-qw58f 1/1 Running 0 8h 172.17.0.4 minikube//launch ...
Read now
Unlock full access