shell

k8s labels 创建和删除

#1 lables 
# node label
[root@master01 pod]# kubectl label pods pod-self time=2023

  [root@master01 pod]# kubectl get node --show-labels

  [root@master01 pod]# kubectl label nodes node01 host-

 

#2 pod label 

  [root@master01 pod]# kubectl label nodes node01 host=01

  [root@master01 pod]# kubectl get pod --show-labels

  [root@master01 pod]# kubectl get pod -l dev -o wide

  [root@master01 pod]# kubectl label nodes node01 host-




 

posted @ 2023-05-04 14:19  devops运维  阅读(210)  评论(0编辑  收藏  举报
python