Repo server rbac (#160)
* Added Role and service account to repo-server * Fixed comment in repo-server SA name helper * Bumped chart version * Added repoServer service account annotations
This commit is contained in:
parent
9b3d5d35a7
commit
8c3430b89e
7 changed files with 89 additions and 1 deletions
|
|
@ -92,6 +92,17 @@ Create the name of the ArgoCD server service account to use
|
|||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create the name of the repo-server service account to use
|
||||
*/}}
|
||||
{{- define "argo-cd.repoServerServiceAccountName" -}}
|
||||
{{- if .Values.repoServer.serviceAccount.create -}}
|
||||
{{ default (include "argo-cd.fullname" .) .Values.repoServer.serviceAccount.name }}
|
||||
{{- else -}}
|
||||
{{ default "default" .Values.repoServer.serviceAccount.name }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
|
|
|
|||
|
|
@ -105,6 +105,7 @@ spec:
|
|||
affinity:
|
||||
{{- toYaml .Values.repoServer.affinity | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ template "argo-cd.repoServerServiceAccountName" . }}
|
||||
volumes:
|
||||
{{- if .Values.repoServer.volumes }}
|
||||
{{- toYaml .Values.repoServer.volumes | nindent 8}}
|
||||
|
|
|
|||
17
charts/argo-cd/templates/argocd-repo-server/role.yaml
Normal file
17
charts/argo-cd/templates/argocd-repo-server/role.yaml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{{- if .Values.repoServer.serviceAccount.create }}
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: {{ template "argo-cd.repoServer.fullname" . }}
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.repoServer.name }}
|
||||
helm.sh/chart: {{ include "argo-cd.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
app.kubernetes.io/part-of: argocd
|
||||
app.kubernetes.io/component: {{ .Values.repoServer.name }}
|
||||
rules:
|
||||
{{- if .Values.repoServer.rbac }}
|
||||
{{toYaml .Values.repoServer.rbac }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
21
charts/argo-cd/templates/argocd-repo-server/rolebinding.yaml
Normal file
21
charts/argo-cd/templates/argocd-repo-server/rolebinding.yaml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{{- if .Values.repoServer.serviceAccount.create }}
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: {{ template "argo-cd.repoServer.fullname" . }}
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.repoServer.name }}
|
||||
helm.sh/chart: {{ include "argo-cd.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
app.kubernetes.io/part-of: argocd
|
||||
app.kubernetes.io/component: {{ .Values.repoServer.name }}
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: {{ template "argo-cd.repoServer.fullname" . }}
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ template "argo-cd.repoServerServiceAccountName" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
{{- if .Values.repoServer.serviceAccount.create }}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ template "argo-cd.repoServerServiceAccountName" . }}
|
||||
{{- if .Values.repoServer.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- range $key, $value := .Values.repoServer.serviceAccount.annotations }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.repoServer.name }}
|
||||
helm.sh/chart: {{ include "argo-cd.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
app.kubernetes.io/part-of: argocd
|
||||
app.kubernetes.io/component: {{ .Values.repoServer.name }}
|
||||
{{- end }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue