<p>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.</p>

<p>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.</p>

<p>As Crazykev already mentioned, you can set ulimits using the respective <code>docker run</code> flags.</p>

<p>Parameters like <code>net.ipv4.tcp.*</code> are <strong>kernel parameters</strong>. 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.</p>

<p>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 <code>--privileged</code> flag, which might (untested) give you access to setting kernel parameters from within the container. The Kubernetes docs also describe <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod/#privileged-mode-for-pod-containers" rel="nofollow noreferrer">how to start privileged containers</a>.</p>
