Skip to content

Conversation

@sgreene570
Copy link
Contributor

@sgreene570 sgreene570 commented Feb 12, 2021

GCP: Implement GCP Internal LB Global Access option

This commit is in support of https://issues.redhat.com/browse/NE-518.

pkg/operator/controller/ingress/load_balancer_service.go:

Apply the GCP "Global Access" annotation to an Ingress Controller's LoadBalancer service on GCP if and only if the Ingress Controller specifies an Internal load balancer as well as a GCP ClientAccess Provider Parameter. Modify updateLoadBalancerService to trigger updates to an Ingress Controller's LoadBalancer service if the GCP Global Access annotation is changed.

pkg/operator/controller/ingress/load_balancer_service_test.go:

Add two unit test cases to TestDesiredLoadBalancerService, one for an internal Load Balancer on GCP with ClientAccess set to Global, and one for an internal Load Balancer on GCP with ClientAccess set to Local.

pkg/operator/controller/ingress/controller.go:

Sync GCP provider parameters updates from Spec to Status in SetDefaultPublishingStrategy, since those changes are safe to roll out.

test/e2e: Add GCP Global Access e2e test

test/e2e/operator_test.go:

Add a new e2e test to exercise creating an internal load balancer on gcp with ClientAccess set to Global, and then mutating the ClientAccess field to Local.

bindata: Update local CRD

go.mod: Bump openshift/api to latest

Bump openshift/api to pull in openshift/api#845.


Prerequisites:

@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 Feb 12, 2021
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 12, 2021
@sgreene570 sgreene570 force-pushed the gcp-ilb-global-access branch 2 times, most recently from 0e0afcf to d82e731 Compare February 12, 2021 21:13
@sgreene570
Copy link
Contributor Author

Let's take our new CI job for a spin.
/test e2e-gcp-operator

@sgreene570 sgreene570 force-pushed the gcp-ilb-global-access branch 3 times, most recently from 7c0a9ee to af797cd Compare February 16, 2021 22:21
@sgreene570
Copy link
Contributor Author

/test e2e-gcp-operator

@sgreene570 sgreene570 changed the title [WIP] GCP: Implement GCP Internal LB Global Access option NE-518 GCP: Implement GCP Internal LB Global Access option Feb 17, 2021
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 17, 2021
@sgreene570
Copy link
Contributor Author

Let's make sure the first pass wasn't a fluke
/test e2e-gcp-operator

specLB := effectiveStrategy.LoadBalancer
if specLB != nil && statusLB != nil && specLB.ProviderParameters != nil && statusLB.ProviderParameters != nil &&
specLB.ProviderParameters.GCP != statusLB.ProviderParameters.GCP {
ic.Status.EndpointPublishingStrategy.LoadBalancer.ProviderParameters.GCP = effectiveStrategy.LoadBalancer.ProviderParameters.GCP
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be a good time to remove the return value, since it isn't used by the caller. If we anticipate it to be used in the future, you might want to return true here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the future we might use the return value from setDefaultPublishingStrategy to detect if any changes were made to ic.Status, so for now I'll add a return value here (surprisingly this was also overlooked in the reverted mutable-scope PR #472, so nice catch!).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.


// GCPGlobalAccessAnnotation is the annotation used on an internal load balancer service
// to enable the GCP Global Access feature.
GCPGlobalAccessAnnotation = "networking.gke.io/internal-load-balancer-allow-global-access"
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest moving this to api/operator/v1/types_ingress.go, along with the other new GCP consts.

Copy link
Contributor Author

@sgreene570 sgreene570 Feb 18, 2021

Choose a reason for hiding this comment

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

Typically we don't put implementation specific constants in the ingress controller API. I think it makes the most sense to define the annotation constant here alongside all of the other provider-specific load balancer service annotations.

}

updated.Annotations[awsLBHealthCheckIntervalAnnotation] = expected.Annotations[awsLBHealthCheckIntervalAnnotation]
updated.Annotations[GCPGlobalAccessAnnotation] = expected.Annotations[GCPGlobalAccessAnnotation]
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we check the platform type and only add these annotations if the platform matches?

Copy link
Contributor Author

@sgreene570 sgreene570 Feb 18, 2021

Choose a reason for hiding this comment

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

We could, but we already check the platform type before setting the annotations anyways on expected, so I think that would be redundant.

@sgreene570 sgreene570 force-pushed the gcp-ilb-global-access branch from af797cd to 8c62352 Compare February 18, 2021 21:19
@sgreene570
Copy link
Contributor Author

/test e2e-gcp-operator

@sgreene570
Copy link
Contributor Author

myriad of flakes
/retest

@sgreene570
Copy link
Contributor Author

Failing tests:

[sig-arch][Feature:ClusterUpgrade] Cluster should remain functional during upgrade [Disruptive] [Serial]

/test e2e-upgrade

@sgreene570
Copy link
Contributor Author

/test e2e-upgrade

@sgreene570
Copy link
Contributor Author

/retest

2 similar comments
@sgreene570
Copy link
Contributor Author

/retest

@sgreene570
Copy link
Contributor Author

/retest

@sgreene570 sgreene570 force-pushed the gcp-ilb-global-access branch from 8c62352 to 04fdc9d Compare March 3, 2021 14:50
This commit is in support of https://issues.redhat.com/browse/NE-518.

pkg/operator/controller/ingress/load_balancer_service.go:

Apply the GCP "Global Access" annotation to an Ingress Controller's
LoadBalancer service on GCP if and only if the Ingress Controller specifies an
Internal load balancer as well as a GCP `ClientAccess` Provider Parameter.
Modify `updateLoadBalancerService` to trigger updates to an Ingress
Controller's LoadBalancer service if the GCP Global Access annotation
is changed.

pkg/operator/controller/ingress/load_balancer_service_test.go:

Add two unit test cases to `TestDesiredLoadBalancerService`, one for an
internal Load Balancer on GCP with `ClientAccess` set to `Global`, and
one for an internal Load Balancer on GCP with `ClientAccess` set to
`Local`.

pkg/operator/controller/ingress/controller.go:

Sync GCP provider parameters updates from Spec to Status in
`SetDefaultPublishingStrategy`, since those changes are safe to roll
out.
test/e2e/operator_test.go:

Add a new e2e test to exercise creating an internal
load balancer on gcp with `ClientAccess` set to `Global`,
and then mutating the `ClientAccess` field to `Local`.
@sgreene570 sgreene570 force-pushed the gcp-ilb-global-access branch from 04fdc9d to fb9cf27 Compare March 3, 2021 14:55
@sgreene570
Copy link
Contributor Author

/test e2e-gcp-operator

@sgreene570
Copy link
Contributor Author

must-gather failures
/test e2e-aws-operator

@sgreene570
Copy link
Contributor Author

/test e2e-upgrade

@sgreene570
Copy link
Contributor Author

sgreene570 commented Mar 4, 2021

FAIL: TestUniqueIdHeader
operator_test.go:1727: failed to observe the expected log message: timed out waiting for the condition
/retest

@sgreene570
Copy link
Contributor Author

/retest

@Miciah
Copy link
Contributor

Miciah commented Mar 8, 2021

/lgtm
Thanks!

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Miciah, sgreene570

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

The pull request process is described here

Details 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 lgtm Indicates that a PR is ready to be merged. label Mar 8, 2021
@openshift-bot
Copy link
Contributor

/retest

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

3 similar comments
@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants