Security context in Kubernetes?
<p>Edit the pod <code>ubuntu-sleeper</code> to run the sleep process with user ID <code>1010</code>.</p>
<p>Note: Only make the necessary changes. Do not modify the name or image of the pod.</p>
<ul>
<li>Pod Name: ubuntu-sleeper</li>
<li>Image Name: ubuntu</li>
<li>SecurityContext: User 1010</li>
</ul>
<p>Solution: search for securityContext and add below details to yaml file. Delete the old pod then apply new config</p>
<pre>
spec:
securityContext:
runAsUser: 1010
controlplane ~ ➜ kubectl delete pod ubuntu-sleeper
pod "ubuntu-sleeper" deleted
controlplane ~ ✖ kubectl apply -f /tmp/kubectl-edit-1358357322.yaml
pod/ubuntu-sleeper created</pre>
<p>How to add user privileges at container level?</p>
<p><a href="https://medium.com/@harishpillai1994/security-context-in-kubernetes-c3d6717f372b"><strong>Website</strong></a></p>