Bug 1466382

Summary: [RFE] add selector option to oadm condor
Product: OpenShift Container Platform Reporter: Sergi Jimenez Romero <sjr>
Component: Command Line InterfaceAssignee: Juan Vallejo <jvallejo>
Status: VERIFIED --- QA Contact: Xingxing Xia <xxia>
Severity: low Docs Contact:
Priority: medium    
Version: 3.5.0CC: acomabon, aos-bugs, jokerman, jvallejo, mmccomas, xiaocwan, yapei
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Feature: new flag added to the `oc adm cordon` command to allow selecting nodes by label. Reason: There was a need to be able to mark multiple nodes as "unschedulable", without having to perform the operation on each individual node. Result: `oc adm cordon` now supports a "--selector" flag which results in all nodes matching a given label being marked as "unschedulable".
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Sergi Jimenez Romero 2017-06-29 09:52:13 EDT
> 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 `condor` 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 `condor` 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 condor should take all nodes having the specified selector.


> 10. List any affected packages or components.

Command line interface.
Comment 3 Juan Vallejo 2017-09-19 18:53:03 EDT
Origin PR: https://github.com/openshift/origin/pull/16445
Comment 4 Juan Vallejo 2017-10-05 09:57:03 EDT
Upstream PR [1] has merged. Waiting on Origin PR.

1. https://github.com/kubernetes/kubernetes/pull/52917
Comment 5 Xingxing Xia 2018-01-10 05:49:29 EST
Please move to ON_QA like bug 1466390, thanks
Comment 6 Xingxing Xia 2018-01-11 02:55:28 EST
Verified in v3.9.0-0.16.0
# oc get no --show-labels
NAME             STATUS                     ROLES     AGE       VERSION        LABELS
172.16.120.129   Ready                      <none>    33m       v1.9.0-beta1   beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/hostname=172.16.120.129,registry=enabled,role=node,router=enabled
172.16.120.54    Ready,SchedulingDisabled   <none>    34m       v1.9.0-beta1   beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/hostname=172.16.120.54,openshift-infra=apiserver,role=node

# oc adm cordon -l role=node,router=enabled
node "172.16.120.129" cordoned

# oc get no --show-labels
NAME             STATUS                     ROLES     AGE       VERSION        LABELS
172.16.120.129   Ready,SchedulingDisabled   <none>    34m       v1.9.0-beta1   beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/hostname=172.16.120.129,registry=enabled,role=node,router=enabled
172.16.120.54    Ready,SchedulingDisabled   <none>    35m       v1.9.0-beta1   beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/hostname=172.16.120.54,openshift-infra=apiserver,role=node

# oc adm uncordon -l role=node,router=enabled
node "172.16.120.129" uncordoned

# oc get no --show-labels
NAME             STATUS                     ROLES     AGE       VERSION        LABELS
172.16.120.129   Ready                      <none>    34m       v1.9.0-beta1   beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/hostname=172.16.120.129,registry=enabled,role=node,router=enabled
172.16.120.54    Ready,SchedulingDisabled   <none>    35m       v1.9.0-beta1   beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/hostname=172.16.120.54,openshift-infra=apiserver,role=node