-
Notifications
You must be signed in to change notification settings - Fork 303
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
Allow for use subnetworks with IPV6_Only stack type and check if cust… #2624
base: master
Are you sure you want to change the base?
Conversation
…om subnets of IPv4 services have correct address range Change-Id: I794be04483a472a5728023427b0002c1e91470b3
/hold |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cezarygerard 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 |
/assign @panslava |
/assign @marqc |
@cezarygerard: GitHub didn't allow me to assign the following users: marqc. Note that only kubernetes members with read permissions, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this:
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. |
/assign @mmamczur |
|
||
func (l4 *L4) serviceSubnetHasInternalIPv4Range() error { | ||
subnetName := l4.subnetName() | ||
hasIPv6SubnetRange, err := utils.SubnetHasIPv4Range(l4.cloud, subnetName, subnetInternalAccessType) |
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.
You have IPv6
on the left and IPv4
on the right
if err != nil { | ||
return false, fmt.Errorf("failed getting subnet: %w", err) | ||
} | ||
return subnet.StackType == DualStackSubnetStackType && subnet.Ipv6AccessType == ipv6AccessType, nil | ||
stackTypeMatches := subnet.StackType == DualStackSubnetStackType || subnet.StackType == IPv4SubnetStackType | ||
accessTypeMatches := subnet.Ipv6AccessType == accessType |
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.
out of curiosity: is ipv6AccessType relevant for IPv4 subnet?
|
||
func (l4netlb *L4NetLB) serviceSubnetHasExternalIPv4Range() error { | ||
subnetName := l4netlb.getSubnetName() | ||
hasIPv6SubnetRange, err := utils.SubnetHasIPv4Range(l4netlb.cloud, subnetName, subnetExternalAccessType) |
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.
ditto: IPv6 on the left, IPv4 on the right
@@ -236,6 +236,15 @@ func (l4netlb *L4NetLB) EnsureFrontend(nodeNames []string, svc *corev1.Service) | |||
} | |||
} | |||
|
|||
// If service requires IPv6 LoadBalancer -- verify that Subnet with External IPv4 ranges is used. |
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.
// If service requires IPv6 LoadBalancer -- verify that Subnet with External IPv4 ranges is used. | |
// If service requires IPv4 LoadBalancer -- verify that Subnet with External IPv4 ranges is used. |
@@ -236,6 +236,15 @@ func (l4netlb *L4NetLB) EnsureFrontend(nodeNames []string, svc *corev1.Service) | |||
} | |||
} | |||
|
|||
// If service requires IPv6 LoadBalancer -- verify that Subnet with External IPv4 ranges is used. | |||
if l4netlb.enableDualStack && utils.NeedsIPv6(svc) { |
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.
if l4netlb.enableDualStack && utils.NeedsIPv6(svc) { | |
if l4netlb.enableDualStack && utils.NeedsIPv4(svc) { |
@@ -215,3 +215,19 @@ func (l4 *L4) serviceSubnetHasInternalIPv6Range() error { | |||
} | |||
return nil | |||
} | |||
|
|||
func (l4 *L4) serviceSubnetHasInternalIPv4Range() error { |
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 it even called anywhere?
@@ -223,3 +223,19 @@ func (l4netlb *L4NetLB) serviceSubnetHasExternalIPv6Range() error { | |||
} | |||
return nil | |||
} | |||
|
|||
func (l4netlb *L4NetLB) serviceSubnetHasExternalIPv4Range() error { |
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 a bit strange to me that function serviceSubnetHasExternalIPv4Range
instead of returning bool returns error
reading something like this
err := l4netlb.serviceSubnetHasExternalIPv4Range()
makes you think that error happens when something wrong happened, not when service just doesn't have ExternalIPv4Range
though, I am not strong on this opinion :)
subnet, err := cloud.GetSubnetwork(cloud.Region(), subnetName) | ||
func SubnetHasIPv6Range(gcecloud *gce.Cloud, subnetName, accessType string) (bool, error) { | ||
key := meta.RegionalKey(subnetName, gcecloud.Region()) | ||
subnet, err := gcecloud.Compute().AlphaSubnetworks().Get(context.Background(), key) |
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 it only available in Alpha?
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 |
The Kubernetes project currently lacks enough active 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 rotten |
…om subnets of IPv4 services have correct address range