Merge pull request #60008 from k82cn/k8s_54313_2

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Taint node when it under PID pressure.

Signed-off-by: Da K. Ma <madaxa@cn.ibm.com>

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
part of #54313 

**Release note**:
```release-note
If TaintNodesByCondition enabled, taint node when it under PID pressure 
```
This commit is contained in:
Kubernetes Submit Queue 2018-02-20 03:13:28 -08:00 committed by GitHub
commit 5b98dbcfe5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -84,6 +84,7 @@ var (
v1.NodeOutOfDisk: algorithm.TaintNodeOutOfDisk,
v1.NodeDiskPressure: algorithm.TaintNodeDiskPressure,
v1.NodeNetworkUnavailable: algorithm.TaintNodeNetworkUnavailable,
v1.NodePIDPressure: algorithm.TaintNodePIDPressure,
}
taintKeyToNodeConditionMap = map[string]v1.NodeConditionType{
@ -91,6 +92,7 @@ var (
algorithm.TaintNodeMemoryPressure: v1.NodeMemoryPressure,
algorithm.TaintNodeOutOfDisk: v1.NodeOutOfDisk,
algorithm.TaintNodeDiskPressure: v1.NodeDiskPressure,
algorithm.TaintNodePIDPressure: v1.NodePIDPressure,
}
)

View File

@ -56,6 +56,11 @@ const (
// and removed when network becomes ready.
TaintNodeNetworkUnavailable = "node.kubernetes.io/network-unavailable"
// TaintNodePIDPressure will be added when node has pid pressure
// and feature-gate for TaintNodesByCondition flag is enabled,
// and removed when node has enough disk.
TaintNodePIDPressure = "node.kubernetes.io/pid-pressure"
// TaintExternalCloudProvider sets this taint on a node to mark it as unusable,
// when kubelet is started with the "external" cloud provider, until a controller
// from the cloud-controller-manager intitializes this node, and then removes