和
-
key
: -
value
: -
effect
:-
NoSchedule
-
PreferNoSchedule
-
NoExecute
-
-
key
: -
operator
:-
Equal
-
Exists
-
-
value
:operator
Equal
-
effect
:
-
gpu=true:NoSchedule
gpu=true:NoSchedule
-
NoExecute
-
-
kubectl taint nodes <node-name> key1=value1:NoSchedule
<node-name>
key1
value1
NoSchedule
。
apiVersion: v1 kind: Pod metadata: name: my-pod spec: containers: - name: my-container image: nginx:latest tolerations: - key: "key1" operator: "Equal" value: "value1" effect: "NoSchedule"
my-pod
key1=value1:NoSchedule
Exists
apiVersion: v1 kind: Pod metadata: name: my-pod spec: containers: - name: my-container image: nginx:latest tolerations: - key: "key1" operator: "Exists" effect: "NoSchedule"
my-pod
key1
-
Exists
key
、value
effect
)。 -
。
-
kubectl taint nodes <node-name> <key>-
-
tolerations
:
-
kubectl taint nodes node1 key1=value1:NoSchedule
-
kubectl taint nodes node1 key1=value1:NoExecute
-
kubectl taint nodes node1 key2=value2:NoSchedule
tolerations: - key: "key1" operator: "Equal" value: "value1" effect: "NoSchedule" - key: "key1" operator: "Equal" value: "value1" effect: "NoExecute"
tolerations: - key: "key1" operator: "Equal" value: "value1" effect: "NoExecute" tolerationSeconds: 3600
-
key=env,value=prod,effect=NoSchedule
-
key=disktype,value=ssd,effect=NoSchedule
-
key=zone,value=us-east-1,effect=NoSchedule
tolerations
apiVersion: v1 kind: Pod metadata: name: my-pod spec: containers: - name: my-container image: nginx:latest tolerations: - key: "env" operator: "Equal" value: "prod" effect: "NoSchedule" - key: "disktype" operator: "Equal" value: "ssd" effect: "NoSchedule" - key: "zone" operator: "Equal" value: "us-east-1" effect: "NoSchedule"
my-pod