Handle no service account for repo-server

This commit is contained in:
Antoine Dubois 2019-11-07 16:03:28 +01:00
parent 1b133ca492
commit 7c811cc640
5 changed files with 25 additions and 15 deletions

View file

@ -105,7 +105,9 @@ spec:
affinity: affinity:
{{- toYaml .Values.repoServer.affinity | nindent 8 }} {{- toYaml .Values.repoServer.affinity | nindent 8 }}
{{- end }} {{- end }}
{{- if .Values.repoServer.serviceAccount.create }}
serviceAccountName: {{ template "argo-cd.repoServerServiceAccountName" . }} serviceAccountName: {{ template "argo-cd.repoServerServiceAccountName" . }}
{{- end }}
volumes: volumes:
{{- if .Values.repoServer.volumes }} {{- if .Values.repoServer.volumes }}
{{- toYaml .Values.repoServer.volumes | nindent 8}} {{- toYaml .Values.repoServer.volumes | nindent 8}}

View file

@ -1,3 +1,4 @@
{{- if .Values.repoServer.serviceAccount.create }}
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: Role kind: Role
metadata: metadata:
@ -13,3 +14,4 @@ rules:
{{- if .Values.repoServer.rbac }} {{- if .Values.repoServer.rbac }}
{{toYaml .Values.repoServer.rbac }} {{toYaml .Values.repoServer.rbac }}
{{- end }} {{- end }}
{{- end }}

View file

@ -1,3 +1,4 @@
{{- if .Values.repoServer.serviceAccount.create }}
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding kind: RoleBinding
metadata: metadata:
@ -17,3 +18,4 @@ subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: {{ template "argo-cd.repoServerServiceAccountName" . }} name: {{ template "argo-cd.repoServerServiceAccountName" . }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
{{- end }}

View file

@ -1,3 +1,4 @@
{{- if .Values.repoServer.serviceAccount.create }}
apiVersion: v1 apiVersion: v1
kind: ServiceAccount kind: ServiceAccount
metadata: metadata:
@ -9,3 +10,4 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: argocd app.kubernetes.io/part-of: argocd
app.kubernetes.io/component: {{ .Values.repoServer.name }} app.kubernetes.io/component: {{ .Values.repoServer.name }}
{{- end }}

View file

@ -478,13 +478,15 @@ repoServer:
# namespace: monitoring # namespace: monitoring
# additionalLabels: {} # additionalLabels: {}
## Repo server service account
## If create is set to true, make sure to uncomment the name and update the rbac section below
serviceAccount: serviceAccount:
create: true create: false
name: argocd-repo-server # name: argocd-repo-server
## Repo server rbac rules ## Repo server rbac rules
#rbac: # rbac:
#- apiGroups: # - apiGroups:
# - argoproj.io # - argoproj.io
# resources: # resources:
# - applications # - applications