July 2018
Intermediate to advanced
504 pages
11h 34m
English
When you have an application that consists of one pod and one service, there is no problem operating these resources. But when your application grows, or you have tens or hundreds of projects, pods, services and other Kubernetes resources, it will get harder to operate and effectively troubleshoot Kubernetes. This is where we can use the Kubernetes labels we mentioned earlier in this chapter. We are going to run a couple more Kubernetes pods using labels:
$ kubectl run httpd1 --image=httpd --labels="app=httpd-demo1"$ kubectl run httpd2 --image=httpd --labels="app=httpd-demo2"
Check the Kubernetes pods we have at the moment:
$ kubectl get podsNAME READY STATUS RESTARTS AGEhttpd-8576c89d7-qjd62 1/1 Running 0 17mhttpd1-c9f7d7fd9-rn2nz ...