<p>I have a google kubernetes engine cluster with multiple namespaces. Different applications are deployed on each of these namespaces. Is it possible to give a user complete access to a single namespace only?</p>

<p>Yes, Kubernetes has a built-in RBAC system that integrates with Cloud IAM so that you can control access to individual clusters and namespaces for GCP users.</p>

<ol>
<li>Create a Kubernetes <code>Role</code></li>
</ol>

<pre><code>kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  namespace: YOUR_NAMESPACE
  name: ROLE_NAME
rules:
- apiGroups: [""] # "" indicates the core API group
  resources: ["pods"]
  verbs: ["get", "watch", "list"]
</code></pre>

<ol start="2">
<li>Create a Kubernetes <code>RoleBinding</code></li>
</ol>

<pre><code>kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: ROLE_NAME-binding
  namespace: YOUR_NAMESPACE
subjects:
# GCP user account
- kind: User
  name: janedoe@example.com
</code></pre>

<p>Reference</p>

<ul>
<li><a href="https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control" rel="nofollow noreferrer">Kubernetes Role-based access control</a></li>
</ul>
