From 8669f203a0c0a4eb4183bcfbff1b4217c8fe90e6 Mon Sep 17 00:00:00 2001 From: Rub21 Date: Fri, 15 Nov 2024 11:19:36 -0500 Subject: [PATCH] Add configmap for tiler server --- ...tiler-server-cache-cleaner-deployment.yaml | 50 ++----------------- .../tiler-server/tiler-server-configMap.yaml | 27 ++++++++++ .../tiler-server/tiler-server-deployment.yaml | 47 +++-------------- 3 files changed, 36 insertions(+), 88 deletions(-) create mode 100644 osm-seed/templates/tiler-server/tiler-server-configMap.yaml diff --git a/osm-seed/templates/tiler-server/tiler-server-cache-cleaner-deployment.yaml b/osm-seed/templates/tiler-server/tiler-server-cache-cleaner-deployment.yaml index f6e7995d..285715da 100644 --- a/osm-seed/templates/tiler-server/tiler-server-cache-cleaner-deployment.yaml +++ b/osm-seed/templates/tiler-server/tiler-server-cache-cleaner-deployment.yaml @@ -33,53 +33,9 @@ spec: memory: {{ .Values.tilerServerCacheCleaner.resources.limits.memory }} cpu: {{ .Values.tilerServerCacheCleaner.resources.limits.cpu }} {{- end }} - env: - # tiler-db env variables - - name: POSTGRES_HOST - value: {{ .Release.Name }}-tiler-db - - name: POSTGRES_DB - value: {{ .Values.tilerDb.env.POSTGRES_DB }} - - name: POSTGRES_PASSWORD - value: {{ quote .Values.tilerDb.env.POSTGRES_PASSWORD }} - - name: POSTGRES_USER - value: {{ .Values.tilerDb.env.POSTGRES_USER }} - - name: POSTGRES_PORT - value: {{ .Values.tilerDb.env.POSTGRES_PORT | quote }} - # tiler-server env variables - - 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_REGION - value: {{ .Values.tilerServer.env.TILER_CACHE_REGION }} - - 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: MAX_NUM_PS - value: {{ quote .Values.tilerServerCacheCleaner.env.MAX_NUM_PS }} - - name: PROCESS_NAME - value: {{ .Values.tilerServerCacheCleaner.env.PROCESS_NAME }} - - name: KILL_PROCESS - value: {{ .Values.tilerServerCacheCleaner.env.KILL_PROCESS }} - - 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 {{- if .Values.tilerServerCacheCleaner.nodeSelector.enabled }} nodeSelector: {{ .Values.tilerServerCacheCleaner.nodeSelector.label_key }} : {{ .Values.tilerServerCacheCleaner.nodeSelector.label_value }} diff --git a/osm-seed/templates/tiler-server/tiler-server-configMap.yaml b/osm-seed/templates/tiler-server/tiler-server-configMap.yaml new file mode 100644 index 00000000..b23dcaa7 --- /dev/null +++ b/osm-seed/templates/tiler-server/tiler-server-configMap.yaml @@ -0,0 +1,27 @@ +{{- if .Values.tilerServer.enabled -}} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-tiler-server-cm +data: + POSTGRES_HOST: {{ .Release.Name }}-tiler-db + POSTGRES_DB: {{ quote .Values.tilerDb.env.POSTGRES_DB }} + POSTGRES_PASSWORD: {{ quote .Values.tilerDb.env.POSTGRES_PASSWORD }} + POSTGRES_USER: {{ quote .Values.tilerDb.env.POSTGRES_USER }} + POSTGRES_PORT: {{ quote .Values.tilerDb.env.POSTGRES_PORT }} + TILER_SERVER_PORT: {{ quote .Values.tilerServer.env.TILER_SERVER_PORT }} + TILER_CACHE_TYPE: {{ quote .Values.tilerServer.env.TILER_CACHE_TYPE }} + TILER_CACHE_REGION: {{ quote .Values.tilerServer.env.TILER_CACHE_REGION }} + TILER_CACHE_BUCKET: {{ quote .Values.tilerServer.env.TILER_CACHE_BUCKET }} + TILER_CACHE_BASEPATH: {{ quote .Values.tilerServer.env.TILER_CACHE_BASEPATH }} + TILER_CACHE_AWS_ACCESS_KEY_ID: {{ quote .Values.tilerServer.env.TILER_CACHE_AWS_ACCESS_KEY_ID }} + TILER_CACHE_AWS_SECRET_ACCESS_KEY: {{ quote .Values.tilerServer.env.TILER_CACHE_AWS_SECRET_ACCESS_KEY }} + TILER_CACHE_MAX_ZOOM: {{ quote .Values.tilerServer.env.TILER_CACHE_MAX_ZOOM }} + CLOUDPROVIDER: {{ quote .Values.cloudProvider }} + {{- if eq .Values.cloudProvider "aws" }} + AWS_S3_BUCKET: {{ quote .Values.AWS_S3_BUCKET }} + {{- end }} + {{- if eq .Values.cloudProvider "gcp" }} + GCP_STORAGE_BUCKET: {{ quote .Values.GCP_STORAGE_BUCKET }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/osm-seed/templates/tiler-server/tiler-server-deployment.yaml b/osm-seed/templates/tiler-server/tiler-server-deployment.yaml index 65a474f9..6758552c 100644 --- a/osm-seed/templates/tiler-server/tiler-server-deployment.yaml +++ b/osm-seed/templates/tiler-server/tiler-server-deployment.yaml @@ -31,6 +31,9 @@ spec: - name: http containerPort: {{ .Values.tilerServer.env.TILER_SERVER_PORT }} protocol: TCP + - name: prometheus + containerPort: 9091 + protocol: TCP livenessProbe: httpGet: path: / @@ -46,47 +49,9 @@ spec: memory: {{ .Values.tilerServer.resources.limits.memory }} cpu: {{ .Values.tilerServer.resources.limits.cpu }} {{- end }} - env: - # tiler-db env variables - - name: POSTGRES_HOST - value: {{ .Release.Name }}-tiler-db - - name: POSTGRES_DB - value: {{ .Values.tilerDb.env.POSTGRES_DB }} - - name: POSTGRES_PASSWORD - value: {{ quote .Values.tilerDb.env.POSTGRES_PASSWORD }} - - name: POSTGRES_USER - value: {{ .Values.tilerDb.env.POSTGRES_USER }} - - name: POSTGRES_PORT - value: {{ .Values.tilerDb.env.POSTGRES_PORT | quote }} - # tiler-server env variables - - 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_REGION - value: {{ .Values.tilerServer.env.TILER_CACHE_REGION }} - - 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: 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 {{- if .Values.tilerServer.nodeSelector.enabled }} nodeSelector: {{ .Values.tilerServer.nodeSelector.label_key }} : {{ .Values.tilerServer.nodeSelector.label_value }}