How do I set sysctl key in kubernetes pod on a minikube node?

9/12/2017

I'm using k8s v 1.7. Following the guide in docs, my deployment has the following in its spec:

annotations:
  security.alpha.kubernetes.io/unsafe-sysctls: net.core.somaxconn=16384

But when applying that using kubectl, I get the following error:

forbidden sysctl: "net.core.somaxconn" not whitelisted

Now the docs say I should run something like this in the node:

kubelet --experimental-allowed-unsafe-sysctls 'net.core.somaxconn'

But I don't know where to run that command. I tried inside minikube ssh but kubelet doesn't seem to be installed.

I'm looking for something like:

minikube start --extra-config='allow net.core.somaxconn'
-- Charles V.
docker
kubernetes
minikube

1 Answer

9/12/2017

I tried with this and it seemed to work

minikube start --extra-config=kubelet.AllowedUnsafeSysctls=net.core.somaxconn

Extracted from here: https://github.com/kubernetes/kubernetes/blob/master/cmd/kubelet/app/options/options.go

-- Javier Salmeron
Source: StackOverflow