admission: correction on podnodeselector (#8031)

podtolerationrestriction does not encompass all the use cases of
podnodeselector, in a case where not all nodes are tainted, then
podtolerationrestriction can not ensure pods are scheduled on the
specific set of nodes.
pull/8035/head
zhouhaibing089 2018-04-09 17:34:08 -07:00 committed by k8s-ci-robot
parent e66b034afd
commit 63d27dceab
1 changed files with 5 additions and 3 deletions

View File

@ -455,7 +455,7 @@ plugins:
``` ```
#### Configuration Annotation Format #### Configuration Annotation Format
`PodNodeSelector` uses the annotation key `scheduler.kubernetes.io/node-selector` to assign node selectors to namespaces. `PodNodeSelector` uses the annotation key `scheduler.alpha.kubernetes.io/node-selector` to assign node selectors to namespaces.
```yaml ```yaml
apiVersion: v1 apiVersion: v1
@ -468,7 +468,7 @@ metadata:
#### Internal Behavior #### Internal Behavior
This admission controller has the following behavior: This admission controller has the following behavior:
1. If the `Namespace` has an annotation with a key `scheduler.kubernetes.io/nodeSelector`, use its value as the 1. If the `Namespace` has an annotation with a key `scheduler.alpha.kubernetes.io/node-selector`, use its value as the
node selector. node selector.
1. If the namespace lacks such an annotation, use the `clusterDefaultNodeSelector` defined in the `PodNodeSelector` 1. If the namespace lacks such an annotation, use the `clusterDefaultNodeSelector` defined in the `PodNodeSelector`
plugin configuration file as the node selector. plugin configuration file as the node selector.
@ -476,12 +476,14 @@ This admission controller has the following behavior:
1. Evaluate the pod's node selector against the namespace-specific whitelist defined the plugin configuration file. 1. Evaluate the pod's node selector against the namespace-specific whitelist defined the plugin configuration file.
Conflicts result in rejection. Conflicts result in rejection.
**Note:** `PodTolerationRestriction` is more versatile and powerful than `PodNodeSelector` and can encompass the scenarios supported by `PodNodeSelector`. **Note:** PodNodeSelector allows forcing pods to run on specifically labeled nodes. Also see the PodTolerationRestriction
admission plugin, which allows preventing pods from running on specifically tainted nodes.
{: .note} {: .note}
### PersistentVolumeClaimResize ### PersistentVolumeClaimResize
This admission controller implements additional validations for checking incoming `PersistentVolumeClaim` resize requests. This admission controller implements additional validations for checking incoming `PersistentVolumeClaim` resize requests.
**Note:** Support for volume resizing is available as an alpha feature. Admins must set the feature gate `ExpandPersistentVolumes` **Note:** Support for volume resizing is available as an alpha feature. Admins must set the feature gate `ExpandPersistentVolumes`
to `true` to enable resizing. to `true` to enable resizing.
{: .note} {: .note}