-
Notifications
You must be signed in to change notification settings - Fork 87
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
Support DualStack(IPv4+IPv6) #848
base: master
Are you sure you want to change the base?
Conversation
@mohamed-rafraf Thank you for your contribution. |
Thank you @mohamed-rafraf for your contribution. Before I can start building your PR, a member of the organization must set the required label(s) {'reviewed/ok-to-test'}. Once started, you can check the build status in the PR checks section below. |
Please remove the ULA part from the PR description and sign the contributors agreement. After internal discussion, we would like the machine-controller-manager change (if required) in this PR as well. This pull should provide dual-stack VPC/subnet and enable VMs to also have IPv6 addresses if necessary. |
/ok-to-test |
@mohamed-rafraf You need rebase this pull request with latest master branch. Please check. |
586844b
to
748b10f
Compare
charts/internal/seed-controlplane/charts/ingress-gce/templates/service-account.yaml
Outdated
Show resolved
Hide resolved
29014f7
to
00ee2a1
Compare
/ok-to-test |
/ok-to-test |
see gardener#848 Signed-off-by: Artiom Diomin <[email protected]>
name: ingress-gce | ||
namespace: {{ .Release.Namespace }} | ||
annotations: | ||
scheduler.alpha.kubernetes.io/critical-pod: '' |
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.
Is this annotation needed?
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's here from the upstream. I will replace it with priorityClassName: system-cluster-critical
as such annotations don't work anymore.
imagevector/images.yaml
Outdated
integrity_requirement: 'high' | ||
availability_requirement: 'low' | ||
- name: default-http-backend | ||
sourceRepository: github.com/kubernetes/ingress-gce |
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.
sourceRepository: github.com/kubernetes/ingress-gce | |
sourceRepository: https://github.com/gardener/ingress-default-backend |
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.
That's a different one, not related to GCP
pkg/apis/gcp/types_infrastructure.go
Outdated
@@ -69,6 +72,8 @@ const ( | |||
PurposeNodes SubnetPurpose = "nodes" | |||
// PurposeInternal is a SubnetPurpose for internal use. | |||
PurposeInternal SubnetPurpose = "internal" | |||
// PurposeServices is a SubnetPurpose for internal use. |
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.
// PurposeServices is a SubnetPurpose for internal use. | |
// PurposeServices is a SubnetPurpose for services. |
@@ -74,6 +77,8 @@ const ( | |||
PurposeNodes SubnetPurpose = "nodes" | |||
// PurposeInternal is a SubnetPurpose for internal use. | |||
PurposeInternal SubnetPurpose = "internal" | |||
// PurposeServices is a SubnetPurpose for internal use. |
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.
// PurposeServices is a SubnetPurpose for internal use. | |
// PurposeServices is a SubnetPurpose for services. |
}, | ||
) |
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.
}, | |
) | |
}) |
region = fctx.infra.Spec.Region | ||
) | ||
func (fctx *FlowContext) ensureIPv6CIDRs(ctx context.Context) error { | ||
nodeSubnet := fctx.whiteboard.GetObject(ObjectKeyNodeSubnet).(*compute.Subnetwork) |
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.
Consider using: GetObject[*compute.Subnetwork](fctx.whiteboard, ObjectKeyNodeSubnet)
nodeSubnet := fctx.whiteboard.GetObject(ObjectKeyNodeSubnet).(*compute.Subnetwork) | |
nodeSubnet := GetObject[*compute.Subnetwork](fctx.whiteboard, ObjectKeyNodeSubnet) |
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.
GetObject() checks if object exists and return new(T) in case if object is not found, the result will never be nil. But I need nil to check for the error case.
} | ||
fctx.whiteboard.Set(NodesSubnetIPv6CIDR, nodesIPv6Range) | ||
|
||
srvSubnet := fctx.whiteboard.GetObject(ObjectKeyServicesSubnet).(*compute.Subnetwork) |
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.
Again consider using: GetObject
srvSubnet := fctx.whiteboard.GetObject(ObjectKeyServicesSubnet).(*compute.Subnetwork) | |
srvSubnet := GetObject[*compute.Subnetwork](fctx.whiteboard, ObjectKeyServicesSubnet) |
cidrsipv6 := []*string{} | ||
if nodesipv6 := fctx.whiteboard.Get(NodesSubnetIPv6CIDR); ptr.Deref(nodesipv6, "") != "" { | ||
cidrsipv6 = append(cidrsipv6, nodesipv6) | ||
} | ||
if servicesipv6 := fctx.whiteboard.Get(ServicesSubnetIPv6CIDR); ptr.Deref(servicesipv6, "") != "" { | ||
cidrsipv6 = append(cidrsipv6, servicesipv6) | ||
} |
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.
To stays consistent we should use camel case variable naming in cidrsipv6
= cidrsIPv6
, nodesipv6
= nodesIPv6
and servicesipv6
= servicesIPv6
pkg/gcp/types.go
Outdated
@@ -14,6 +14,10 @@ const ( | |||
|
|||
// CloudControllerManagerImageName is the name of the cloud-controller-manager image. | |||
CloudControllerManagerImageName = "cloud-controller-manager" | |||
// IngressGCEImageName is the name of the ingress-gce image. | |||
IngressGCEImageName = "ingress-gce" | |||
// DefaultHTTPBackendImageName is the name of the csi-driver image. |
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.
Probably copy paste error?
see gardener#848 Signed-off-by: Artiom Diomin <[email protected]>
I've rebased whole PR against current master. |
charts/internal/seed-controlplane/charts/ingress-gce/values.yaml
Outdated
Show resolved
Hide resolved
subnetPurpose := apisgcp.PurposeInternal | ||
if dualstack { | ||
subnetPurpose = apisgcp.PurposeNodes | ||
} |
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 think this should be validated against right? Having an internal subnet on a dualStack cluster makes no sense AFAIK because the internal loadbalancers will now be created now in the internal subnet.
I think there is no validation for that yet.
942e1e4
to
4a20257
Compare
63a1dd4
to
26c78cf
Compare
How to categorize this PR?
/area networking
/kind api-change
/platform gcp
What this PR does / why we need it:
This PR introduces DualStack support for infrastructure objects. A new field DualStack { enabled: bool} has been added. When enabled, the controller will create a VPC and Subnet in GCP with IPv6 access type set to external, supporting both external and internal IPv6 communication.
The controller can provision dual-stack infrastructure using the InfraFlow approach (via GCP SDK).
Which issue(s) this PR fixes:
Fixes #829
Special notes for your reviewer:
Release note: