mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +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
|
||||
// of cluster nodes as backends instead of all nodes.
|
||||
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
|
||||
|
@ -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.")
|
||||
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)
|
||||
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()
|
||||
if g.AlphaFeatureGate.Enabled(AlphaFeatureILBCustomSubnet) {
|
||||
// If this feature is enabled, changes to subnet annotation will be
|
||||
// picked up and reflected in the forwarding rule.
|
||||
// Removing the annotation will set the forwarding rule to use the default subnet.
|
||||
if 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
|
||||
}
|
||||
// Any subnet specified using the subnet annotation will be picked up and reflected in the forwarding rule.
|
||||
// Removing the annotation will set the forwarding rule to use the default subnet and result in a VIP change.
|
||||
// In order to support existing ILBs that were setup using the wrong subnet - https://github.com/kubernetes/kubernetes/pull/57861,
|
||||
// users will need to specify that subnet with the annotation.
|
||||
if options.SubnetName != "" {
|
||||
subnetworkURL = gceSubnetworkURL("", g.networkProjectID, g.region, options.SubnetName)
|
||||
}
|
||||
// Determine IP which will be used for this LB. If no forwarding rule has been established
|
||||
// or specified in the Service spec, then requestedIP = "".
|
||||
|
@ -1381,7 +1381,6 @@ func TestEnsureInternalLoadBalancerCustomSubnet(t *testing.T) {
|
||||
vals := DefaultTestClusterValues()
|
||||
gce, err := fakeGCECloud(vals)
|
||||
require.NoError(t, err)
|
||||
gce.AlphaFeatureGate = NewAlphaFeatureGate([]string{AlphaFeatureILBCustomSubnet})
|
||||
|
||||
nodeNames := []string{"test-node-1"}
|
||||
nodes, err := createAndInsertNodes(gce, nodeNames, vals.ZoneName)
|
||||
|
Loading…
Reference in New Issue
Block a user