mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 19:23:40 +00:00
Remove azure-load-balancer-disable-tcp-reset annotation
This commit is contained in:
parent
0f3262cddb
commit
9b42f12e4f
@ -1007,10 +1007,8 @@ func (az *Cloud) reconcileLoadBalancerRule(
|
|||||||
var enableTCPReset *bool
|
var enableTCPReset *bool
|
||||||
if az.useStandardLoadBalancer() {
|
if az.useStandardLoadBalancer() {
|
||||||
enableTCPReset = to.BoolPtr(true)
|
enableTCPReset = to.BoolPtr(true)
|
||||||
if v, ok := service.Annotations[ServiceAnnotationLoadBalancerDisableTCPReset]; ok {
|
if _, ok := service.Annotations[ServiceAnnotationLoadBalancerDisableTCPReset]; ok {
|
||||||
klog.Warning("annotation service.beta.kubernetes.io/azure-load-balancer-disable-tcp-reset has been depracated, it would be removed in a future release")
|
klog.Warning("annotation service.beta.kubernetes.io/azure-load-balancer-disable-tcp-reset has been removed as of Kubernetes 1.20. TCP Resets are always enabled on Standard SKU load balancers.")
|
||||||
klog.V(2).Infof("reconcileLoadBalancerRule lb name (%s) flag(%s) is set to %s", lbName, ServiceAnnotationLoadBalancerDisableTCPReset, v)
|
|
||||||
enableTCPReset = to.BoolPtr(!strings.EqualFold(v, "true"))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1048,9 +1048,10 @@ func TestReconcileLoadBalancerRule(t *testing.T) {
|
|||||||
wantLb: false,
|
wantLb: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "reconcileLoadBalancerRule shall return corresponding probe and lbRule(blb)",
|
desc: "reconcileLoadBalancerRule shall return corresponding probe and lbRule(blb)",
|
||||||
service: getTestService("test1", v1.ProtocolTCP, map[string]string{"service.beta.kubernetes.io/azure-load-balancer-disable-tcp-reset": "true"}, false, 80),
|
service: getTestService("test1", v1.ProtocolTCP, map[string]string{"service.beta.kubernetes.io/azure-load-balancer-disable-tcp-reset": "true"}, false, 80),
|
||||||
wantLb: true,
|
loadBalancerSku: "basic",
|
||||||
|
wantLb: true,
|
||||||
expectedProbes: []network.Probe{
|
expectedProbes: []network.Probe{
|
||||||
{
|
{
|
||||||
Name: to.StringPtr("atest1-TCP-80"),
|
Name: to.StringPtr("atest1-TCP-80"),
|
||||||
@ -1125,7 +1126,7 @@ func TestReconcileLoadBalancerRule(t *testing.T) {
|
|||||||
ID: to.StringPtr("/subscriptions/subscription/resourceGroups/rg/providers/" +
|
ID: to.StringPtr("/subscriptions/subscription/resourceGroups/rg/providers/" +
|
||||||
"Microsoft.Network/loadBalancers/lbname/probes/atest1-TCP-80"),
|
"Microsoft.Network/loadBalancers/lbname/probes/atest1-TCP-80"),
|
||||||
},
|
},
|
||||||
EnableTCPReset: to.BoolPtr(false),
|
EnableTCPReset: to.BoolPtr(true),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -1351,7 +1352,7 @@ func TestReconcileLoadBalancer(t *testing.T) {
|
|||||||
|
|
||||||
expectedSLb := getTestLoadBalancer(to.StringPtr("testCluster"), to.StringPtr("rg"), to.StringPtr("testCluster"), to.StringPtr("aservice1"), service4, "Standard")
|
expectedSLb := getTestLoadBalancer(to.StringPtr("testCluster"), to.StringPtr("rg"), to.StringPtr("testCluster"), to.StringPtr("aservice1"), service4, "Standard")
|
||||||
(*expectedSLb.LoadBalancerPropertiesFormat.LoadBalancingRules)[0].DisableOutboundSnat = to.BoolPtr(true)
|
(*expectedSLb.LoadBalancerPropertiesFormat.LoadBalancingRules)[0].DisableOutboundSnat = to.BoolPtr(true)
|
||||||
(*expectedSLb.LoadBalancerPropertiesFormat.LoadBalancingRules)[0].EnableTCPReset = to.BoolPtr(false)
|
(*expectedSLb.LoadBalancerPropertiesFormat.LoadBalancingRules)[0].EnableTCPReset = to.BoolPtr(true)
|
||||||
expectedSLb.FrontendIPConfigurations = &[]network.FrontendIPConfiguration{
|
expectedSLb.FrontendIPConfigurations = &[]network.FrontendIPConfiguration{
|
||||||
{
|
{
|
||||||
Name: to.StringPtr("aservice1"),
|
Name: to.StringPtr("aservice1"),
|
||||||
@ -1400,7 +1401,7 @@ func TestReconcileLoadBalancer(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
//change to false to test that reconciliation will fix it
|
//change to false to test that reconciliation will fix it (despite the fact that disable-tcp-reset was removed in 1.20)
|
||||||
(*slb5.LoadBalancerPropertiesFormat.LoadBalancingRules)[0].EnableTCPReset = to.BoolPtr(false)
|
(*slb5.LoadBalancerPropertiesFormat.LoadBalancingRules)[0].EnableTCPReset = to.BoolPtr(false)
|
||||||
|
|
||||||
expectedSLb5 := getTestLoadBalancer(to.StringPtr("testCluster"), to.StringPtr("rg"), to.StringPtr("testCluster"), to.StringPtr("aservice1"), service5, "Standard")
|
expectedSLb5 := getTestLoadBalancer(to.StringPtr("testCluster"), to.StringPtr("rg"), to.StringPtr("testCluster"), to.StringPtr("aservice1"), service5, "Standard")
|
||||||
@ -1551,7 +1552,7 @@ func TestReconcileLoadBalancer(t *testing.T) {
|
|||||||
expectedError: nil,
|
expectedError: nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "reconcileLoadBalancer shall remove and reconstruct the correspoind field of lb and set enableTcpReset to false in lbRule",
|
desc: "reconcileLoadBalancer shall remove and reconstruct the correspoind field of lb and set enableTcpReset to true in lbRule",
|
||||||
loadBalancerSku: "standard",
|
loadBalancerSku: "standard",
|
||||||
service: service4,
|
service: service4,
|
||||||
disableOutboundSnat: to.BoolPtr(true),
|
disableOutboundSnat: to.BoolPtr(true),
|
||||||
@ -1561,7 +1562,7 @@ func TestReconcileLoadBalancer(t *testing.T) {
|
|||||||
expectedError: nil,
|
expectedError: nil,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "reconcileLoadBalancer shall remove and reconstruct the correspoind field of lb and set enableTcpReset to true in lbRule",
|
desc: "reconcileLoadBalancer shall remove and reconstruct the correspoind field of lb and set enableTcpReset (false => true) in lbRule",
|
||||||
loadBalancerSku: "standard",
|
loadBalancerSku: "standard",
|
||||||
service: service5,
|
service: service5,
|
||||||
disableOutboundSnat: to.BoolPtr(true),
|
disableOutboundSnat: to.BoolPtr(true),
|
||||||
|
Loading…
Reference in New Issue
Block a user