Skip to content

Commit

Permalink
Add rbac templates
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-deboer committed Sep 4, 2017
1 parent e8d778a commit 20f3e84
Show file tree
Hide file tree
Showing 2 changed files with 160 additions and 0 deletions.
139 changes: 139 additions & 0 deletions templates/Role.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: Role
metadata:
name: ${name}

# edit rules as necessary
rules:
- apiGroups:
- ''
resources:
- pods
- pods/attach
- pods/exec
- pods/portforward
- pods/proxy
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- apiGroups:
- ''
resources:
- configmaps
- endpoints
- persistentvolumeclaims
- replicationcontrollers
- replicationcontrollers/scale
- secrets
- serviceaccounts
- services
- services/proxy
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- apiGroups:
- ''
resources:
- bindings
- events
- limitranges
- namespaces/status
- pods/log
- pods/status
- replicationcontrollers/status
- resourcequotas
- resourcequotas/status
verbs:
- get
- list
- watch
- apiGroups:
- ''
resources:
- namespaces
verbs:
- get
- list
- watch
- apiGroups:
- ''
resources:
- serviceaccounts
verbs:
- impersonate
- apiGroups:
- apps
resources:
- deployments
- deployments/rollback
- deployments/scale
- statefulsets
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- apiGroups:
- autoscaling
resources:
- horizontalpodautoscalers
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- apiGroups:
- batch
resources:
- cronjobs
- jobs
- scheduledjobs
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- apiGroups:
- extensions
resources:
- daemonsets
- deployments
- deployments/rollback
- deployments/scale
- ingresses
- replicasets
- replicasets/scale
- replicationcontrollers/scale
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
21 changes: 21 additions & 0 deletions templates/RoleBinding.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: RoleBinding
metadata:
name: ${name}
namespace: ${namespace}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: ${role_name}
subjects:
# remove or copy as needed
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: ${group_name}
- apiGroup: rbac.authorization.k8s.io
kind: User
name: ${user_name}
- apiGroup: rbac.authorization.k8s.io
kind: ServiceAccount
name: ${service_account_name}
namespace: ${service_account_namespace}

0 comments on commit 20f3e84

Please sign in to comment.