<p>For a bit of context, I am following <a href="https://www.kisphp.com/postgres/run-postgres11-and-pgadmin4-in-kubernetes-for-testing" rel="nofollow noreferrer">this</a> tutorial on how to setup <code>pgadmin4</code> in kubernetes.</p>
<p>After attaching to my pod and running python, I am getting an error:</p>
<pre class="lang-sh prettyprint-override"><code>/pgadmin4 $ python3.8
sh: python3.8: Operation not permitted
/pgadmin4 $ ls -al /usr/bin/python3.8
-rwxr-xr-x    1 root     root         14008 May  6 00:05 /usr/bin/python3
</code></pre>
<p>Not sure what is the reason nor how can I debug it. It's clearly not a permission denied issue. I suspect it might have to do with lack of linux capabilities but I am actually a bit clueless as how to go from here.</p>
<p><strong>Some additional information</strong>:</p>
<ul>
<li>the command I am running is as follows:</li>
</ul>
<pre class="lang-sh prettyprint-override"><code>$ kubectl run -ti --rm --overrides='
{
    &quot;apiVersion&quot;: &quot;v1&quot;,
    &quot;spec&quot;: {
    &quot;containers&quot;:[{
        &quot;name&quot;:&quot;pgadmin&quot;,
        &quot;image&quot;:&quot;dpage/pgadmin4:latest&quot;,
        &quot;command&quot;: [&quot;sh&quot;],
        &quot;stdin&quot;: true,
        &quot;tty&quot;: true,
        &quot;resources&quot;: {
            &quot;requests&quot;: {
                &quot;cpu&quot;: 1,
                &quot;memory&quot;: &quot;1Gi&quot;
            },
            &quot;limits&quot;: {
                &quot;cpu&quot;: &quot;1&quot;,
                &quot;memory&quot;: &quot;1Gi&quot;
            }
        },
        &quot;envFrom&quot;: [{
            &quot;secretRef&quot;: {
                &quot;name&quot;: &quot;proxy-secret&quot;
            }
        }],
        &quot;env&quot;: [{
            &quot;name&quot;: &quot;PGADMIN_DEFAULT_EMAIL&quot;,
            &quot;value&quot;: &quot;user@domain.com&quot;
        }, {
            &quot;name&quot;: &quot;PGADMIN_DEFAULT_PASSWORD&quot;,
            &quot;value&quot;: &quot;test&quot;
        }]
    }],
    &quot;securityContext&quot;: {
        &quot;runAsUser&quot;: 5050,
        &quot;runAsGroup&quot;: 5050
    }
    }
}' --image=&quot;dpage/pgadmin4:latest&quot; -- bash
</code></pre>
<p>Any hint is highly appreciated.</p>

renatodamas
<p>The culprit is this:</p>
<p><a href="https://github.com/postgres/pgadmin4/blob/master/Dockerfile#L190" rel="nofollow noreferrer">https://github.com/postgres/pgadmin4/blob/master/Dockerfile#L190</a></p>
<pre><code>setcap CAP_NET_BIND_SERVICE=+eip /usr/bin/python3.8
</code></pre>
<p>Either allow NET_BIND_SERVICE for your pod, or build a custom container where you remove this capability from /usr/bin/python3.8.</p>
