helm-osrm-backend/templates/deployment.yaml
Mathias Beaulieu-Duncan 8576172bb4 Remove in-cluster data processing; serve pre-built OSRM data from PVC
The init containers downloaded the OSM extract and ran
osrm-extract/partition/customize on every pod start. extract peaks ~4GB+
RAM, which OOM-kills on the 4GB nodes whenever the pod restarts (it only
survived 306 days by never restarting). Removed both init containers.

Routing data (map.osrm.*) is now built OUTSIDE the cluster and loaded
onto the PVC directly. Bumped chart to 0.2.0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 17:11:04 -04:00

72 lines
2.5 KiB
YAML

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 }}