Skip to content

Instantly share code, notes, and snippets.

@innovia
Last active March 12, 2019 12:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save innovia/cc649b753586e991ae2416935ef978cc to your computer and use it in GitHub Desktop.
Save innovia/cc649b753586e991ae2416935ef978cc to your computer and use it in GitHub Desktop.
Role for serviceacocunt bound to namespace
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
namespace: services-stg
name: deploy-stg
rules:
- apiGroups: ["", "extensions", "apps"] # "" indicates the core API group
resources: ["*"]
verbs: ["*"]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: staging-default-ns-binding
namespace: default
subjects:
- kind: User
name: system:serviceaccount:default:services-stg
roleRef:
kind: ClusterRole
name: view
apiGroup: rbac.authorization.k8s.io
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment