apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "helm-osrm-backend.fullname" . }} labels: {{- include "helm-osrm-backend.labels" . | nindent 4 }} spec: {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} {{- end }} selector: matchLabels: {{- include "helm-osrm-backend.selectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.podAnnotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "helm-osrm-backend.labels" . | nindent 8 }} {{- with .Values.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "helm-osrm-backend.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} {{- if .Values.initContainer.enabled }} initContainers: - name: osrm-download image: busybox command: [ "sh", "-c" ] args: - wget -O /data/{{ .Values.initContainer.fileName }} {{ .Values.initContainer.url }}; volumeMounts: - name: osrm-data mountPath: {{ .Values.volume.mountPath }} - name: osrm-init image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" command: {{ .Values.initContainer.command | toYaml | nindent 10 }} volumeMounts: - name: osrm-data mountPath: {{ .Values.volume.mountPath }} {{- 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 }} ports: - name: http containerPort: {{ .Values.service.port }} protocol: TCP livenessProbe: {{- toYaml .Values.livenessProbe | nindent 12 }} readinessProbe: {{- toYaml .Values.readinessProbe | nindent 12 }} resources: {{- toYaml .Values.resources | nindent 12 }} volumeMounts: - name: osrm-data mountPath: {{ .Values.volume.mountPath }} command: {{ .Values.command | toYaml | nindent 10 }} volumes: - name: osrm-data persistentVolumeClaim: claimName: {{ .Values.volume.existingClaim | default (include "helm-osrm-backend.fullname" .) }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }}