-
Notifications
You must be signed in to change notification settings - Fork 220
NE-518 GCP: Implement GCP Internal LB Global Access option #550
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
NE-518 GCP: Implement GCP Internal LB Global Access option #550
Conversation
0e0afcf to
d82e731
Compare
|
Let's take our new CI job for a spin. |
7c0a9ee to
af797cd
Compare
|
/test e2e-gcp-operator |
|
Let's make sure the first pass wasn't a fluke |
| 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!).
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
af797cd to
8c62352
Compare
|
/test e2e-gcp-operator |
|
myriad of flakes |
/test e2e-upgrade |
|
/test e2e-upgrade |
|
/retest |
2 similar comments
|
/retest |
|
/retest |
Bump openshift/api to pull in openshift/api#845.
8c62352 to
04fdc9d
Compare
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`.
04fdc9d to
fb9cf27
Compare
|
/test e2e-gcp-operator |
|
must-gather failures |
|
/test e2e-upgrade |
|
|
|
/retest |
|
/lgtm |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
3 similar comments
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
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
ClientAccessProvider Parameter. ModifyupdateLoadBalancerServiceto 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 withClientAccessset toGlobal, and one for an internal Load Balancer on GCP withClientAccessset toLocal.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
ClientAccessset toGlobal, and then mutating theClientAccessfield toLocal.bindata: Update local CRD
go.mod: Bump openshift/api to latest
Bump openshift/api to pull in openshift/api#845.
Prerequisites: