<p>I want to deploy dcgm-exporter pod as non-root user. <br/>
In values.yaml I made below changes but pod is crashingoff!</p>
<p>Case 1:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>securityContext:
  runAsNonRoot: true
  runAsUser: 1002
  # capabilities:
  #    add: ["SYS_ADMIN"]
  # readOnlyRootFilesystem: true</code></pre>
</div>
</div>
</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>kubectl -n kube-system logs dcgm-exporter-6nwvl 
unable to set CAP_SETFCAP effective capability: Operation not permitted</code></pre>
</div>
</div>

<br/>
Case:2</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>securityContext:
  runAsNonRoot: true
  #runAsUser: 1002
  # capabilities:
  #    add: ["SYS_ADMIN"]
  # readOnlyRootFilesystem: true</code></pre>
</div>
</div>
</p>
<p>Error: container has runAsNonRoot and image will run as root</p>
<p>Is it possible to change and run as non root user or Is this a requirement for the dcgm-exporter to work as root user?</p>

Ak96
<p>Please try below. You need SETFCAP Capability.
Please keep Adding the Capabilities which are being reported as required in the log.</p>
<pre><code>securityContext:
  runAsNonRoot: true
  runAsUser: 1002
  capabilities:
    add:
    - &quot;SETFCAP&quot;
  # readOnlyRootFilesystem: true
</code></pre>
