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

OCPEDGE-1309: feat: add arbiter node check #1882

Merged

Conversation

eggfoobar
Copy link
Contributor

@eggfoobar eggfoobar commented Nov 18, 2024

Per EP: openshift/enhancements#1674

This PR adds a check for arbiter node role to guard and node controller for static pods, this is exposed via a WithArbiter builder function to the static pod builder. This should allow folks to decide if their component is designed for the arbiter or not.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Nov 18, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Nov 18, 2024

@eggfoobar: This pull request references OCPEDGE-1309 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.18.0" version, but no target version was set.

In response to this:

add check for arbiter node role to guard and node controller

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 18, 2024
@openshift-ci openshift-ci bot requested review from dgrisonnet and tkashem November 18, 2024 04:27
@eggfoobar eggfoobar force-pushed the add-arbiter-node-check branch from f3b06ce to 778398c Compare December 11, 2024 05:19
@eggfoobar eggfoobar changed the title WIP: OCPEDGE-1309: feat: add arbiter node check OCPEDGE-1309: feat: add arbiter node check Dec 11, 2024
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 11, 2024
@eggfoobar eggfoobar force-pushed the add-arbiter-node-check branch from 778398c to fb107ae Compare December 11, 2024 05:24
@openshift-ci-robot
Copy link

openshift-ci-robot commented Dec 11, 2024

@eggfoobar: This pull request references OCPEDGE-1309 which is a valid jira issue.

In response to this:

Per EP: openshift/enhancements#1674

This PR adds a check for arbiter node role to guard and node controller for static pods, this is exposed via a WithArbiter builder function to the static pod builder. This should allow folks to decide if their component is designed for the arbiter or not.

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 openshift-eng/jira-lifecycle-plugin repository.

@@ -67,6 +79,14 @@ func (c *NodeController) sync(ctx context.Context, syncCtx factory.SyncContext)
return err
}

if c.arbiterNodeSelector != nil {
arbiterNodes, err := c.nodeLister.List(c.arbiterNodeSelector)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could a new label requirement be part of an already existing selector? (line 77).
I think that a selector can accept multiple requirements.

Copy link
Contributor Author

@eggfoobar eggfoobar Dec 12, 2024

Choose a reason for hiding this comment

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

Ah, that's a good point, unfortunately, this won't work in this situation labels selectors by design do not support an or operation on keys (see). So this must be done as separate call, otherwise if we were going of values we could build an contains query.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, could you add a comment explaining that the OR operation is not supported on keys and include a link to the issue you mentioned in the other comment?

@@ -124,6 +131,11 @@ type Builder interface {
ToControllers() (manager.ControllerManager, error)
}

func (b *staticPodOperatorControllerBuilder) WithExtraNodeSelector(extraNodeSelector labels.Selector) Builder {
Copy link
Contributor

Choose a reason for hiding this comment

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

What about other controllers potentially listing the master nodes? As I understand, we will only run the etcd member on the arbiter node. Is that correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, exactly, so unless explicitly required the other controllers should run only on masters, but if they come to the conclusion they need to also run on the arbiter, we can have a path for them to do it

@p0lyn0mial
Copy link
Contributor

While reviewing this PR I found that the master nodes selector is being parsed on each sync for some controllers and decided to open #1910, PTAL.

@p0lyn0mial
Copy link
Contributor

also, what is our e2e strategy for this feature? Is there a test in the origin that will add the arbiter node?

add WithExtraNodeSelector flag to static pod builder
passed down selector to guard and node controller to query for extra
nodes as well as master nodes

Signed-off-by: ehila <ehila@redhat.com>
@eggfoobar eggfoobar force-pushed the add-arbiter-node-check branch from 9f0f3b9 to 7d2a658 Compare December 13, 2024 13:43
@eggfoobar
Copy link
Contributor Author

eggfoobar commented Dec 13, 2024

also, what is our e2e strategy for this feature? Is there a test in the origin that will add the arbiter node?

Yup! We will have tests added into origin for OLA validation, as well as CI lanes that do the install. This feature will be TechPreview in 4.19 and GA in 4.20 if all the CI signaling goes to plan for the baremetal platform

@p0lyn0mial
Copy link
Contributor

thanks!

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 13, 2024
Copy link
Contributor

openshift-ci bot commented Dec 13, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: eggfoobar, p0lyn0mial

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 openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 13, 2024
Copy link
Contributor

openshift-ci bot commented Dec 13, 2024

@eggfoobar: all tests passed!

Full PR test history. Your PR dashboard.

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-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit 389618b into openshift:master Dec 13, 2024
4 checks passed
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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants