Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/types/defaults/installconfig: Set defaults for null replicas #1146

Merged

Conversation

wking
Copy link
Member

@wking wking commented Jan 29, 2019

We don't currently support configuring zero workers (#958), largely because some key operators still do not tolerate masters. Still, some users are attempting to work around our checks by leaving replicas unset (which ends up as nil in Go). This pull-request adjusts our install-config defaulting to fill in the default replicas when the user provides machine-pool entries but leaves replicas unset.

@openshift-ci-robot openshift-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jan 29, 2019
Copy link
Contributor

@staebler staebler left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me.

Can you change the comments for Replicas to reflect what the default values actually are? Also, my preference would be that the Replicas field be omitempty, too, since it is not required.

// Replicas is the count of machines for this machine pool.
// Default is 1.
Replicas *int64 `json:"replicas"`

We don't currently support configuring zero workers [1], largely
because some key operators still do not tolerate masters.  Still, some
users are attempting to work around our checks by leaving 'replicas'
unset (which ends up as nil in Go) [2].  This commit adjusts our
install-config defaulting to fill in the default replica counts when
the user provides machine-pool entries but leaves replicas unset.

[1]: openshift#958
[2]: https://bugzilla.redhat.com/show_bug.cgi?id=1670005#c1
@wking
Copy link
Member Author

wking commented Jan 29, 2019

Can you change the comments for Replicas to reflect what the default values actually are?

I've dropped the old line. I haven't added a new line, because it would take a few lines to describe the current, platform-specific defaults, and users who care can just look in a generated install-config.yaml.

Also, my preference would be that the Replicas field be omitempty, too, since it is not required.

Done with 9eeb259 -> 4b553cd, which also fixes the gofmt issue.

@staebler
Copy link
Contributor

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: staebler, wking

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

The pull request process is described here

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-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit d3ff3af into openshift:master Jan 30, 2019
@smarterclayton
Copy link
Contributor

Do all the teams that don't tolerate masters have high severity bugs to fix that?

@wking wking deleted the defaults-for-null-replicas branch January 30, 2019 17:56
@wking
Copy link
Member Author

wking commented Jan 30, 2019

Do all the teams that don't tolerate masters have high severity bugs to fix that?

In a libvirt cluster just now (because I never get libvirt workers due to openshift/cluster-api-provider-libvirt#45):

$ oc get pods --all-namespaces | grep Pending
openshift-ingress                            router-default-7688479d99-nbnj8                            0/1       Pending     0          21m
openshift-monitoring                         prometheus-operator-647d84b5c6-rsplb                       0/1       Pending     0          21m
openshift-operator-lifecycle-manager         olm-operators-sf5sm                                        0/1       Pending     0          26m
$ oc get pod -o "jsonpath={.status.conditions}{'\n'}" -n openshift-ingress router-default-7688479d99-nbnj8
[map[reason:Unschedulable message:0/1 nodes are available: 1 node(s) didn't match node selector. type:PodScheduled status:False lastProbeTime:<nil> lastTransitionTime:2019-01-30T20:00:04Z]]
$ oc get pod -o "jsonpath={.status.conditions}{'\n'}" -n openshift-monitoring prometheus-operator-647d84b5c6-rsplb
[map[message:0/1 nodes are available: 1 node(s) had taints that the pod didn't tolerate. type:PodScheduled status:False lastProbeTime:<nil> lastTransitionTime:2019-01-30T20:00:03Z reason:Unschedulable]]
$ oc get pod -o "jsonpath={.status.conditions}{'\n'}" -n openshift-operator-lifecycle-manager olm-operators-sf5sm
[map[type:PodScheduled status:False lastProbeTime:<nil> lastTransitionTime:2019-01-30T19:55:21Z reason:Unschedulable message:0/1 nodes are available: 1 node(s) had taints that the pod didn't tolerate.]]

I'll make sure those get tracking issues.

@wking
Copy link
Member Author

wking commented Jan 30, 2019

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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants