分配Pod到node
给node打上标签
kubectl label nodes <your-node-name> disktype=ssd
查看标签
kubectl get nodes --show-labels
![image-20230515171829538](/i/l/?n=23&i=blog/1441158/202307/1441158-20230724171645371-1963799859.png)
根据标签分配node
apiVersion: v1
kind: Pod
metadata:
name: nginx
labels:
env: test
spec:
containers:
- name: nginx
image: nginx
imagePullPolicy: IfNotPresent
nodeSelector:
disktype: ssd
![image-20230515172011110](/i/l/?n=23&i=blog/1441158/202307/1441158-20230724171645714-1649627252.png)
指定node
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
nodeName: foo-node # 调度 Pod 到特定的节点
containers:
- name: nginx
image: nginx
imagePullPolicy: IfNotPresent
标签:node,name,标签,nginx,Pod,分配
From: https://www.cnblogs.com/pr1s0n/p/17577788.html