You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
oc adm manage-node --evacuate is now deprecated but there was some functionality there that is missing in the new drain command. Particularly --selector and --pod-selector. The --pod-selector on evacuate allowed me to workaround #17522. See #17522 (comment):
[root@origin-master-1 ~]# oc adm manage-node --evacuate --force x.x.x.x --pod-selector='glusterfs notin (storage-pod)'
Flag --evacuate has been deprecated, use 'oadm drain NODE' instead
Migrating these pods on node:
<snip>
The text was updated successfully, but these errors were encountered:
dustymabe
changed the title
oc adm drain: add --selector and --pod-selctor
oc adm drain: add --selector and --pod-selectorDec 1, 2017
…ctl-drain
Automatic merge from submit-queue (batch tested with PRs 55751, 57337, 56406, 56864, 57347). 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>.
Add pod-selector kubectl drain
**Release note**:
```release-note
Added the ability to select pods in a chosen node to be drained, based on given pod label-selector
```
This patch adds the ability to select pods in a chosen node to be drained, based on given pod label-selector. Related downstream issue: openshift/origin#17554
Further, it removes explicit, specific, pod-controller check. The `drain` command currently fails if a pod has a controller of a `kind` [not explicitly handled in the command itself](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/drain.go#L331). This causes `drain` to be unusable if a node contains pods managed by third-party, or "unknown" controllers.
Based on [this comment](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/drain.go#L353), the expectation was to fail if a pod's controller was not found for whatever reason. I believe that the `drain` command should not care about the existence of a pod controller. It should only care whether a pod has one, and act according to that controller kind. This solves a downstream bug: openshift/origin#17563
cc @fabianofranz@deads2k @kubernetes/sig-cli-misc
oc adm manage-node --evacuate
is now deprecated but there was some functionality there that is missing in the new drain command. Particularly--selector
and--pod-selector
. The--pod-selector
onevacuate
allowed me to workaround #17522. See #17522 (comment):The text was updated successfully, but these errors were encountered: