Skip to content

Commit

Permalink
Add template for binding Serviceaccount to a cluster role (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
pabrahamsson authored and sabre1041 committed Jul 26, 2019
1 parent 2f71a03 commit 36bf9e6
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions role-bindings/serviceaccount-clusterrole-binding.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
kind: Template
apiVersion: v1
metadata:
name: ServiceAccountClusterRoleBinding
annotations:
openshift.io/display-name: ClusterRoleBinding for ServiceAccount
objects:
- apiVersion: v1
kind: ClusterRoleBinding
metadata:
name: "${CLUSTER_ROLE}-binding-${SA}-${SA_NAMESPACE}"
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: "${CLUSTER_ROLE}"
subjects:
- kind: ServiceAccount
name: "${SA}"
namespace: "${SA_NAMESPACE}"
parameters:
- name: CLUSTER_ROLE
description: The cluster role
required: true
- name: SA
description: Serviceaccount to bind to
required: true
- name: SA_NAMESPACE
description: The namespace for the Serviceaccount
required: true

0 comments on commit 36bf9e6

Please sign in to comment.