Skip to content

Instantly share code, notes, and snippets.

@guliujian
Created October 9, 2022 09:22
Show Gist options
  • Save guliujian/0ac0d07540f614f0a47f443436884a66 to your computer and use it in GitHub Desktop.
Save guliujian/0ac0d07540f614f0a47f443436884a66 to your computer and use it in GitHub Desktop.
psp
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: use-kube-system-psp
rules:
- apiGroups: ['policy']
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames:
- kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: restricted-role-bind
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: use-kube-system-psp
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: system:serviceaccounts:kube-system
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment