May 2018
Intermediate to advanced
554 pages
13h 51m
English
The equality-based selector can specify equal or not equal, and also uses commas to add more criteria. Use the -l or --selector option to specify these criteria to filter the name of the object; for example:
$ kubectl get pods -l "project=pilot"NAME READY STATUS RESTARTS AGEpilot.dev.memcached 1/1 Running 0 21mpilot.dev.nginx 1/1 Running 0 21mpilot.prod.memcached 1/1 Running 0 21mpilot.prod.nginx 1/1 Running 0 21m
$ kubectl get pods -l "tier=frontend"NAME READY STATUS RESTARTS AGEpilot.dev.nginx 1/1 Running 0 21mpilot.prod.nginx 1/1 Running 0 21mpoc.dev.httpd 1/1 Running 0 21m
Read now
Unlock full access