Kubernetes Kops - set sysctl flag on kubelet Kubernetes Kops - set sysctl flag on kubelet kubernetes kubernetes

Kubernetes Kops - set sysctl flag on kubelet


A fix for this was merged back in May, you can see the PR here: https://github.com/kubernetes/kops/pull/5104/files

You'd enable it with:

spec:  kubelet:    ExperimentalAllowedUnsafeSysctls:      - 'net.ipv4.ip_local_port_range="10240 65535"'

It seems the flag takes a stringSlice, so you'd need to pass an array.

If that doesn't work, ensure you're using the right version of kops


I recently ran into this problem and the issue was ExperimentalAllowedUnsafeSysctls should be experimental_allowed_unsafe_sysctls in the kops config like below.

  kubelet:    experimental_allowed_unsafe_sysctls:    - net.core.somaxconn

I found this out by inspecting the componentconfig.go here: https://github.com/kubernetes/kops/blob/master/pkg/apis/kops/v1alpha2/componentconfig.go#L168


As of 2020-05-18, the proper config is, for example:

  kubelet:                                                                                                                                 allowedUnsafeSysctls:                                                                                                                  - net.ipv4.ip_local_port_range="10240 65535"

In general, all KOPS config must be camelCased.

From here, KOPS 1.16.2+