<p>I am running into OOM issues on CentOs on some kubernetes nodes.   I would like to set it up like they have in the demo:</p>

<pre><code>--kube-reserved is set to cpu=1,memory=2Gi,ephemeral-storage=1Gi
--system-reserved is set to cpu=500m,memory=1Gi,ephemeral-storage=1Gi
--eviction-hard is set to memory.available&lt;500Mi,nodefs.available&lt;10%
</code></pre>

<p>Where do I add those params?<br>
Should I add them to /etc/systemd/system/kubelet.service?
What format?<br>
Also, do I just set these on the worker nodes?</p>

<p>This is in a live enviroment so I want to get it right on the first go.</p>

<pre><code>[Unit]
Description=kubelet: The Kubernetes Node Agent
Documentation=https://kubernetes.io/docs/

[Service]
ExecStart=/usr/bin/kubelet
Restart=always
StartLimitInterval=0
RestartSec=10

[Install]
WantedBy=multi-user.target
</code></pre>

Chris
<p>Add them to this file (hopefully, you initiated your cluster with kubeadm):</p>

<pre><code>/var/lib/kubelet/kubeadm-flags.env
</code></pre>

<p>For example:</p>

<pre><code>KUBELET_KUBEADM_ARGS=--cgroup-driver=cgroupfs --cni-bin-dir=/opt/cni/bin --cni-conf-dir=/etc/cni/net.d --network-plugin=cni --resolv-conf=/run/systemd/resolve/resolv.conf --kube-reserved=&lt;value&gt; --system-reserved=&lt;value&gt; --eviction-hard=&lt;value&gt;
</code></pre>

<p>Run:</p>

<pre><code>systemctl restart kubelet
</code></pre>

<p>and configs should take effect. You can check the kubelet is running with the right parameters like this:</p>

<pre><code>ps -Af | grep kubelet
</code></pre>

<p>Hope it helps.</p>
