argocd-helm/charts/argo-cd/templates/dex/deployment.yaml
Ken Kaizu 4538e57aae
feat(argo-cd): add dex server extra args (#1146)
Signed-off-by: krrrr38 <k.kaizu38@gmail.com>
2022-02-23 11:02:22 +00:00

158 lines
5.7 KiB
YAML
Executable file

{{- if .Values.dex.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "argo-cd.dex.fullname" . }}
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 4 }}
app.kubernetes.io/version: {{ .Values.dex.image.tag | quote }}
spec:
selector:
matchLabels:
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.dex.name) | nindent 6 }}
template:
metadata:
{{- with (mergeOverwrite (deepCopy .Values.global.podAnnotations) .Values.dex.podAnnotations) }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 8 }}
app.kubernetes.io/version: {{ .Values.dex.image.tag | quote }}
{{- with (mergeOverwrite (deepCopy .Values.global.podLabels) .Values.dex.podLabels) }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.global.securityContext }}
securityContext: {{- toYaml .Values.global.securityContext | nindent 8 }}
{{- end }}
initContainers:
- name: copyutil
image: {{ default .Values.global.image.repository .Values.dex.initImage.repository }}:{{ default (include "argo-cd.defaultTag" .) .Values.dex.initImage.tag }}
imagePullPolicy: {{ default .Values.global.image.imagePullPolicy .Values.dex.initImage.imagePullPolicy }}
resources:
{{- toYaml .Values.dex.resources | nindent 10 }}
{{- if .Values.dex.containerSecurityContext }}
securityContext: {{- toYaml .Values.dex.containerSecurityContext | nindent 10 }}
{{- end }}
command:
- cp
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
volumeMounts:
- mountPath: /shared
name: static-files
containers:
- name: {{ .Values.dex.name }}
image: {{ .Values.dex.image.repository }}:{{ .Values.dex.image.tag }}
imagePullPolicy: {{ .Values.dex.image.imagePullPolicy }}
command:
- /shared/argocd-dex
- rundex
{{- with .Values.dex.extraArgs }}
{{- . | toYaml | nindent 8 }}
{{- end }}
{{- if .Values.dex.containerSecurityContext }}
securityContext: {{- toYaml .Values.dex.containerSecurityContext | nindent 10 }}
{{- end }}
{{- if .Values.dex.env }}
env:
{{- toYaml .Values.dex.env | nindent 8 }}
{{- end }}
{{- with .Values.dex.envFrom }}
envFrom: {{- toYaml . | nindent 8 }}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.dex.containerPortHttp }}
protocol: TCP
- name: grpc
containerPort: {{ .Values.dex.containerPortGrpc }}
protocol: TCP
- name: metrics
containerPort: {{ .Values.dex.containerPortMetrics }}
protocol: TCP
{{- if .Values.dex.livenessProbe.enabled }}
livenessProbe:
httpGet:
path: /healthz/live
port: metrics
{{- with .Values.dex.livenessProbe }}
{{- omit . "enabled" | toYaml | nindent 10 }}
{{- end }}
{{- end }}
{{- if .Values.dex.readinessProbe.enabled }}
readinessProbe:
httpGet:
path: /healthz/ready
port: metrics
{{- with .Values.dex.readinessProbe }}
{{- omit . "enabled" | toYaml | nindent 10 }}
{{- end }}
{{- end }}
volumeMounts:
- mountPath: /tmp
name: tmp-dir
{{- if .Values.dex.volumeMounts }}
{{- toYaml .Values.dex.volumeMounts | nindent 8 }}
{{- end }}
{{- if .Values.dex.extraVolumeMounts }}
{{- toYaml .Values.dex.extraVolumeMounts | nindent 8 }}
{{- end }}
resources:
{{- toYaml .Values.dex.resources | nindent 10 }}
{{- with .Values.dex.extraContainers }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- if .Values.dex.nodeSelector }}
nodeSelector:
{{- toYaml .Values.dex.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.dex.tolerations }}
tolerations:
{{- toYaml .Values.dex.tolerations | nindent 8 }}
{{- end }}
{{- if .Values.dex.affinity }}
affinity:
{{- toYaml .Values.dex.affinity | nindent 8 }}
{{- end }}
{{- with .Values.dex.topologySpreadConstraints }}
topologySpreadConstraints:
{{- range $constraint := . }}
- {{ toYaml $constraint | nindent 8 | trim }}
{{- if not $constraint.labelSelector }}
labelSelector:
matchLabels:
{{- include "argo-cd.selectorLabels" (dict "context" $ "name" $.Values.dex.name) | nindent 12 }}
{{- end }}
{{- end }}
{{- end }}
serviceAccountName: {{ template "argo-cd.dexServiceAccountName" . }}
{{- with .Values.global.hostAliases }}
hostAliases:
{{- toYaml . | nindent 6 }}
{{- end }}
volumes:
- emptyDir: {}
name: tmp-dir
{{- if .Values.dex.volumes }}
{{- toYaml .Values.dex.volumes | nindent 6 }}
{{- end }}
{{- if .Values.dex.extraVolumes }}
{{- toYaml .Values.dex.extraVolumes | nindent 6 }}
{{- end }}
{{- if .Values.dex.initContainers }}
initContainers:
{{- toYaml .Values.dex.initContainers | nindent 6 }}
{{- end }}
{{- if .Values.dex.priorityClassName }}
priorityClassName: {{ .Values.dex.priorityClassName }}
{{- end }}
{{- end }}