Skip to content

Commit

Permalink
Add configmap for tiler server
Browse files Browse the repository at this point in the history
  • Loading branch information
Rub21 committed Nov 15, 2024
1 parent 10eca67 commit 8669f20
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 88 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
27 changes: 27 additions & 0 deletions osm-seed/templates/tiler-server/tiler-server-configMap.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
47 changes: 6 additions & 41 deletions osm-seed/templates/tiler-server/tiler-server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: /
Expand All @@ -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 }}
Expand Down

0 comments on commit 8669f20

Please sign in to comment.