Set sysctl key in Kubernetes pod using Kops + Docker 1.11 Set sysctl key in Kubernetes pod using Kops + Docker 1.11 kubernetes kubernetes

Set sysctl key in Kubernetes pod using Kops + Docker 1.11


Apparently this can be done using Kubernetes init containers. Following the Kubernetes deployment config posted here this can be done by applying the following annotation to your deployment. Under spec > template > metadata > annotations add:

pod.beta.kubernetes.io/init-containers: '[  {  "name": "sysctl",    "image": "busybox",    "command": ["sysctl", "-w", "vm.max_map_count=262144"],    "securityContext": {      "privileged": true    }  }]'