From 994581fae3849fd5b5a5a69ec56189f48ce6262c Mon Sep 17 00:00:00 2001 From: Rub21 Date: Sat, 7 Dec 2024 06:30:58 -0500 Subject: [PATCH] Update tiler charts helm to support multi configmap --- .../tiler-db/tiler-db-configmap.yaml | 3 +- osm-seed/templates/tiler-db/tiler-db-pd.yaml | 2 +- .../tiler-db-postgresql-configmap.yaml | 2 +- .../templates/tiler-db/tiler-db-service.yaml | 4 +-- .../tiler-db/tiler-db-statefulset.yaml | 13 ++++---- .../tiler-imposm/tiler-imposm-pd.yaml | 2 +- .../tiler-imposm/tiler-imposm-service.yaml | 7 ++-- .../tiler-imposm-statefulset.yaml | 9 ++--- .../tiler-server/tiler-server-deployment.yaml | 2 +- .../tiler-server-statefulset.yaml | 33 ++----------------- 10 files changed, 25 insertions(+), 52 deletions(-) diff --git a/osm-seed/templates/tiler-db/tiler-db-configmap.yaml b/osm-seed/templates/tiler-db/tiler-db-configmap.yaml index 03c5a5ca..7072e059 100644 --- a/osm-seed/templates/tiler-db/tiler-db-configmap.yaml +++ b/osm-seed/templates/tiler-db/tiler-db-configmap.yaml @@ -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 }} \ No newline at end of file +{{- end }} diff --git a/osm-seed/templates/tiler-db/tiler-db-pd.yaml b/osm-seed/templates/tiler-db/tiler-db-pd.yaml index 33a38d89..fd1047b4 100644 --- a/osm-seed/templates/tiler-db/tiler-db-pd.yaml +++ b/osm-seed/templates/tiler-db/tiler-db-pd.yaml @@ -84,4 +84,4 @@ spec: {{- end }} {{- end }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/osm-seed/templates/tiler-db/tiler-db-postgresql-configmap.yaml b/osm-seed/templates/tiler-db/tiler-db-postgresql-configmap.yaml index e7e547c2..e79ae4e6 100644 --- a/osm-seed/templates/tiler-db/tiler-db-postgresql-configmap.yaml +++ b/osm-seed/templates/tiler-db/tiler-db-postgresql-configmap.yaml @@ -13,4 +13,4 @@ data: {{ .Values.tilerDb.postgresqlConfig.values | indent 4 }} {{- end }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/osm-seed/templates/tiler-db/tiler-db-service.yaml b/osm-seed/templates/tiler-db/tiler-db-service.yaml index f8fa6957..9b6da959 100644 --- a/osm-seed/templates/tiler-db/tiler-db-service.yaml +++ b/osm-seed/templates/tiler-db/tiler-db-service.yaml @@ -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 }} \ No newline at end of file +{{- end }} diff --git a/osm-seed/templates/tiler-db/tiler-db-statefulset.yaml b/osm-seed/templates/tiler-db/tiler-db-statefulset.yaml index 94d08176..c7113954 100644 --- a/osm-seed/templates/tiler-db/tiler-db-statefulset.yaml +++ b/osm-seed/templates/tiler-db/tiler-db-statefulset.yaml @@ -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: @@ -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" @@ -99,4 +101,3 @@ spec: {{ .Values.tilerDb.nodeSelector.label_key }} : {{ .Values.tilerDb.nodeSelector.label_value }} {{- end }} {{- end }} -{{- end }} diff --git a/osm-seed/templates/tiler-imposm/tiler-imposm-pd.yaml b/osm-seed/templates/tiler-imposm/tiler-imposm-pd.yaml index 2c238c06..aa2d1cea 100644 --- a/osm-seed/templates/tiler-imposm/tiler-imposm-pd.yaml +++ b/osm-seed/templates/tiler-imposm/tiler-imposm-pd.yaml @@ -82,4 +82,4 @@ spec: storage: {{ .Values.tilerImposm.persistenceDisk.GCP_gcePersistentDisk_size }} {{- end }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/osm-seed/templates/tiler-imposm/tiler-imposm-service.yaml b/osm-seed/templates/tiler-imposm/tiler-imposm-service.yaml index 5f2d5454..fa7c7239 100644 --- a/osm-seed/templates/tiler-imposm/tiler-imposm-service.yaml +++ b/osm-seed/templates/tiler-imposm/tiler-imposm-service.yaml @@ -1,4 +1,5 @@ {{- if .Values.tilerImposm.enabled -}} +# TODO, delete service for tiler-imposm apiVersion: v1 kind: Service metadata: @@ -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 }} \ No newline at end of file + run: {{ .Release.Name }}-tiler-imposm-sts +{{- end }} diff --git a/osm-seed/templates/tiler-imposm/tiler-imposm-statefulset.yaml b/osm-seed/templates/tiler-imposm/tiler-imposm-statefulset.yaml index b070fd20..5f2385c6 100644 --- a/osm-seed/templates/tiler-imposm/tiler-imposm-statefulset.yaml +++ b/osm-seed/templates/tiler-imposm/tiler-imposm-statefulset.yaml @@ -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 @@ -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: @@ -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 diff --git a/osm-seed/templates/tiler-server/tiler-server-deployment.yaml b/osm-seed/templates/tiler-server/tiler-server-deployment.yaml index feb207e1..b0a659b2 100644 --- a/osm-seed/templates/tiler-server/tiler-server-deployment.yaml +++ b/osm-seed/templates/tiler-server/tiler-server-deployment.yaml @@ -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: diff --git a/osm-seed/templates/tiler-server/tiler-server-statefulset.yaml b/osm-seed/templates/tiler-server/tiler-server-statefulset.yaml index 1e1815fa..80818bdb 100644 --- a/osm-seed/templates/tiler-server/tiler-server-statefulset.yaml +++ b/osm-seed/templates/tiler-server/tiler-server-statefulset.yaml @@ -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 @@ -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