> 3. What is the nature and description of the request? Having to specify nodes one by one is cumbersome in big clusters when doing maintenances. > 4. Why does the customer need this? (List the business requirements here) Given that evacuate option is being deprecated, it'd be useful to have `drain` to take `selector` as option. > 5. How would the customer like to achieve this? (List the functional requirements here) It should be possible to use a selector when using `drain` sub-command. > 6. For each functional requirement listed, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented. Using --selector together with drain should take all nodes having the specified selector. > 10. List any affected packages or components. Command line interface.
Origin PR: https://github.com/openshift/origin/pull/16445
Upstream PR has merged [1]. Waiting on Origin PR. 1. https://github.com/kubernetes/kubernetes/pull/52917
Hi! the Origin PR seems stuck at: Submit Queue — Will not auto merge because kind/bug is missing Besides, do we already have a target release for this RFE? Thanks!
Now in v3.9.0-0.16.0, it includes --selector # oc adm drain -h ... -l, --selector='': Selector (label query) to filter on ... And the flag works # oc adm drain --selector router=enabled node "172.16.120.33" cordoned error: unable to drain node "172.16.120.33", aborting command... There are pending nodes to be drained: 172.16.120.33 error: pods with local storage (use --delete-local-data to override): mongodb-1-2scgl, nodejs-mongodb-example-1-build, django-ex-1-build; DaemonSet-managed pods (use --ignore-daemonsets to ignore): apiserver-dwv59 # oc adm drain --selector router=enabled --delete-local-data --ignore-daemonsets node "172.16.120.33" already cordoned WARNING: Deleting pods with local storage: mongodb-1-2scgl, nodejs-mongodb-example-1-build, django-ex-1-build; Ignoring DaemonSet-managed pods: apiserver-dwv59 pod "asb-1-deploy" evicted pod "asb-etcd-1-deploy" evicted pod "nodejs-mongodb-example-1-build" evicted pod "django-ex-1-build" evicted pod "router-1-zz7pq" evicted pod "docker-registry-1-kbrcv" evicted pod "django-ex-1-s2hp5" evicted pod "mongodb-1-2scgl" evicted pod "nodejs-mongodb-example-1-xc5sk" evicted pod "registry-console-1-jncc6" evicted node "172.16.120.33" drained # oc get po --all-namespaces NAMESPACE NAME READY STATUS RESTARTS AGE default docker-registry-1-fdjqv 0/1 Pending 0 1m default registry-console-1-g74bq 0/1 Pending 0 1m default router-1-s7dnq 0/1 Pending 0 1m kube-service-catalog apiserver-5ccf9 1/1 Running 0 9h kube-service-catalog controller-manager-zjmwc 1/1 Running 2 9h openshift-template-service-broker apiserver-bwcn6 1/1 Running 0 9h openshift-template-service-broker apiserver-dwv59 1/1 Running 0 9h