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

OCPBUGS-30833: Added a check for loadBalancerClass for built-in load balancing service. #3142

Merged
merged 2 commits into from
Apr 8, 2024

Conversation

jdhirst
Copy link
Contributor

@jdhirst jdhirst commented Mar 12, 2024

Fixes #3136

Which issue(s) this PR addresses: #3136

Closes #3136

This is my idea for an option to implement the checking of loadBalancerClass in the internal load balancing service. It would avoid conflicts with metallb or other load balancers being used.

I specified "microshift-internal" as the name of the internal balancer service, but that could be anything really, was just the first thing that I thought of.

Let me know what you think 😄

@openshift-ci openshift-ci bot requested review from jogeo and pmtk March 12, 2024 10:11
@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 12, 2024
Copy link
Contributor

openshift-ci bot commented Mar 12, 2024

Hi @jdhirst. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@pacevedom
Copy link
Contributor

/assign @pacevedom

Copy link
Contributor

@pacevedom pacevedom left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I left one small comment.

@@ -154,7 +154,7 @@ func (c *LoadbalancerServiceController) updateServiceStatus(key string) error {
klog.Infof("Service %s does not exist anymore", key)
} else {
svc := obj.(*corev1.Service)
if svc.Spec.Type != corev1.ServiceTypeLoadBalancer {
if svc.Spec.Type != corev1.ServiceTypeLoadBalancer || (svc.Spec.LoadBalancerClass != nil && *svc.Spec.LoadBalancerClass != "microshift-internal") {
Copy link
Contributor

Choose a reason for hiding this comment

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

While the controller is too open now (thanks for catching that!), this might be a bit too restrictive. This controller acts not just on MicroShift-owned resources, but also on any LoadBalancer service owned by applications.
By requiring the loadBalancerClass to match an expected value, MicroShift would be imposing that need to already deployed services and they would fail to pick up IPs again. This would happen in an upgrade, for example. Also, requiring this value in application's manifests would break compatibility with OpenShift and would require specific configuration for apps to run on MicroShift.
Instead of checking a specific value of the loadBalancerClass, I would check for emptiness instead.
From the docs:

If you specify .spec.loadBalancerClass, it is assumed that a load balancer implementation that matches the specified class is watching for Services. Any default load balancer implementation (for example, the one provided by the cloud provider) will ignore Services that have this field set.

I would drop the second part of the new check and that should work in all cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for reviewing my request! Yep, that makes perfect sense! I updated the PR with only the check for nil now 😄

@dhellmann
Copy link
Contributor

/retitle OCPBUGS-30833: Added a check for loadBalancerClass for built-in load balancing service.

@openshift-ci openshift-ci bot changed the title Added a check for loadBalancerClass for built-in load balancing service. OCPBUGS-30833: Added a check for loadBalancerClass for built-in load balancing service. Mar 12, 2024
@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Mar 12, 2024
@openshift-ci-robot
Copy link

@jdhirst: This pull request references Jira Issue OCPBUGS-30833, which is invalid:

  • expected the bug to target the "4.16.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

Fixes #3136

Which issue(s) this PR addresses: #3136

Closes #3136

This is my idea for an option to implement the checking of loadBalancerClass in the internal load balancing service. It would avoid conflicts with metallb or other load balancers being used.

I specified "microshift-internal" as the name of the internal balancer service, but that could be anything really, was just the first thing that I thought of.

Let me know what you think 😄

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.

@dhellmann
Copy link
Contributor

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Mar 12, 2024
@openshift-ci-robot
Copy link

@dhellmann: This pull request references Jira Issue OCPBUGS-30833, which is valid. The bug has been moved to the POST state.

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

Requesting review from QA contact:
/cc @jogeo

In response to this:

/jira refresh

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.

@pacevedom
Copy link
Contributor

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 12, 2024
Copy link
Contributor

@pacevedom pacevedom left a comment

Choose a reason for hiding this comment

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

Verified to be working by QE.
/approve
/lgtm

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

openshift-ci bot commented Apr 8, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jdhirst, pacevedom

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 Apr 8, 2024
@asood-rh
Copy link

asood-rh commented Apr 8, 2024

/ocpbugs cc-qa

@asood-rh
Copy link

asood-rh commented Apr 8, 2024

/label qe-approved

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Apr 8, 2024
@openshift-ci-robot
Copy link

@jdhirst: This pull request references Jira Issue OCPBUGS-30833, which is valid.

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

Requesting review from QA contact:
/cc @jogeo

In response to this:

Fixes #3136

Which issue(s) this PR addresses: #3136

Closes #3136

This is my idea for an option to implement the checking of loadBalancerClass in the internal load balancing service. It would avoid conflicts with metallb or other load balancers being used.

I specified "microshift-internal" as the name of the internal balancer service, but that could be anything really, was just the first thing that I thought of.

Let me know what you think 😄

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.

@asood-rh
Copy link

asood-rh commented Apr 8, 2024

Details of the pre-merge testing can be found in JIRA ticket for the bug.

Copy link
Contributor

openshift-ci bot commented Apr 8, 2024

@jdhirst: 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/test-infra repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit 5f38f7f into openshift:main Apr 8, 2024
8 checks passed
@openshift-ci-robot
Copy link

@jdhirst: Jira Issue OCPBUGS-30833: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-30833 has been moved to the MODIFIED state.

In response to this:

Fixes #3136

Which issue(s) this PR addresses: #3136

Closes #3136

This is my idea for an option to implement the checking of loadBalancerClass in the internal load balancing service. It would avoid conflicts with metallb or other load balancers being used.

I specified "microshift-internal" as the name of the internal balancer service, but that could be anything really, was just the first thing that I thought of.

Let me know what you think 😄

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.

@jdhirst jdhirst deleted the loadbalancerclass branch April 9, 2024 07:54
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-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. qe-approved Signifies that QE has signed off on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Metallb conflict with built-in load balancing service
5 participants