查看所有Pod资源的标签
kubectl get pods -A --show-labels
查看Pod标签app=nginx的pod资源
kubectl get pods -A -l app=nginx
查看Pod的app标签等于nginx或alpine的Pod资源
kubectl get pods -A -l 'app in (nginx,alpine)'
给Node添加一个daemoset=true的标签
kubectl label node k8s-node1 daemoset=true
查看Pod标签version=2的pod资源
kubectl label pod nginx version=2
查看Pod标签app=nginx但version!=2的pod
kubectll get pods -l version!=2,app=nginx
修改Pod为nginx的标签为version=3
kubectl label pod nginx version=3 --overwrite
删除nginx的version标签
kubectl label pod nginx version-