pod容忍(toleration)
污点就是拒绝,容忍就是忽略,Node通过污点拒绝pod调度上去,Pod通过容忍忽略拒绝
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-deployment
namespace: test
spec:
replicas: 1
selector:
matchLabels:
environment: stg
template:
metadata:
labels:
environment: stg
spec:
containers:
- name: nginx-container
image: nginx:latest
imagePullPolicy: IfNotPresent
ports:
- name: nginx-port
containerPort: 80
protocol: TCP
lifecycle:
postStart:
exec:
command: ["/bin/sh","-c","echo jiayouba!!!!!>/usr/share/nginx/html/index.html"]
affinity: #亲和性设置
nodeAffinity: #设置node亲和性
preferredDuringSchedulingIgnoredDuringExecution: #软限制
- weight: 1
preference:
matchExpressions:
- key: env
operator: In
values: ["aaaa","bbbb"]
tolerations:
- key: tag
operator: "Equal"
value: "ceshi"
effect: NoExecute
原文地址:http://www.cnblogs.com/bangbangzoutianya/p/16852021.html
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。