From 0b132eeecc237c79c174abc6aa01c46fd66c71d3 Mon Sep 17 00:00:00 2001 From: Ioan Damian Date: Mon, 25 Jan 2021 10:16:35 +0200 Subject: [PATCH] v0.0.1 for osrm-backend chart --- charts/osrm-backend/templates/deployment.yaml | 33 +++++++++++++++++-- charts/osrm-backend/templates/pvc.yaml | 28 ++++++++++++++++ charts/osrm-backend/values.yaml | 14 +++++++- 3 files changed, 71 insertions(+), 4 deletions(-) create mode 100755 charts/osrm-backend/templates/pvc.yaml diff --git a/charts/osrm-backend/templates/deployment.yaml b/charts/osrm-backend/templates/deployment.yaml index 61c042c..9c9a77c 100644 --- a/charts/osrm-backend/templates/deployment.yaml +++ b/charts/osrm-backend/templates/deployment.yaml @@ -33,20 +33,39 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + command: + - osrm-routed + - --algorithm + - mld + {{- if .Values.mapName }} + - /data/{{ .Values.mapName }} + {{- else }} + - /data/romania-latest.osrm + {{- end }} + {{- if .Values.env }} + env: + {{ range $k, $v := .Values.env }} + - name: {{ $k | quote }} + value: {{ $v | quote }} + {{- end }} + {{- end }} ports: - name: http - containerPort: 80 + containerPort: {{ .Values.containerPort }} protocol: TCP livenessProbe: httpGet: - path: / + path: {{ .Values.healthCheckPath }} port: http readinessProbe: httpGet: - path: / + path: {{ .Values.healthCheckPath }} port: http resources: {{- toYaml .Values.resources | nindent 12 }} + volumeMounts: + - name: maps + mountPath: /data {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} @@ -59,3 +78,11 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + volumes: + - name: maps + {{- if .Values.persistence.enabled }} + persistentVolumeClaim: + claimName: {{ template "osrm-backend.fullname" . }} + {{- else }} + emptyDir: {} + {{- end }} diff --git a/charts/osrm-backend/templates/pvc.yaml b/charts/osrm-backend/templates/pvc.yaml new file mode 100755 index 0000000..9f5d41d --- /dev/null +++ b/charts/osrm-backend/templates/pvc.yaml @@ -0,0 +1,28 @@ +{{- if .Values.persistence.enabled -}} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ template "osrm-backend.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "osrm-backend.labels" . | nindent 4 }} + {{- with .Values.persistence.annotations }} + annotations: +{{ toYaml . | indent 4 }} + {{- end }} + {{- with .Values.persistence.finalizers }} + finalizers: +{{ toYaml . | indent 4 }} + {{- end }} +spec: + accessModes: + {{- range .Values.persistence.accessModes }} + - {{ . | quote }} + {{- end }} + resources: + requests: + storage: {{ .Values.persistence.size | quote }} + {{- if .Values.persistence.storageClassName }} + storageClassName: {{ .Values.persistence.storageClassName }} + {{- end -}} +{{- end -}} diff --git a/charts/osrm-backend/values.yaml b/charts/osrm-backend/values.yaml index ee6b9d4..a3865a6 100644 --- a/charts/osrm-backend/values.yaml +++ b/charts/osrm-backend/values.yaml @@ -14,6 +14,9 @@ imagePullSecrets: [] nameOverride: "" fullnameOverride: "" +mapName: "" +containerPort: 5000 + serviceAccount: # Specifies whether a service account should be created create: true @@ -37,7 +40,7 @@ securityContext: {} # runAsUser: 1000 service: - type: ClusterIP + type: NodePort port: 80 ingress: @@ -77,3 +80,12 @@ nodeSelector: {} tolerations: [] affinity: {} + +persistence: + enabled: false + storageClassName: "" + accessModes: + - ReadWriteMany + size: 8Gi + annotations: {} + finalizers: [] \ No newline at end of file