Last active
December 19, 2016 04:50
-
-
Save resouer/45a5b5a8f6c7a5381fd9002753133910 to your computer and use it in GitHub Desktop.
maintain a node
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // taint节点,阻止新的pod上来 | |
| kubectl taint nodes node08 dedicated=maintaining:NoSchedule | |
| // label节点,只允许指定的pod上来 | |
| kubectl label nodes node08 hyper/nodetype=maintaining | |
| // 然后在Pod定义中加入如下annotation: | |
| ``` | |
| annotations: | |
| scheduler.alpha.kubernetes.io/tolerations: '[{"key":"dedicated", "value":"maintaining"}]' | |
| scheduler.alpha.kubernetes.io/affinity: > | |
| { | |
| "nodeAffinity": { | |
| "requiredDuringSchedulingIgnoredDuringExecution": { | |
| "nodeSelectorTerms": [ | |
| { | |
| "matchExpressions": [ | |
| { | |
| "key": "hyper/nodetype", | |
| "operator": "In", | |
| "values": ["maintaining"] | |
| } | |
| ] | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| ``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment