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 }} # NOTE: No init containers. OSRM routing data (map.osrm.*) is built OUTSIDE the # cluster (osrm-extract/partition/customize) and loaded onto the PVC directly. # In-cluster extraction was removed: it peaks ~4GB+ RAM and OOM-kills on restart. 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 }}