Skip to content

Instantly share code, notes, and snippets.

@resouer
Last active December 19, 2016 04:50
Show Gist options
  • Select an option

  • Save resouer/45a5b5a8f6c7a5381fd9002753133910 to your computer and use it in GitHub Desktop.

Select an option

Save resouer/45a5b5a8f6c7a5381fd9002753133910 to your computer and use it in GitHub Desktop.
maintain a node
// 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