Selectors
Selectors help to choose and find the resources that you are particularly looking for using labels.
For working with selectors, here is an example find you can proceed with. The same can be extended to deployments and services.
$ kubectl create -f <file name for deployment>$ kubectl get pods - -show-labels$ kubectl get pods - -selector env=production$ kubectl get pods --selector dev-lead=carisaWorking with Multiple Selectors
$ kubectl get pods --selector env=production,dev-lead=carisa$ kubectl get pods --selector env=production,dev-lead!=carisaIn and Not In Operator
Deleting pods with labels
Last updated
Was this helpful?