{{- if .Values.server.enabled }} apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "explorer.fullname" . }}-server labels: {{- include "explorer.labels" . | nindent 4 }} spec: {{- if not .Values.server.autoscaling.enabled }} replicas: {{ .Values.server.replicaCount }} {{- end }} selector: matchLabels: {{- include "explorer.selectorLabels" . | nindent 6 }} template: metadata: annotations: checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} {{- with .Values.server.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "explorer.selectorLabels" . | nindent 8 }} {{- include "explorer.commonLabels" . | nindent 8 }} explorer-type: server spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "explorer.serviceAccountName" . }} securityContext: {{- toYaml .Values.server.podSecurityContext | nindent 8 }} {{- if .Values.files }} initContainers: - name: copy-{{ .Release.Name }}-config image: busybox command: ['sh', '-c', 'cp -v /configmap/* /config/'] volumeMounts: - name: configmap mountPath: /configmap - name: {{ .Release.Name }}-config mountPath: /config {{- if .Values.server.extraInitContainers }} {{- toYaml .Values.server.extraInitContainers | nindent 8 }} {{- end }} {{- end }} containers: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} {{- with .Values.server.args }} args: {{- tpl (toYaml .) $ | nindent 12 }} {{- end }} {{- range .Values.server.ports }} ports: - containerPort: {{ .containerPort }} name: {{ .name }} {{- end }} {{- if .Values.server.env }} env: {{- toYaml .Values.server.env | nindent 12 }} {{- end }} livenessProbe: initialDelaySeconds: {{ .Values.initialDelaySeconds }} failureThreshold: 5 timeoutSeconds: 1 httpGet: path: /health-check port: http readinessProbe: failureThreshold: 5 initialDelaySeconds: {{ .Values.initialDelaySeconds }} timeoutSeconds: 1 httpGet: path: /health-check port: http {{- if .Values.files }} volumeMounts: - name: configmap mountPath: /config {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} {{- if .Values.server.extraContainers }} {{- toYaml .Values.server.extraContainers | nindent 8 }} {{- end }} {{- with .Values.server.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.server.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.server.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} volumes: {{- if .Values.files }} - name: {{ .Release.Name }}-config emptyDir: {} - name: configmap configMap: name: {{ include "explorer.fullname" . }}-{{ .Release.Name }} {{- end }} {{- end }}