Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow specifying ClusterRole when deploying Replicated SDK #218

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading