Bug 1466382 - [RFE] add selector option to oadm cordon
Summary: [RFE] add selector option to oadm cordon
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 3.5.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: 3.9.0
Assignee: Maciej Szulik
QA Contact: Xingxing Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-29 13:52 UTC by Sergi Jimenez Romero
Modified: 2019-11-05 11:50 UTC (History)
7 users (show)

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".
Clone Of:
Environment:
Last Closed: 2019-03-13 22:27:23 UTC
Target Upstream Version:
Embargoed:
maszulik: needinfo-


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:0403 0 None None None 2019-03-13 22:27:29 UTC

Description Sergi Jimenez Romero 2017-06-29 13:52:13 UTC
> 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 22:53:03 UTC
Origin PR: https://github.com/openshift/origin/pull/16445

Comment 4 Juan Vallejo 2017-10-05 13:57:03 UTC
Upstream PR [1] has merged. Waiting on Origin PR.

1. https://github.com/kubernetes/kubernetes/pull/52917

Comment 5 Xingxing Xia 2018-01-10 10:49:29 UTC
Please move to ON_QA like bug 1466390, thanks

Comment 6 Xingxing Xia 2018-01-11 07:55:28 UTC
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

Comment 13 errata-xmlrpc 2019-03-13 22:27:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:0403


Note You need to log in before you can comment on or make changes to this bug.