<p>I want to grant a user access to exec into one pod not all project pods/components.</p>
<p>i.e. 1 pod &lt;-&gt; 1 namespace &lt;-&gt; 1 user only</p>
<p>Do we have an option like this ?</p>

Vrushali
<p>Yes, you can create the RBAC role and rolebinding for a specific resource by its name.</p>
<pre class="lang-yaml prettyprint-override"><code>kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  namespace: demo
  name: pod-exec-role
rules:
- apiGroups: [&quot;&quot;]
  resources: [&quot;pods/exec&quot;]
  resourceNames: [&quot;POD_NAME&quot;]
  verbs: [&quot;get&quot;, &quot;create&quot;]
</code></pre>
<p>And bind that role to a specific user by using the rolebinding:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: pod-exec
  namespace: demo
subjects:
- kind: User
  name: jane 
  apiGroup: rbac.authorization.k8s.io
roleRef:
  kind: Role 
  name: pod-exec-role
  apiGroup: rbac.authorization.k8s.io
</code></pre>
<p>N.B.: This won't work with pods whose names can be changed over time. Like pods created from the <code>Deployment</code> object.</p>
