set net.ipv4.ip_local_reserved_ports to the KubeAPIServer ServiceNodePortRange parameter on nodeup

This commit is contained in:
José Luis Ledesma 2019-01-15 16:25:28 +01:00
parent 09acd56675
commit 5064a54602
1 changed files with 8 additions and 0 deletions

View File

@ -52,6 +52,14 @@ func (b *SysctlBuilder) Build(c *fi.ModelBuilderContext) error {
"kernel.softlockup_all_cpu_backtrace = 1",
"")
// See https://github.com/kubernetes/kops/issues/6342
portRange := b.Cluster.Spec.KubeAPIServer.ServiceNodePortRange
if portRange == "" {
portRange = "30000-32767" // Default kube-apiserver ServiceNodePortRange
}
sysctls = append(sysctls, "net.ipv4.ip_local_reserved_ports = "+portRange,
"")
// See https://github.com/kubernetes/kube-deploy/issues/261
sysctls = append(sysctls,
"# Increase the number of connections",