-
Notifications
You must be signed in to change notification settings - Fork 223
option to enable global access for internal passthrough load balancers #1469
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
Conversation
|
Welcome @hrbasic! |
|
Hi @hrbasic. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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-sigs/prow repository. |
✅ Deploy Preview for kubernetes-sigs-cluster-api-gcp ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
/ok-to-test |
richardcase
left a comment
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.
Thanks for this @hrbasic 🙇
The pointer isn't needed on the bool field if you don't want to distinguish between "not set" and "false".
Apart from that, looks good to me.
api/v1beta1/types.go
Outdated
| // to access Internal Passthrough Network Load Balancer. | ||
| // Defaults to false. | ||
| // +optional | ||
| AllowGlobalAccess *bool `json:"allowGlobalAccess,omitempty"` |
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.
| AllowGlobalAccess *bool `json:"allowGlobalAccess,omitempty"` | |
| AllowGlobalAccess bool `json:"allowGlobalAccess,omitempty"` |
api/v1beta1/types.go
Outdated
| // AllowGlobalAccess allows clients from any region | ||
| // to access Internal Passthrough Network Load Balancer. | ||
| // Defaults to false. | ||
| // +optional | ||
| AllowGlobalAccess *bool `json:"allowGlobalAccess,omitempty"` |
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.
The use of Booleans in new Kubernetes (and CAPI) APIs is strongly discouraged.
Reference in the Kubernetes API conventions: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#primitive-types
Think twice about bool fields. Many ideas start as boolean but eventually trend towards a small set of mutually exclusive options. Plan for future expansions by describing the policy options explicitly as a string type alias (e.g. TerminationMessagePolicy).
The suggested replacement is to use an Enum Type. So for example in this case you could define something like:
internalAccess, which can take two values: Regional | Global
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.
Thats a good point @damdo. And KAL will pick that up when we add it.
I don't feel overly opinionated on the use of a bool here, but an enum will be more future-proof for sure.
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.
Thank you for your review and comments. I've updated the code to use an enum instead of a bool, as you suggested. Please let me know if there's anything else you'd like me to address.
5dcd961 to
7bfe66c
Compare
damdo
left a comment
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.
Thanks for the change to Enum, I left some nits on the consts naming but mostly LGTM
333747b to
1d6db6d
Compare
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hrbasic, richardcase 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 |
damdo
left a comment
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.
/lgtm
/kind feature
What this PR does / why we need it:
When Cluster API (CAPI) is deployed in a different region or outside of the Google Cloud Platform (GCP), reconciliation fails because CAPI cannot reach the control plane API. Enabling the global access option on the internal passthrough load balancer would resolve this issue.
Which issue(s) this PR fixes
Fixes #1468
Release note: