by deafult,Scheduler will schedule Pods to all available Nodes.
But in some situations,we will deploy Pod to assigned Node such as deploying using I/O’s Pod to Node with SSD,using GPU’s Pod to Node with GPU.
Using label,k8s solves this.
label is the pair of key-value .

kubectl label node k8s-0002 disktype=ssd
kubectl get node --show-labels
在这里插入图片描述
we can use the type to deploy Pod to assigned Node

spec 's nodeSelector to set the ssd Node

在这里插入图片描述

在这里插入图片描述
the Pod is running on k8s-0002 Node

delete the label
在这里插入图片描述

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐