Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save InAnimaTe/727d6a1fd306598c68c3e128ff561d3e to your computer and use it in GitHub Desktop.
Save InAnimaTe/727d6a1fd306598c68c3e128ff561d3e to your computer and use it in GitHub Desktop.
example rbac (non-cluster roles)
kind: Role
apiVersion: rbac.authorization.k8s.io/v1alpha1
metadata:
name: {{ template "fullname" . }}
rules:
- apiGroups: ["*"]
resources: ["*"]
verbs: ["get", "watch", "list"]
nonResourceURLs: []
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1alpha1
metadata:
name: {{ template "fullname" . }}
subjects:
# The subject is the target service account
- kind: ServiceAccount
name: {{ template "fullname" . }}
roleRef:
# The roleRef specifies the role to give to the
# service account.
kind: Role
name: {{ template "fullname" . }} # Tectonic also provides "readonly", "user", and "admin" cluster roles.
apiGroup: rbac.authorization.k8s.io
---
kind: ServiceAccount
apiVersion: v1
metadata:
name: {{ template "fullname" . }}
@InAnimaTe
Copy link
Author

This is a helm template for creating the entirety of needed permissions for an application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment