<p>Is there a way to create a K8s cluster role with full access (all resources, verbs and apigroups on any namespaces) but no commands execution on all namespaces for example: <code>kubectl delete pods --all-namespaces</code> or <code>kubectl delete pv --all-namespaces</code>?</p>
<p>(Running the same commands on a single namespace should be allowed, just not in bulk to all namespaces).</p>
<p>If this cannot be achieved with a cluster role, is there another way to achieve it?</p>

<p>What if bind clusterrole to only needed namespaces and not give permissions to restricted ones? Thats not full solution, at least user wont be able to delete not needed ones. And strictly answering your question - not sure this is possible.</p>
<pre><code>---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: testsa
  namespace: default
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: testclusterrole
rules:
- apiGroups: [&quot;&quot;]
  resources: [&quot;pods&quot;,&quot;services&quot;,&quot;namespaces&quot;,&quot;deployments&quot;,&quot;jobs&quot;]
  verbs: [&quot;get&quot;, &quot;watch&quot;, &quot;list&quot;, &quot;create&quot;, &quot;delete&quot;, &quot;patch&quot;, &quot;update&quot;]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: job-master-1
  namespace: namespace1
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: testclusterrole
subjects:
- kind: ServiceAccount
  name: testsa
  namespace: default
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: job-master-2
  namespace: namespace2
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: job-master
subjects:
- kind: ServiceAccount
  name: satestsa  namespace: default

</code></pre>
