1:服务器节点需要设置 污点与标签 (污点与标签字典均为:name:hello)
2:应用服务pod 需要设置容忍度与标签
apiVersion: apps/v1 # for versions before 1.8.0 use apps/v1beta1
kind: Deployment
metadata:
name: nginx-deployment-basic
labels:
app: nginx
namespace: pre
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
nodeSelector: #节点添加name:hello标签
name: hello
tolerations: #节点添加污点name:hello
- operator: "Exists"
containers:
- name: nginx
image: nginx:1.7.9 # replace it with your exactly <image_name:tags>
ports:
- containerPort: 80
resources:
limits:
cpu: "500m"