Kubernetes Docker OS parameters vs Host OS parameters

4/4/2017

I am running NGINX and Tomcat on Docker containers (container OS is Red Hat linux) and deployed through Kubernetes pods. Host OS is Red Hat Linux.

My query is which OS parameter will be effective - host OS or container OS? During performance tuning do I need to tune both OS or host OS parameters are effective. Example of some parameters I am referring to are ulimit - n (open files), net.ipv4.tcp.* , fs.file-max, etc.

-- ad-inf
docker
kubernetes
linux

3 Answers

4/11/2017

Kubernetes right now does not support adding ulimit there is an issue in kubernetes open for that.

Similar question which asks about setting ulimit is answered here.

-- surajd
Source: StackOverflow

4/6/2017

As Crazykev already mentioned, you can set ulimits using the respective docker run flags.

Parameters like net.ipv4.tcp.* are kernel parameters. Docker containers are run in the same Linux kernel as the host system; for this reason, parameters set on the host will also be effective in the container.

Usually, you will not be able to set these parameters from inside a container. You can (not saying you should) start a container with the --privileged flag, which might (untested) give you access to setting kernel parameters from within the container. The Kubernetes docs also describe how to start privileged containers.

-- helmbert
Source: StackOverflow

4/6/2017

In Docker container, and I'm not sure if it could be called as OS...

By the way, some of your referring example may not support set directly in docker container for safety or other issues. You may need to find more manual in docker docs.(for example, ulimit, docker run --ulimit nofile=262144:262144)

-- Crazykev
Source: StackOverflow