Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

feat: add DisableOutboundSNAT feature #1708

Merged
merged 9 commits into from
Nov 13, 2019

Conversation

sylr
Copy link
Contributor

@sylr sylr commented Aug 1, 2019

Signed-off-by: Sylvain Rabot [email protected]

Reason for Change:

aks-engine currently does not allow to specify the cloud provider setting disableOutboundSnat.

Issue Fixed:

Related to #1689
Fixes #1001

Requirements:

Notes:

@sylr sylr force-pushed the disable-outbound-nat branch 2 times, most recently from 2b039b8 to 2eae604 Compare August 1, 2019 13:24
@jackfrancis
Copy link
Member

/azp run pr-e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jackfrancis
Copy link
Member

@sylr What's the purpose of this change? Is it to override the default behavior and explicitly disable outbound SNAT for Standard LB configurations?

@feiskyer, does it make sense to expose this configuration to users?

@jackfrancis
Copy link
Member

pkg/api/types.go Outdated
@@ -116,6 +116,7 @@ type FeatureFlags struct {
EnableCSERunInBackground bool `json:"enableCSERunInBackground,omitempty"`
BlockOutboundInternet bool `json:"blockOutboundInternet,omitempty"`
EnableIPv6DualStack bool `json:"enableIPv6DualStack,omitempty"`
DisableOutboundSNAT bool `json:"disableOutboundSnat,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this belong in KubernetesConfig instead? featureFlags is not meant to be used for k8s configuration but instead allow testing of experimental features without exposing them in docs. The loadBalancerSku and excludeMasterFromStandardLB knobs are in KubernetesConfig for example.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you do move it to KubernetesConfig, could you also include it in docs/topics/clusterdefinitions.md?

@feiskyer
Copy link
Member

feiskyer commented Aug 7, 2019

@feiskyer, does it make sense to expose this configuration to users?

Yep, for SLB with outbound rules defined, disableOutboundSnat could be enabled to ensure external traffic is going through outbound rules. Refer https://docs.microsoft.com/en-us/azure/load-balancer/load-balancer-outbound-rules-overview#outbound-rule.

@@ -80,6 +80,62 @@ func getK8sMasterVars(cs *api.ContainerService) (map[string]interface{}, error)
kubernetesVersion = orchProfile.OrchestratorVersion + AzureStackSuffix
}

provisionScriptParametersCommonString := "[concat(" +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @sylr for this code maintenance improvement :)

@CecileRobertMichon @devigned @mboersma FYI

(Also, I manually validated that nothing was lost during translation.)

@acs-bot acs-bot added size/L and removed size/M labels Aug 23, 2019
@jackfrancis
Copy link
Member

/azp run pr-e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jackfrancis
Copy link
Member

/azp run pr-e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mboersma
Copy link
Member

/azp run pr-e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jackfrancis
Copy link
Member

/azp run pr-e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

pkg/api/types.go Outdated
@@ -320,6 +320,7 @@ type CloudProviderConfig struct {
CloudProviderRateLimitQPSWrite string `json:"cloudProviderRateLimitQPSWrite,omitempty"`
CloudProviderRateLimitBucket int `json:"cloudProviderRateLimitBucket,omitempty"`
CloudProviderRateLimitBucketWrite int `json:"cloudProviderRateLimitBucketWrite,omitempty"`
CloudProviderDisableOutboundSNAT bool `json:"cloudProviderDisableOutboundSnat,omitempty"`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Snat instead of SNAT ?

@jackfrancis
Copy link
Member

/azp run pr-e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@codecov
Copy link

codecov bot commented Oct 30, 2019

Codecov Report

Merging #1708 into master will increase coverage by 0.07%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #1708      +/-   ##
==========================================
+ Coverage    71.6%   71.67%   +0.07%     
==========================================
  Files         142      142              
  Lines       24817    24881      +64     
==========================================
+ Hits        17770    17834      +64     
  Misses       5911     5911              
  Partials     1136     1136

@jackfrancis jackfrancis added this to the v0.44.0 milestone Oct 31, 2019
@marcel-dempers
Copy link

Hi all,

Just checking in to see updates on this item ?

Currently facing an issue of Standard LB not honoring outbound rules because of disableOutboundSnat=false. I've been comparing the LB between aks-engine and aks and support engineer from Microsoft told me disableOutboundSnat should be set to true for egress to work correctly. AKS currently sets it to true for all LB rules. AKS-engine seems to use default (false).

Let me know if there is anything I can contribute \ test out.

@jackfrancis
Copy link
Member

/azp run pr-e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

o.KubernetesConfig.CloudProviderDisableOutboundSNAT = to.BoolPtr(false)
}
} else {
// CloudProviderDisableOutboundSNAT is only valid in the context of Standard LB, statically set to false if not Standard LB
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we drop a note in docs about this?

Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm pending docs

@@ -73,6 +73,18 @@ $ aks-engine get-versions
| maximumLoadBalancerRuleCount | no | Maximum allowed LoadBalancer Rule Count is the limit enforced by Azure Load balancer. Default is 250 |
| kubeProxyMode | no | kube-proxy --proxy-mode value, either "iptables" or "ipvs". Default is "iptables". See https://kubernetes.io/blog/2018/07/09/ipvs-based-in-cluster-load-balancing-deep-dive/ for further reference. |
| outboundRuleIdleTimeoutInMinutes | no | Specifies a value for IdleTimeoutInMinutes to control the outbound flow idle timeout of the agent standard loadbalancer. This value is set greater than the default Linux idle timeout (15.4 min): https://pracucci.com/linux-tcp-rto-min-max-and-tcp-retries2.html |
| cloudProviderBackoff | no | Use the Azure cloudprovider exponential backoff implementation when encountering retry-able errors from the Azure API. Defaults to `true` for Kubernetes v1.14.0 and greater. |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CecileRobertMichon There was a rather large cloudprovider config documentation gap, so I used this PR as an excuse to backfill that info.

@acs-bot
Copy link

acs-bot commented Nov 13, 2019

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sylr
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: marosset

If they are not already assigned, you can assign the PR to them by writing /assign @marosset in a comment when ready.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@acs-bot acs-bot removed the approved label Nov 13, 2019
@jackfrancis
Copy link
Member

/azp run pr-e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jackfrancis jackfrancis merged commit 8cf7c2a into Azure:master Nov 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add new options disableOutboundSNAT for standard load balancer
7 participants