Skip to content

Instantly share code, notes, and snippets.

@samcre
Created August 17, 2018 12:38
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 samcre/6bb9b49e9aba704a991a3af33eecccee to your computer and use it in GitHub Desktop.
Save samcre/6bb9b49e9aba704a991a3af33eecccee to your computer and use it in GitHub Desktop.
Deploys Role for Kubernetes
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: deployer-binding
namespace: ${NAMESPACE}
subjects:
- kind: Group
name: deploys
namespace: ${NAMESPACE}
apiGroup: rbac.authorization.k8s.io
roleRef:
kind: Role
name: deployer
apiGroup: rbac.authorization.k8s.io
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: deployer
namespace: ${NAMESPACE}
rules:
- apiGroups: ["apps", "extensions"]
resources: ["deployments"]
verbs: ["get", "list", "watch", "create", "delete", "update", "patch"]
- apiGroups: [""] # "" indicates the core API group
resources: ["configmaps", "secrets"]
verbs: ["get", "list", "watch", "create", "delete", "update", "patch"]
- apiGroups: [""] # "" indicates the core API group
resources: ["pods"]
verbs: ["get", "list", "watch"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment