-
Notifications
You must be signed in to change notification settings - Fork 209
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
Add support for Instance Alias IP Ranges #1314
base: main
Are you sure you want to change the base?
Conversation
Hi @jwmay2012. 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. |
03a062f
to
dffd907
Compare
/ok-to-test |
9e02c2d
to
7436d66
Compare
7436d66
to
e21cb7f
Compare
e21cb7f
to
4659fe2
Compare
Rebased. |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
Having the ability to utilize Native Networking in GCP for pods and services from CAPI && CAPG is pretty neat and enabled by being able to configure these Alias IP Ranges. Is there something I could do to help move this ticket forward? Thanks :) |
api/v1beta1/gcpmachine_types.go
Outdated
// CIDR-formatted string (such as 10.1.2.0/24). | ||
IPCidrRange string `json:"ipCidrRange"` | ||
// SubnetworkRangeName is the name of a subnetwork secondary IP range from which | ||
// to allocate an IP alias range. If not specified, the primary range of the | ||
// subnetwork is used. | ||
SubnetworkRangeName string `json:"subnetworkRangeName,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.
Would you please explicitly mark these fields as required?
Do we need any other form of openAPI schema validation for these two fields?
Maybe something similar to this for example? (not verified) https://github.com/openshift/api/blob/9e59a77ed2e001a28bf82cc1084699a4989bba23/operator/v1/types_ingress.go#L452-L459
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.
Done :)
The SubnetworkRangeName
field is optional and can be set automatically by GCP when empty, so no 'required' flag for that one.
ipCidrRange accepted values-- (IPv4) or (/netmask) or (IPv4/netmask)
Additional manual validation--
aliasIPRanges:
- ipCidrRange: /33
subnetworkRangeName: subnet-name
API server says:
GCPMachineTemplate.infrastructure.cluster.x-k8s.io "my-machine-template" is invalid: spec.template.spec.aliasIPRanges[0].ipCidrRange:
Invalid value: "/33": spec.template.spec.aliasIPRanges[0].ipCidrRange in body should match '^((([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/([0-9]|[12][0-9]|3[0-2])|(([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|(/([0-9]|[12][0-9]|3[0-2])))$' (reason: Invalid)
------------------------------------------
aliasIPRanges:
- subnetworkRangeName: subnet-name
Invalid value: ""
------------------------------------------
aliasIPRanges:
- ipCidrRange: 1270.0.0.1/24
subnetworkRangeName: subnet-name
Invalid value: "1270.0.0.1/24"
------------------------------------------
aliasIPRanges:
- ipCidrRange: 1270.0.0.1/24
subnetworkRangeName: subnet-name
Invalid value: "127.0.0.1a"
------------------------------------------
no `aliasIPRanges:` field
API server accepts
------------------------------------------
aliasIPRanges:
- ipCidrRange: /24
subnetworkRangeName: subnet-name
API server accepts
------------------------------------------
aliasIPRanges:
- ipCidrRange: 127.0.0.1/24
subnetworkRangeName: subnet-name
API server accepts
------------------------------------------
aliasIPRanges:
- ipCidrRange: 127.0.0.1
subnetworkRangeName: subnet-name
API server accepts
------------------------------------------
aliasIPRanges:
- ipCidrRange: /24
API server accepts
------------------------------------------
I think this would be a good addition. |
4659fe2
to
fd8910f
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: jwmay2012 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
cf57659
to
9c3185f
Compare
9c3185f
to
a25d801
Compare
What type of PR is this?
/kind feature
What this PR does / why we need it:
Allows instances to be created with a Secondary Alias IP/CIDR Range configured.
https://cloud.google.com/vpc/docs/alias-ip
This enables things like Cilium to use Google Cloud's networks for Native Routing.
By giving each pod/service an IP from the Alias IP Range.
TODOs:
Release note: