Skip to content

Commit eb04766

Browse files
authored
Allow specifying ClusterRole when deploying Replicated SDK (#218)
1 parent 317c7c4 commit eb04766

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{{ if and .Values.clusterRole (not .Values.serviceAccountName) }}
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: ClusterRoleBinding
4+
metadata:
5+
labels:
6+
{{- include "replicated.labels" . | nindent 4 }}
7+
name: {{ include "replicated.roleBindingName" . }}
8+
namespace: {{ include "replicated.namespace" . | quote }}
9+
roleRef:
10+
apiGroup: rbac.authorization.k8s.io
11+
kind: ClusterRole
12+
name: {{ .Values.clusterRole }}
13+
subjects:
14+
- kind: ServiceAccount
15+
name: {{ include "replicated.serviceAccountName" . }}
16+
namespace: {{ include "replicated.namespace" . | quote }}
17+
{{ end }}

chart/templates/replicated-role.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{ if not .Values.serviceAccountName }}
1+
{{ if and (not .Values.serviceAccountName) (not .Values.clusterRole) }}
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: Role
44
metadata:

chart/templates/replicated-rolebinding.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{ if not .Values.serviceAccountName }}
1+
{{ if and (not .Values.serviceAccountName) (not .Values.clusterRole) }}
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: RoleBinding
44
metadata:

chart/values.yaml.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ statusInformers: null
3434
replicatedAppEndpoint: ""
3535

3636
serviceAccountName: ""
37+
clusterRole: ""
3738
imagePullSecrets: []
3839
nameOverride: ""
3940
namespaceOverride: ""

0 commit comments

Comments
 (0)