Skip to content

Conversation

@ravisantoshgudimetla
Copy link
Contributor

Add field to make % of masters to be schedulable. This is part of RHHI.next effort, where we want master nodes to be schedulable. For more context, please refer to:

https://docs.google.com/document/d/1FPvz3TyKEagXDekHhKSo7sCqHTxWnITG5pBOG4yUJgA/edit

openshift/machine-config-operator#763 (comment)

@openshift-ci-robot openshift-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 3, 2019
@ravisantoshgudimetla ravisantoshgudimetla changed the title Add master schedulable Make master nodes schedulable Jul 3, 2019
@ravisantoshgudimetla
Copy link
Contributor Author

// if we have 3 running master nodes in the cluster, setting this value to 33% means, 1
// node of 3 available master nodes would become schedulable. The absolute value is calculated
// by rounding down. This field is optional
PercentageOfMastersSchedulable intstr.IntOrString `json:"percentageOfMastersSchedulable"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need
+optional
at the end of the doc text (just like the above DefaultNodeSelector).
And also make it *intstr.IntOrString so we can distinguish unset or empty.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The naming seems awkward; how about just MaxMastersSchedulable or so, a bit like RollingUpdateDeployment's MaxUnavailable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need
+optional
at the end of the doc text (just like the above DefaultNodeSelector).

I think it's not needed as long as we provide some text. I have seen both the variants but not sure which one is preferred

The naming seems awkward; how about just MaxMastersSchedulable or so, a bit like RollingUpdateDeployment's MaxUnavailable?

Yeah, I agree. I got to know about it while I was implementing, where it's possible to have both integer values and strings. Will change that in a bit along with comments.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

intOrString for explicitly specified percentages is strange. Why not just making it a float?

And add minimum and maximum as OpenAPI specification.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add number of nodes as well, for example a user can explicitly tell 3 instead of 40%. This is the pattern we've been following in other apps.

// node of 3 available master nodes would become schedulable. The absolute value is calculated
// by rounding down. This field is optional
// +optional
MaxMastersSchedulable *intstr.IntOrString `json:"percentageOfMastersSchedulable"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be a bool. I don't see a reason to make this a percentage.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason is in future, say if we have 5 masters cluster. We can tell, I want only 2 to be schedulable, so that even if they're loaded and they go down, we can still maintain quorum(with 3 masters). The other use-case is developers telling, I want 2 nodes to be made worker nodes and let one run as master..

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@soltysh had a concern about making this a bool, specifically having to change this interface later if we ever wanted to to allow the user to specify a subset of masters that should be scheduleable.

@deads2k thoughts on that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@soltysh had a concern about making this a bool, specifically having to change this interface later if we ever wanted to to allow the user to specify a subset of masters that should be scheduleable.

@deads2k thoughts on that?

If that becomes a thing we want (and I think that's pretty unlikely), we can add another field that takes precedence over this one.

// +optional
DefaultNodeSelector string `json:"defaultNodeSelector,omitempty"`
// percentageOfMastersSchedulable allows a certain percentage of available master nodes to
// be schedulable. As of now, the supported values are 0 and 100. In future, we
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: in the future

// will allow a certain percentage of master nodes to be schedulable. For example,
// if we have 3 running master nodes in the cluster, setting this value to 33% means, 1
// node of 3 available master nodes would become schedulable. The absolute value is calculated
// by rounding down. This field is optional
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rounding down means that 33% becomes zero master.

@ravisantoshgudimetla ravisantoshgudimetla force-pushed the add-masterSchedulable branch 2 times, most recently from 7d3f3d7 to c7db6e4 Compare July 8, 2019 19:14
@openshift-ci-robot openshift-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 8, 2019
// +optional
DefaultNodeSelector string `json:"defaultNodeSelector,omitempty"`
// MastersSchedulable allows masters nodes to be schedulable. This means, if there
// are n no of master nodes in the cluster, all of them would be made schedulable.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why mention n? "This means that all of them would be made schedulable."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed it to 10 as suggested by @deads2k

// +optional
DefaultNodeSelector string `json:"defaultNodeSelector,omitempty"`
// MastersSchedulable allows masters nodes to be schedulable. This means, if there
// are n no of master nodes in the cluster, all of them would be made schedulable.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use an actual number.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

// +optional
DefaultNodeSelector string `json:"defaultNodeSelector,omitempty"`
// MastersSchedulable allows masters nodes to be schedulable. This means, if there
// are n no of master nodes in the cluster, all of them would be made schedulable.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove early period.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thanks :)

// Important Note: Once the workload pods start running on the master nodes, there
// is a very good chance that performance of control plane components is impacted.
// Please turn on this field after doing due deligence.
// +optional
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to indicate what the default is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

// so that workload pods can run on them.
// Important Note: Once the workload pods start running on the master nodes, there
// is a very good chance that performance of control plane components is impacted.
// Please turn on this field after doing due deligence.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run a spell check on your doc. diligence isn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it is. I changed it. Thanks for catching it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and what do you use for spell checking? I haven't tried anything yet of that sort and something for fedora?

@openshift-ci-robot openshift-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 8, 2019
@ravisantoshgudimetla
Copy link
Contributor Author

@deads2k and @sttts - Updated. PTAL

// +optional
DefaultNodeSelector string `json:"defaultNodeSelector,omitempty"`
// MastersSchedulable allows masters nodes to be schedulable. This means, if there
// are 10 master nodes in the cluster, all of them would be made schedulable,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same old question: what does talking about the number of masters add to the contents here? It does not matter whether we 2, 10 or 100 masters. All is all :-)

// MastersSchedulable allows masters nodes to be schedulable. This means, if there
// are 10 master nodes in the cluster, all of them would be made schedulable,
// so that workload pods can run on them. The default value for this field is false,
// meaning none of the master nodes are schedulable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

full-stop.

// meaning none of the master nodes are schedulable
// Important Note: Once the workload pods start running on the master nodes,
// extreme care must be taken to ensure that cluster-critical control plane components
// are not impacted
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

full-stop.

// +optional
DefaultNodeSelector string `json:"defaultNodeSelector,omitempty"`
// MastersSchedulable allows masters nodes to be schedulable. When this flag is
// turned on, all the master nodes in the cluster would be made schedulable,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"would be made" or "will be made" ?

// are not impacted.
// Please turn on this field after doing due diligence.
// +optional
MastersSchedulable bool `json:"MastersSchedulable"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lower-case

@sttts
Copy link
Contributor

sttts commented Jul 9, 2019

/lgtm
/approve

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 9, 2019
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ravisantoshgudimetla, sttts

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 9, 2019
@openshift-merge-robot openshift-merge-robot merged commit 1fc8159 into openshift:master Jul 9, 2019
@ravisantoshgudimetla ravisantoshgudimetla deleted the add-masterSchedulable branch July 9, 2019 15:10
ravisantoshgudimetla added a commit to ravisantoshgudimetla/machine-config-operator that referenced this pull request Jul 12, 2019
By default, the MCO's kubelet configuration injects a taint to disable scheduling. This adds
support in the MCO for watching the API recently added to allow the masters
to be schedulable. openshift/api#366

Use cases here are for 3 node bare metal clusters (which have significant resources on the masters),
as well as CodeReady Containers which wants to make a single node OpenShift as a VM.

Closes: openshift#763
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants