Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save developer-guy/608421c5a806dae0a5230d3f85c294ec to your computer and use it in GitHub Desktop.
Save developer-guy/608421c5a806dae0a5230d3f85c294ec to your computer and use it in GitHub Desktop.
A set of RBAC resources to enforce the restricted psp across all service accounts
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: restricted-cluster-role
rules:
- apiGroups:
- policy
resourceNames:
- restricted-psp
resources:
- podsecuritypolicies
verbs:
- use
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: restricted-cluster-role-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: restricted-cluster-role
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: system:serviceaccounts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment