mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
Merge pull request #88771 from prameshj/customsubnet
Remove feature gate for ILB Custom Subnet.
This commit is contained in:
commit
1b1b5ed890
@ -22,9 +22,6 @@ const (
|
|||||||
// AlphaFeatureILBSubsets allows InternalLoadBalancer services to include a subset
|
// AlphaFeatureILBSubsets allows InternalLoadBalancer services to include a subset
|
||||||
// of cluster nodes as backends instead of all nodes.
|
// of cluster nodes as backends instead of all nodes.
|
||||||
AlphaFeatureILBSubsets = "ILBSubsets"
|
AlphaFeatureILBSubsets = "ILBSubsets"
|
||||||
// AlphaFeatureILBCustomSubnet allows InternalLoadBalancer services to specify a
|
|
||||||
// network subnet to allocate ip addresses from.
|
|
||||||
AlphaFeatureILBCustomSubnet = "ILBCustomSubnet"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// AlphaFeatureGate contains a mapping of alpha features to whether they are enabled
|
// AlphaFeatureGate contains a mapping of alpha features to whether they are enabled
|
||||||
|
@ -90,12 +90,6 @@ func (g *Cloud) ensureInternalLoadBalancer(clusterName, clusterID string, svc *v
|
|||||||
g.eventRecorder.Event(svc, v1.EventTypeWarning, "ILBOptionsIgnored", "Internal LoadBalancer options are not supported with Legacy Networks.")
|
g.eventRecorder.Event(svc, v1.EventTypeWarning, "ILBOptionsIgnored", "Internal LoadBalancer options are not supported with Legacy Networks.")
|
||||||
options = ILBOptions{}
|
options = ILBOptions{}
|
||||||
}
|
}
|
||||||
if !g.AlphaFeatureGate.Enabled(AlphaFeatureILBCustomSubnet) {
|
|
||||||
if options.SubnetName != "" {
|
|
||||||
g.eventRecorder.Event(svc, v1.EventTypeWarning, "ILBCustomSubnetOptionIgnored", "Internal LoadBalancer CustomSubnet options ignored as the feature gate is disabled.")
|
|
||||||
options.SubnetName = ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sharedBackend := shareBackendService(svc)
|
sharedBackend := shareBackendService(svc)
|
||||||
backendServiceName := makeBackendServiceName(loadBalancerName, clusterID, sharedBackend, scheme, protocol, svc.Spec.SessionAffinity)
|
backendServiceName := makeBackendServiceName(loadBalancerName, clusterID, sharedBackend, scheme, protocol, svc.Spec.SessionAffinity)
|
||||||
@ -136,20 +130,12 @@ func (g *Cloud) ensureInternalLoadBalancer(clusterName, clusterID string, svc *v
|
|||||||
}
|
}
|
||||||
|
|
||||||
subnetworkURL := g.SubnetworkURL()
|
subnetworkURL := g.SubnetworkURL()
|
||||||
if g.AlphaFeatureGate.Enabled(AlphaFeatureILBCustomSubnet) {
|
// Any subnet specified using the subnet annotation will be picked up and reflected in the forwarding rule.
|
||||||
// If this feature is enabled, changes to subnet annotation will be
|
// Removing the annotation will set the forwarding rule to use the default subnet and result in a VIP change.
|
||||||
// picked up and reflected in the forwarding rule.
|
// In order to support existing ILBs that were setup using the wrong subnet - https://github.com/kubernetes/kubernetes/pull/57861,
|
||||||
// Removing the annotation will set the forwarding rule to use the default subnet.
|
// users will need to specify that subnet with the annotation.
|
||||||
if options.SubnetName != "" {
|
if options.SubnetName != "" {
|
||||||
subnetworkURL = gceSubnetworkURL("", g.networkProjectID, g.region, options.SubnetName)
|
subnetworkURL = gceSubnetworkURL("", g.networkProjectID, g.region, options.SubnetName)
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// TODO(84885) remove this once ILBCustomSubnet goes beta.
|
|
||||||
if existingFwdRule != nil && existingFwdRule.Subnetwork != "" {
|
|
||||||
// If the ILB already exists, continue using the subnet that it's already using.
|
|
||||||
// This is to support existing ILBs that were setup using the wrong subnet - https://github.com/kubernetes/kubernetes/pull/57861
|
|
||||||
subnetworkURL = existingFwdRule.Subnetwork
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// Determine IP which will be used for this LB. If no forwarding rule has been established
|
// Determine IP which will be used for this LB. If no forwarding rule has been established
|
||||||
// or specified in the Service spec, then requestedIP = "".
|
// or specified in the Service spec, then requestedIP = "".
|
||||||
|
@ -1381,7 +1381,6 @@ func TestEnsureInternalLoadBalancerCustomSubnet(t *testing.T) {
|
|||||||
vals := DefaultTestClusterValues()
|
vals := DefaultTestClusterValues()
|
||||||
gce, err := fakeGCECloud(vals)
|
gce, err := fakeGCECloud(vals)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
gce.AlphaFeatureGate = NewAlphaFeatureGate([]string{AlphaFeatureILBCustomSubnet})
|
|
||||||
|
|
||||||
nodeNames := []string{"test-node-1"}
|
nodeNames := []string{"test-node-1"}
|
||||||
nodes, err := createAndInsertNodes(gce, nodeNames, vals.ZoneName)
|
nodes, err := createAndInsertNodes(gce, nodeNames, vals.ZoneName)
|
||||||
|
Loading…
Reference in New Issue
Block a user