Skip to content

Instantly share code, notes, and snippets.

@sbueringer
Last active January 9, 2019 18:17
Show Gist options
  • Save sbueringer/5177ce35efcfcc364eabf8f3d930f898 to your computer and use it in GitHub Desktop.
Save sbueringer/5177ce35efcfcc364eabf8f3d930f898 to your computer and use it in GitHub Desktop.
Kubernetes Authorization via Open Policy Agent
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: pods
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["create", "update", "delete"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: user-pods
subjects:
- kind: Group
name: user
apiGroup: rbac.authorization.k8s.io
roleRef:
kind: ClusterRole
name: pods
apiGroup: rbac.authorization.k8s.io
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment