Skip to content

Commit

Permalink
Allow specifying ClusterRole when deploying Replicated SDK (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
divolgin authored Oct 17, 2024
1 parent 317c7c4 commit eb04766
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
17 changes: 17 additions & 0 deletions chart/templates/replicated-clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{ if and .Values.clusterRole (not .Values.serviceAccountName) }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
{{- include "replicated.labels" . | nindent 4 }}
name: {{ include "replicated.roleBindingName" . }}
namespace: {{ include "replicated.namespace" . | quote }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ .Values.clusterRole }}
subjects:
- kind: ServiceAccount
name: {{ include "replicated.serviceAccountName" . }}
namespace: {{ include "replicated.namespace" . | quote }}
{{ end }}
2 changes: 1 addition & 1 deletion chart/templates/replicated-role.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ if not .Values.serviceAccountName }}
{{ if and (not .Values.serviceAccountName) (not .Values.clusterRole) }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
Expand Down
2 changes: 1 addition & 1 deletion chart/templates/replicated-rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ if not .Values.serviceAccountName }}
{{ if and (not .Values.serviceAccountName) (not .Values.clusterRole) }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
Expand Down
1 change: 1 addition & 0 deletions chart/values.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ statusInformers: null
replicatedAppEndpoint: ""

serviceAccountName: ""
clusterRole: ""
imagePullSecrets: []
nameOverride: ""
namespaceOverride: ""
Expand Down

0 comments on commit eb04766

Please sign in to comment.