<p>Previously my kubernetes pod was running as root and I was running <code>ulimit -l &lt;MLOCK_AMOUNT&gt;</code> in its startup script before starting its main program in foreground. However, I can no more run my pod as root, would you please know how can I set this limit now?</p>

Fabrice Jammes
<p>To be able to set it per specific <code>Pod</code>, the way you did it before, unfortunatelly you need privilege escalation i.e. run your container as root.</p>
<p>As far as I understand you're interested in setting it only per specific <code>Pod</code>, not globally, right ? Because it can be done by changing docker configuration on a specific kubernetes node.</p>
<p>This topic has already been raised in <a href="https://stackoverflow.com/questions/33649192/how-do-i-set-ulimit-for-containers-in-kubernetes">another thread</a> and as you may read in <a href="https://stackoverflow.com/a/33666728/11714114">James Brown's answer</a>:</p>
<blockquote>
<p>It appears that you can't currently set a ulimit but it is an open
issue: <a href="https://github.com/kubernetes/kubernetes/issues/3595" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/3595</a></p>
</blockquote>
