Skip to content

Commit

Permalink
Update tiler charts helm to support multi configmap
Browse files Browse the repository at this point in the history
  • Loading branch information
Rub21 committed Dec 7, 2024
1 parent 19d0f7b commit 994581f
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 52 deletions.
3 changes: 1 addition & 2 deletions osm-seed/templates/tiler-db/tiler-db-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ data:
POSTGRES_PASSWORD: {{ .Values.tilerDb.env.POSTGRES_PASSWORD | quote }}
POSTGRES_USER: {{ .Values.tilerDb.env.POSTGRES_USER | quote }}
POSTGRES_PORT: {{ .Values.tilerDb.env.POSTGRES_PORT | quote }}
PGUSER: {{ .Values.tilerDb.env.POSTGRES_USER | quote }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion osm-seed/templates/tiler-db/tiler-db-pd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ data:
{{ .Values.tilerDb.postgresqlConfig.values | indent 4 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
4 changes: 2 additions & 2 deletions osm-seed/templates/tiler-db/tiler-db-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ spec:
- port: 5432
targetPort: 5432
selector:
app: {{ template "osm-seed.name" . }}
app: {{ .Release.Name }}-tiler-db
release: {{ .Release.Name }}
run: {{ .Release.Name }}-tiler-db
{{- end }}
{{- end }}
{{- end }}
13 changes: 7 additions & 6 deletions osm-seed/templates/tiler-db/tiler-db-statefulset.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
{{- if .Values.tilerDb.enabled -}}
{{- if not .Values.tilerDb.useExternalHost.enabled -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ .Release.Name }}-tiler-db
labels:
app: {{ template "osm-seed.name" . }}
app: {{ .Release.Name }}-tiler-db
component: db-tiler-statefulset
environment: {{ .Values.environment }}
release: {{ .Release.Name }}
spec:
replicas: 1 # we only ever want one replica of the db
replicas: 1
selector:
matchLabels:
app: {{ template "osm-seed.name" . }}
app: {{ .Release.Name }}-tiler-db
release: {{ .Release.Name }}
run: {{ .Release.Name }}-tiler-db
serviceName: {{ .Release.Name }}-tiler-db
template:
metadata:
labels:
app: {{ template "osm-seed.name" . }}
app: {{ .Release.Name }}-tiler-db
release: {{ .Release.Name }}
run: {{ .Release.Name }}-tiler-db
spec:
Expand All @@ -34,6 +33,9 @@ spec:
envFrom:
- configMapRef:
name: {{ .Release.Name }}-tiler-db-cm
env:
- name: POD_IP
valueFrom: { fieldRef: { fieldPath: status.podIP } }
{{- if and .Values.tilerDb.postgresqlConfig.enabled .Values.tilerDb.persistenceDisk.enabled }}
command:
- "sh"
Expand Down Expand Up @@ -99,4 +101,3 @@ spec:
{{ .Values.tilerDb.nodeSelector.label_key }} : {{ .Values.tilerDb.nodeSelector.label_value }}
{{- end }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion osm-seed/templates/tiler-imposm/tiler-imposm-pd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ spec:
storage: {{ .Values.tilerImposm.persistenceDisk.GCP_gcePersistentDisk_size }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
7 changes: 4 additions & 3 deletions osm-seed/templates/tiler-imposm/tiler-imposm-service.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if .Values.tilerImposm.enabled -}}
# TODO, delete service for tiler-imposm
apiVersion: v1
kind: Service
metadata:
Expand All @@ -13,7 +14,7 @@ spec:
- port: 3000
targetPort: 3000
selector:
app: {{ template "osm-seed.name" . }}
app: {{ .Release.Name }}-tiler-imposm-sts
release: {{ .Release.Name }}
run: {{ .Release.Name }}-tiler-imposm
{{- end }}
run: {{ .Release.Name }}-tiler-imposm-sts
{{- end }}
9 changes: 5 additions & 4 deletions osm-seed/templates/tiler-imposm/tiler-imposm-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ .Release.Name }}-tiler-imposm-statefulset
name: {{ .Release.Name }}-tiler-imposm-sts
labels:
app: {{ template "osm-seed.name" . }}
component: tiler-imposm
Expand All @@ -11,16 +11,16 @@ metadata:
spec:
selector:
matchLabels:
app: {{ .Release.Name }}-tiler-imposm-statefulset
app: {{ .Release.Name }}-tiler-imposm-sts
serviceName: {{ .Release.Name }}-tiler-imposm
replicas: 1
template:
metadata:
labels:
app: {{ .Release.Name }}-tiler-imposm-statefulset
app: {{ .Release.Name }}-tiler-imposm-sts
spec:
containers:
- name: {{ .Release.Name }}-tiler-imposm-statefulset
- name: {{ .Release.Name }}-tiler-imposm-sts
image: {{ .Values.tilerImposm.image.name }}:{{ .Values.tilerImposm.image.tag }}
command: ['./start.sh']
livenessProbe:
Expand All @@ -43,6 +43,7 @@ spec:
cpu: {{ .Values.tilerImposm.resources.limits.cpu }}
{{- end }}
env:
# Tiler
- name: TILER_IMPORT_FROM
value: {{ .Values.tilerImposm.env.TILER_IMPORT_FROM | quote }}
- name: TILER_IMPORT_PBF_URL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ spec:
envFrom:
- configMapRef:
name: {{ .Release.Name }}-tiler-server-cm
- configMapRef:
- configMapRef:
name: {{ .Release.Name }}-tiler-db-cm
{{- if .Values.tilerServer.nodeSelector.enabled }}
nodeSelector:
Expand Down
33 changes: 2 additions & 31 deletions osm-seed/templates/tiler-server/tiler-server-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ template "osm-seed.fullname" . }}-tiler-server
name: {{ .Release.Name }}-tiler-server
labels:
app: {{ template "osm-seed.name" . }}
component: tiler-server-statefulset
Expand Down Expand Up @@ -47,39 +47,10 @@ spec:
memory: {{ .Values.tilerServer.resources.limits.memory }}
cpu: {{ .Values.tilerServer.resources.limits.cpu }}
{{- end }}
env:
- name: TILER_SERVER_PORT
value: {{ .Values.tilerServer.env.TILER_SERVER_PORT | quote }}
- name: TILER_CACHE_TYPE
value: {{ .Values.tilerServer.env.TILER_CACHE_TYPE }}
- name: TILER_CACHE_BUCKET
value: {{ .Values.tilerServer.env.TILER_CACHE_BUCKET }}
- name: TILER_CACHE_BASEPATH
value: {{ quote .Values.tilerServer.env.TILER_CACHE_BASEPATH }}
- name: TILER_CACHE_AWS_ACCESS_KEY_ID
value: {{ quote .Values.tilerServer.env.TILER_CACHE_AWS_ACCESS_KEY_ID }}
- name: TILER_CACHE_AWS_SECRET_ACCESS_KEY
value: {{ quote .Values.tilerServer.env.TILER_CACHE_AWS_SECRET_ACCESS_KEY }}
- name: TILER_CACHE_MAX_ZOOM
value: {{ quote .Values.tilerServer.env.TILER_CACHE_MAX_ZOOM }}
- name: TILER_CACHE_REGION
value: {{ .Values.tilerServer.env.TILER_CACHE_REGION }}
- name: CLOUDPROVIDER
value: {{ .Values.cloudProvider }}
# In case cloudProvider=aws
{{- if eq .Values.cloudProvider "aws" }}
- name: AWS_S3_BUCKET
value: {{ .Values.AWS_S3_BUCKET }}
{{- end }}
# In case cloudProvider=gcp
{{- if eq .Values.cloudProvider "gcp" }}
- name: GCP_STORAGE_BUCKET
value: {{ .Values.GCP_STORAGE_BUCKET }}
{{- end }}
envFrom:
- configMapRef:
name: {{ .Release.Name }}-tiler-server-cm
- configMapRef:
- configMapRef:
name: {{ .Release.Name }}-tiler-db-cm
volumeMounts:
- mountPath: /mnt/data
Expand Down

0 comments on commit 994581f

Please sign in to comment.