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

Bug 1809005: Always set node selector kubernetes.io/os to linux #518

Merged
merged 1 commit into from May 12, 2020
Merged

Bug 1809005: Always set node selector kubernetes.io/os to linux #518

merged 1 commit into from May 12, 2020

Conversation

ricardomaraschini
Copy link
Contributor

This assures we only run the operator and the operand on linux nodes.

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Apr 14, 2020
@openshift-ci-robot
Copy link
Contributor

@ricardomaraschini: This pull request references Bugzilla bug 1809005, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1809005: Always set node selector kubernetes.io/os to linux

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ricardomaraschini
Copy link
Contributor Author

/assign @adambkaplan @gabemontero

for k, v := range cr.Spec.NodeSelector {
nodeSelectors[k] = v
}
nodeSelectors["kubernetes.io/os"] = "linux"
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we allow users to override our default?

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 it makes sense. I have adjusted it to avoid overwrite.

@ricardomaraschini
Copy link
Contributor Author

/retest

@@ -21,6 +21,7 @@ spec:
priorityClassName: system-cluster-critical
nodeSelector:
node-role.kubernetes.io/master: ""
kubernetes.io/os: linux
Copy link
Contributor

Choose a reason for hiding this comment

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

This is somewhat redundant - we only support RHCOS masters I believe.

Copy link
Contributor

Choose a reason for hiding this comment

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

I vaguely recall a Jira story where we had to do something similar, i.e. make sure it doesn't run on windows, but I can't find the Jira story or analogous yaml in the repos I think I might have had to do this for.

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 see your point @adambkaplan. I will get rid of this.

@coreydaley
Copy link
Member

/retest

@@ -336,13 +336,21 @@ func makePodTemplateSpec(coreClient coreset.CoreV1Interface, proxyLister configl
}
}

nodeSelectors := map[string]string{}
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure how I feel about this. The image registry has to run on linux, but we are saying that an administrator can set a different os, even if it won't run there? Seems sketchy.

Copy link
Member

Choose a reason for hiding this comment

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

Settings kubernetes.io/os in this selector to anything other than linux is not supported today. However, if a customer decides to change its value anyway, the configuration should be broken today.

I can envision a situation when someone sets kubernetes.io/os to windows and forget about it, it works. Later we add support of this OS and his configuration suddenly has a new meaning.

Copy link
Contributor

Choose a reason for hiding this comment

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

Settings kubernetes.io/os in this selector to anything other than linux is not supported today

I don't think that is true. We are moving towards supporting Windows Containers (and that means Windows nodes) in the near future. My understanding is that this is "dev preview" in 4.4.

Copy link
Member

Choose a reason for hiding this comment

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

@adambkaplan are you saying that someone is trying to build the image registry for Windows?

Copy link
Contributor

Choose a reason for hiding this comment

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

@dmage - at this point no, just that there will be Windows workers and we need to ensure we don't schedule or workloads on them by default. If a customer sets the node selector to be windows, their cluster goes degraded. So 🤷

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 agree with @dmage. It is better to crash with a wrong configuration now. This way we assure that the configuration reflects user intentions once we start supporting Window hosts.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey guys, any extra consideration here? I would like to get this moving ahead.

This assures we only run the operator and the operand on linux nodes.
@ricardomaraschini
Copy link
Contributor Author

/retest

@dmage
Copy link
Member

dmage commented May 12, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 12, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dmage, ricardomaraschini

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-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 12, 2020
@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 4a84a7b into openshift:master May 12, 2020
@openshift-ci-robot
Copy link
Contributor

@ricardomaraschini: All pull requests linked via external trackers have merged: openshift/cluster-image-registry-operator#518. Bugzilla bug 1809005 has been moved to the MODIFIED state.

In response to this:

Bug 1809005: Always set node selector kubernetes.io/os to linux

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

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. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants