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

WIP: Implement LB allowed source ranges API #510

Closed

Conversation

Miciah
Copy link
Contributor

@Miciah Miciah commented Dec 9, 2020

  • pkg/operator/controller/ingress/controller.go (setDefaultPublishingStrategy): Update allowed source ranges if needed.
  • pkg/operator/controller/ingress/load_balancer_service.go (desiredLoadBalancerService): Copy the value of the ingresscontroller's spec.status.endpointPublishingStrategy.loadBalancerSourceRanges.allowedSourceRanges field to the service's spec.loadBalancerSourceRanges field.
  • pkg/operator/controller/ingress/load_balancer_service_test.go (TestLoadBalancerServiceChanged): Add test case for allowed source ranges.
  • test/e2e/operator_test.go (TestAllowedSourceRanges): New test. Verify that the operator correctly configures the load balancer service and updates the service when the allowed source ranges are changed.

Depends on the following PR:

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 9, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Miciah

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 Dec 9, 2020
Fake bump to get the LB allowed source ranges API.

* manifests/00-custom-resource-definition.yaml:
* pkg/manifests/bindata.go:
* vendor/github.com/openshift/api/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml:
* vendor/github.com/openshift/api/operator/v1/types_ingress.go: Regenerate.
* pkg/operator/controller/ingress/controller.go
(setDefaultPublishingStrategy): Update allowed source ranges if needed.
* pkg/operator/controller/ingress/load_balancer_service.go
(desiredLoadBalancerService): Copy the value of the ingresscontroller's
spec.status.endpointPublishingStrategy.loadBalancerSourceRanges.allowedSourceRanges
field to the service's spec.loadBalancerSourceRanges field.
* pkg/operator/controller/ingress/load_balancer_service_test.go
(TestLoadBalancerServiceChanged): Add test case for source range.
* test/e2e/operator_test.go (TestAllowedSourceRanges): New test.  Verify
that the operator correctly configures the load balancer service and
updates the service when the allowed source range is changed.
@Miciah Miciah force-pushed the implement-LB-allowed-source-ranges-API branch from 43bb24b to bff61df Compare December 10, 2020 02:31
@openshift-merge-robot
Copy link
Contributor

@Miciah: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/verify bff61df link /test verify
ci/prow/e2e-aws bff61df link /test e2e-aws

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.

@Miciah
Copy link
Contributor Author

Miciah commented Dec 10, 2020

/retitle WIP: Bug 1906560: Implement LB allowed source ranges API

@openshift-ci-robot openshift-ci-robot changed the title WIP: Implement LB allowed source ranges API WIP: Bug 1906560: Implement LB allowed source ranges API Dec 10, 2020
@openshift-ci-robot openshift-ci-robot added the bugzilla/severity-urgent Referenced Bugzilla bug's severity is urgent for the branch this PR is targeting. label Dec 10, 2020
@openshift-ci-robot
Copy link
Contributor

@Miciah: This pull request references Bugzilla bug 1906560, which is valid. 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.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

WIP: Bug 1906560: Implement LB allowed source ranges API

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.

@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 Dec 10, 2020
// The initial source range of 127.0.0.0/8 should block all traffic.
// Poll for a minute and verify that we do not get an HTTP response.
gotResponse := false
err := wait.PollImmediate(10*time.Second, 1*time.Minute, func() (bool, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: We want a timeout error in this case, so maybe we should replace err with _.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair point. I suppose err is redundant since we have gotResponse.

err := wait.PollImmediate(10*time.Second, 1*time.Minute, func() (bool, error) {
status, err := checkRoute()
if err != nil {
t.Logf("Got error from LB: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we change this log message to indicate that an error from the LB is an expected thing? Wouldn't want to confuse anyone reading our test logs who doesn't know what this test does.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I wasn't sure how to word this. The phrase "expected error" doesn't seem quite right because it implies that a specific error was expected. I'll add "as expected" to the message.

t.Fatal(err)
}

err = wait.PollImmediate(10*time.Second, 2*time.Minute, func() (bool, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Any particular reason that this loop has a timeout of 2 minutes, but the prior loop has a timeout of only 1 minute?

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 have a couple reasons, but I'm not sure how sound they are. First, the first timeout is expected to be hit (the request should always fail), so it's a question of how long we want the test to sit around making sure that the thing that should never happen never happens. One minute seems like a reasonable amount of time to be confident that the LB really isn't accepting connections, without increasing the overall test time in the expected case too much. Second, the second timeout is expected not to be hit, and if we only hit it because the configuration change takes longer than expected, that's a test flake, so the high timeout usually won't increase the overall test time, and when it does, it reduces flakiness, which is worth waiting an extra minute (maybe even a couple extra minutes). Does that sound reasonable?

Copy link
Contributor

Choose a reason for hiding this comment

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

Does that sound reasonable?

Yup. We can always readjust these values in the future need be.

@Miciah Miciah changed the title WIP: Bug 1906560: Implement LB allowed source ranges API WIP: Implement LB allowed source ranges API Dec 17, 2020
@openshift-ci-robot
Copy link
Contributor

@Miciah: No Bugzilla bug is referenced in the title of this pull request.
To reference a bug, add 'Bug XXX:' to the title of this pull request and request another bug refresh with /bugzilla refresh.

In response to this:

WIP: Implement LB allowed source ranges API

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.

@openshift-ci-robot openshift-ci-robot removed bugzilla/severity-urgent Referenced Bugzilla bug's severity is urgent for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Dec 17, 2020
@openshift-ci-robot
Copy link
Contributor

@Miciah: PR needs rebase.

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.

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 18, 2020
@openshift-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci-robot openshift-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 18, 2021
@Obirah
Copy link

Obirah commented Mar 19, 2021

/remove-lifecycle stale

@openshift-ci-robot openshift-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 19, 2021
@openshift-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 17, 2021
@openshift-bot
Copy link
Contributor

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci openshift-ci bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 17, 2021
@openshift-ci openshift-ci bot added the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Jul 17, 2021
@openshift-bot
Copy link
Contributor

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 17, 2021

@openshift-bot: Closed this PR.

In response to this:

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

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.

@openshift-ci openshift-ci bot closed this Aug 17, 2021
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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants