argocd-helm/charts/argo-cd/templates/argocd-repo-server/deployment.yaml
Lars Fenneberg 03aecd7af9
fix(argocd): Unconditionally start reposerver with uid_entrypoint.sh (#466)
* fix(argocd): Unconditionally start reposerver with uid_entrypoint.sh

While uid_entrypoint.sh contains the OpenShift specific manipulation of
/etc/passwd it also starts the reposerver via tini and so ensures that any
zombies produced by reposerver and its decendants are collected.

This matches the behaviour from the manifests included with the main ArgoCD
project. See:

* f93da5346c/manifests/base/repo-server/argocd-repo-server-deployment.yaml (L24)
* https://github.com/argoproj/argo-cd/pull/3721
* https://github.com/argoproj/argo-cd/issues/3611

* chore: Bumping minor semver as this feels like a bit more than a patch change.
2020-10-08 17:18:44 +11:00

165 lines
6.6 KiB
YAML
Executable file

{{- $redisHa := (index .Values "redis-ha") -}}
apiVersion: apps/v1
kind: Deployment
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 }}
app.kubernetes.io/version: {{ default .Values.global.image.tag .Values.repoServer.image.tag | quote }}
spec:
selector:
matchLabels:
app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.repoServer.name }}
app.kubernetes.io/instance: {{ .Release.Name }}
revisionHistoryLimit: 5
{{- if (ne .Values.repoServer.autoscaling.enabled true) }}
replicas: {{ .Values.repoServer.replicas }}
{{- end }}
template:
metadata:
{{- if .Values.repoServer.podAnnotations }}
annotations:
{{- range $key, $value := .Values.repoServer.podAnnotations }}
{{ $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 }}
app.kubernetes.io/version: {{ default .Values.global.image.tag .Values.repoServer.image.tag | quote }}
{{- if .Values.repoServer.podLabels }}
{{- toYaml .Values.repoServer.podLabels | 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 }}
containers:
- name: {{ .Values.repoServer.name }}
image: {{ default .Values.global.image.repository .Values.repoServer.image.repository }}:{{ default .Values.global.image.tag .Values.repoServer.image.tag }}
imagePullPolicy: {{ default .Values.global.image.imagePullPolicy .Values.repoServer.image.imagePullPolicy }}
command:
- uid_entrypoint.sh
- argocd-repo-server
{{- if or (and .Values.redis.enabled (not $redisHa.enabled)) (and $redisHa.enabled $redisHa.haproxy.enabled) }}
- --redis
- {{ template "argo-cd.redis.fullname" . }}:{{ .Values.redis.servicePort }}
{{- end }}
- --logformat
- {{ .Values.repoServer.logFormat }}
- --loglevel
- {{ .Values.repoServer.logLevel }}
{{- with .Values.repoServer.extraArgs }}
{{- . | toYaml | nindent 8 }}
{{- end }}
{{- if .Values.repoServer.containerSecurityContext }}
securityContext: {{- toYaml .Values.repoServer.containerSecurityContext | nindent 10 }}
{{- end }}
{{- if or (.Values.repoServer.env) (.Values.openshift.enabled) }}
env:
{{- if .Values.repoServer.env }}
{{- toYaml .Values.repoServer.env | nindent 8 }}
{{- end }}
{{- if .Values.openshift.enabled }}
- name: USER_NAME
value: argocd
{{- end }}
{{- end }}
volumeMounts:
{{- if .Values.repoServer.volumeMounts }}
{{- toYaml .Values.repoServer.volumeMounts | nindent 8}}
{{- end }}
{{- if .Values.openshift.enabled }}
- mountPath: /app/config/gpg/keys
name: gpg-keyring
{{- end }}
{{- if .Values.configs.knownHosts }}
- mountPath: /app/config/ssh
name: ssh-known-hosts
{{- end }}
{{- if .Values.configs.tlsCerts }}
- mountPath: /app/config/tls
name: tls-certs
{{- end }}
ports:
- name: repo-server
containerPort: {{ .Values.repoServer.containerPort }}
protocol: TCP
{{ if .Values.repoServer.metrics.enabled }}
- name: metrics
containerPort: 8084
protocol: TCP
{{- end }}
livenessProbe:
tcpSocket:
port: {{ .Values.repoServer.containerPort }}
initialDelaySeconds: {{ .Values.repoServer.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.repoServer.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.repoServer.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.repoServer.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.repoServer.livenessProbe.failureThreshold }}
readinessProbe:
tcpSocket:
port: {{ .Values.repoServer.containerPort }}
initialDelaySeconds: {{ .Values.repoServer.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.repoServer.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.repoServer.readinessProbe.timeoutSeconds }}
successThreshold: {{ .Values.repoServer.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.repoServer.readinessProbe.failureThreshold }}
resources:
{{- toYaml .Values.repoServer.resources | nindent 10 }}
{{- if .Values.repoServer.nodeSelector }}
nodeSelector:
{{- toYaml .Values.repoServer.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.repoServer.tolerations }}
tolerations:
{{- toYaml .Values.repoServer.tolerations | nindent 8 }}
{{- end }}
{{- if .Values.repoServer.affinity }}
affinity:
{{- toYaml .Values.repoServer.affinity | nindent 8 }}
{{- end }}
serviceAccountName: {{ template "argo-cd.repoServerServiceAccountName" . }}
{{- with .Values.global.hostAliases }}
hostAliases:
{{ toYaml . | indent 6 }}
{{- end }}
volumes:
{{- if .Values.repoServer.volumes }}
{{- toYaml .Values.repoServer.volumes | nindent 6}}
{{- end }}
{{- if .Values.openshift.enabled }}
- emptyDir: {}
name: gpg-keyring
{{- end }}
{{- if .Values.configs.knownHosts }}
- configMap:
name: argocd-ssh-known-hosts-cm
name: ssh-known-hosts
{{- end }}
{{- if .Values.configs.tlsCerts }}
- configMap:
name: argocd-tls-certs-cm
name: tls-certs
{{- end }}
{{- if .Values.repoServer.initContainers }}
initContainers:
{{- toYaml .Values.repoServer.initContainers | nindent 6 }}
{{- end }}
{{- if .Values.repoServer.priorityClassName }}
priorityClassName: {{ .Values.repoServer.priorityClassName }}
{{- end }}