Skip to content

Commit

Permalink
Set the tcp_rmem sysctl in bootstrap script
Browse files Browse the repository at this point in the history
This ensures that we're using our settings for downloading nodeup
itself and any assets that nodeup downloads.  This is a workaround for
reported problems with the initial download on some kernels otherwise.

Issue #10206
  • Loading branch information
justinsb committed Jan 25, 2021
1 parent 97c40a3 commit 1d76a15
Show file tree
Hide file tree
Showing 102 changed files with 370 additions and 2 deletions.
6 changes: 6 additions & 0 deletions pkg/model/bootstrapscript.go
Expand Up @@ -380,6 +380,12 @@ func (b *BootstrapScript) Run(c *fi.Context) error {
"GzipBase64": func(data string) (string, error) {
return gzipBase64(data)
},

"SetSysctls": func() string {
// By setting some sysctls early, we avoid broken configurations that prevent nodeup download.
// See https://github.com/kubernetes/kops/issues/10206 for details.
return "sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true\n"
},
}

awsNodeUpTemplate, err := resources.AWSNodeUpTemplate(b.ig)
Expand Down
2 changes: 2 additions & 0 deletions pkg/model/resources/nodeup.go
Expand Up @@ -40,6 +40,8 @@ NODEUP_HASH_ARM64={{ NodeUpSourceHashArm64 }}
{{ ProxyEnv }}
{{ SetSysctls }}
function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
3 changes: 3 additions & 0 deletions pkg/model/tests/data/bootstrapscript_0.txt
Expand Up @@ -29,6 +29,9 @@ systemctl daemon-reload
systemctl daemon-reexec


sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true


function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
3 changes: 3 additions & 0 deletions pkg/model/tests/data/bootstrapscript_1.txt
Expand Up @@ -29,6 +29,9 @@ systemctl daemon-reload
systemctl daemon-reexec


sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true


function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
3 changes: 3 additions & 0 deletions pkg/model/tests/data/bootstrapscript_2.txt
Expand Up @@ -29,6 +29,9 @@ systemctl daemon-reload
systemctl daemon-reexec


sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true


function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
3 changes: 3 additions & 0 deletions pkg/model/tests/data/bootstrapscript_3.txt
Expand Up @@ -29,6 +29,9 @@ systemctl daemon-reload
systemctl daemon-reexec


sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true


function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
3 changes: 3 additions & 0 deletions pkg/model/tests/data/bootstrapscript_4.txt
Expand Up @@ -29,6 +29,9 @@ systemctl daemon-reload
systemctl daemon-reexec


sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true


function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
3 changes: 3 additions & 0 deletions pkg/model/tests/data/bootstrapscript_5.txt
Expand Up @@ -29,6 +29,9 @@ systemctl daemon-reload
systemctl daemon-reexec


sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true


function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
Expand Up @@ -13,6 +13,9 @@ export AWS_REGION=us-test-1



sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true


function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
Expand Up @@ -22,6 +22,9 @@ export AWS_REGION=us-test-1



sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true


function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
Expand Up @@ -23,6 +23,9 @@ Resources.AWSEC2LaunchTemplatemasterustest1amasterscomplexexamplecom.Properties.
sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true
function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down Expand Up @@ -379,6 +382,9 @@ Resources.AWSEC2LaunchTemplatenodescomplexexamplecom.Properties.LaunchTemplateDa
sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true
function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
Expand Up @@ -22,6 +22,9 @@ export AWS_REGION=us-test-1



sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true


function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
Expand Up @@ -22,6 +22,9 @@ export AWS_REGION=us-test-1



sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true


function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
Expand Up @@ -22,6 +22,9 @@ export AWS_REGION=us-test-1



sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true


function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
Expand Up @@ -22,6 +22,9 @@ export AWS_REGION=us-test-1



sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true


function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
Expand Up @@ -14,6 +14,9 @@ Resources.AWSEC2LaunchTemplatemasterustest1amasterscontainerdexamplecom.Properti
sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true
function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down Expand Up @@ -362,6 +365,9 @@ Resources.AWSEC2LaunchTemplatenodescontainerdexamplecom.Properties.LaunchTemplat
sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true
function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
Expand Up @@ -14,6 +14,9 @@ Resources.AWSEC2LaunchTemplatemasterustest1amasterscontainerdexamplecom.Properti
sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true
function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down Expand Up @@ -344,6 +347,9 @@ Resources.AWSEC2LaunchTemplatenodescontainerdexamplecom.Properties.LaunchTemplat
sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true
function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
Expand Up @@ -14,6 +14,9 @@ Resources.AWSEC2LaunchTemplatemasterustest1amastersdockerexamplecom.Properties.L
sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true
function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down Expand Up @@ -350,6 +353,9 @@ Resources.AWSEC2LaunchTemplatenodesdockerexamplecom.Properties.LaunchTemplateDat
sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true
function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
Expand Up @@ -13,6 +13,9 @@ export AWS_REGION=us-test-1



sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true


function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
Expand Up @@ -13,6 +13,9 @@ export AWS_REGION=us-test-1



sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true


function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
Expand Up @@ -13,6 +13,9 @@ export AWS_REGION=us-test-1



sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true


function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
Expand Up @@ -13,6 +13,9 @@ export AWS_REGION=us-test-1



sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true


function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
Expand Up @@ -14,6 +14,9 @@ Resources.AWSEC2LaunchTemplatemasterustest1amastersminimalexamplecom.Properties.
sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true
function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down Expand Up @@ -344,6 +347,9 @@ Resources.AWSEC2LaunchTemplatenodesminimalexamplecom.Properties.LaunchTemplateDa
sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true
function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
Expand Up @@ -13,6 +13,9 @@ export AWS_REGION=us-test-1



sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true


function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
Expand Up @@ -13,6 +13,9 @@ export AWS_REGION=us-test-1



sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true


function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
Expand Up @@ -13,6 +13,9 @@ export AWS_REGION=us-test-1



sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true


function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
Expand Up @@ -13,6 +13,9 @@ export AWS_REGION=us-test-1



sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true


function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
Expand Up @@ -14,6 +14,9 @@ Resources.AWSEC2LaunchTemplatemasterustest1amastersexternallbexamplecom.Properti
sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true
function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down Expand Up @@ -344,6 +347,9 @@ Resources.AWSEC2LaunchTemplatenodesexternallbexamplecom.Properties.LaunchTemplat
sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true
function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
Expand Up @@ -13,6 +13,9 @@ export AWS_REGION=us-test-1



sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true


function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
Expand Up @@ -13,6 +13,9 @@ export AWS_REGION=us-test-1



sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true


function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
Expand Up @@ -13,6 +13,9 @@ export AWS_REGION=us-test-1



sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true


function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
Expand Up @@ -13,6 +13,9 @@ export AWS_REGION=us-test-1



sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true


function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down
Expand Up @@ -13,6 +13,9 @@ export AWS_REGION=us-test-1



sysctl -w net.ipv4.tcp_rmem='4096 12582912 16777216' || true


function ensure-install-dir() {
INSTALL_DIR="/opt/kops"
# On ContainerOS, we install under /var/lib/toolbox; /opt is ro and noexec
Expand Down

0 comments on commit 1d76a15

Please sign in to comment.