Skip to content

Commit

Permalink
Update tiler config for external service
Browse files Browse the repository at this point in the history
  • Loading branch information
Rub21 committed Feb 26, 2025
1 parent 4b03235 commit 051d9ed
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.tilerServer.enabled -}}
{{- if and .Values.tilerServer.enabled (not .Values.tilerServer.externalService.enabled) }}
{{ if eq .Values.tilerServer.env.TILER_CACHE_TYPE "s3" }}
{{- if .Values.tilerServerCacheCleaner.enabled -}}
apiVersion: apps/v1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.tilerServer.enabled -}}
{{- if and .Values.tilerServer.enabled (not .Values.tilerServer.externalService.enabled) }}
{{ if eq .Values.tilerServer.env.TILER_CACHE_TYPE "s3" }}
{{- if .Values.tilerServerCacheCleaner.enabled -}}
{{- if .Values.tilerServerCacheCleaner.autoscaling.enabled -}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.tilerServer.enabled -}}
{{- if and .Values.tilerServer.enabled (not .Values.tilerServer.externalService.enabled) }}
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.tilerServer.enabled -}}
{{- if and .Values.tilerServer.enabled (not .Values.tilerServer.externalService.enabled) }}
{{ if eq .Values.tilerServer.env.TILER_CACHE_TYPE "s3" }}
apiVersion: apps/v1
kind: Deployment
Expand Down
2 changes: 1 addition & 1 deletion osm-seed/templates/tiler-server/tiler-server-dp.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.tilerServer.enabled -}}
{{- if and .Values.tilerServer.enabled (not .Values.tilerServer.externalService.enabled) }}
{{ if eq .Values.tilerServer.env.TILER_CACHE_TYPE "file" }}
{{- if .Values.tilerServer.persistenceDisk.enabled -}}
apiVersion: v1
Expand Down
2 changes: 1 addition & 1 deletion osm-seed/templates/tiler-server/tiler-server-hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.tilerServer.enabled -}}
{{- if and .Values.tilerServer.enabled (not .Values.tilerServer.externalService.enabled) }}
{{- if .Values.tilerServer.autoscaling.enabled -}}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
Expand Down
42 changes: 19 additions & 23 deletions osm-seed/templates/tiler-server/tiler-server-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ template "osm-seed.fullname" . }}-ingress-tiler-server
annotations:
kubernetes.io/ingress.class: nginx
cert-manager.io/cluster-issuer: letsencrypt-prod-issuer
nginx.ingress.kubernetes.io/proxy-body-size: 5m
name: {{ .Release.Name }}-ingress-tiler-server
annotations:
kubernetes.io/ingress.class: nginx
cert-manager.io/cluster-issuer: letsencrypt-prod-issuer
Expand All @@ -17,22 +13,22 @@ metadata:
spec:
ingressClassName: nginx
tls:
- hosts:
{{- if .Values.tilerServer.ingressDomain }}
- {{ .Values.tilerServer.ingressDomain }}
{{- else }}
- tiler.{{ .Values.domain }}
{{- end }}
secretName: {{ template "osm-seed.fullname" . }}-secret-tiler-server
- hosts:
{{- if .Values.tilerServer.ingressDomain }}
- {{ .Values.tilerServer.ingressDomain }}
{{- else }}
- tiler.{{ .Values.domain }}
{{- end }}
secretName: {{ .Release.Name }}-secret-tiler-server
rules:
- host: {{ if .Values.tilerServer.ingressDomain }}{{ .Values.tilerServer.ingressDomain }}{{ else }}tiler.{{ .Values.domain }}{{ end }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ template "osm-seed.fullname" . }}-tiler-server
port:
number: 80
{{- end }}
- host: {{ if .Values.tilerServer.ingressDomain }}{{ .Values.tilerServer.ingressDomain }}{{ else }}tiler.{{ .Values.domain }}{{ end }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ .Release.Name }}-tiler-server
port:
number: 80
{{- end }}
32 changes: 24 additions & 8 deletions osm-seed/templates/tiler-server/tiler-server-service.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{- if .Values.tilerServer.enabled -}}
{{- if .Values.tilerServer.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "osm-seed.fullname" . }}-tiler-server
name: {{ .Release.Name }}-tiler-server
labels:
app: {{ template "osm-seed.name" . }}
component: tiler-server-service
Expand All @@ -13,7 +13,7 @@ metadata:
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: {{ .Values.AWS_SSL_ARN }}
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: https
service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "600"
service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "600"
{{- end }}
{{- if eq .Values.serviceType "ClusterIP" }}
kubernetes.io/ingress.class: nginx
Expand All @@ -25,21 +25,37 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.serviceType }}
# If tilerServer.externalService.enabled = true, we use ExternalName; otherwise use user-defined serviceType
type: {{- if .Values.tilerServer.externalService.enabled }} ExternalName {{- else }} {{ .Values.serviceType }} {{- end }}

{{- if .Values.tilerServer.externalService.enabled }}
# external name service
externalName: "{{ .Values.tilerServer.externalService.ip }}"
ports:
- port: 80
protocol: TCP
name: http
targetPort: {{ .Values.tilerServer.externalService.port }}
- port: 443
protocol: TCP
name: https
targetPort: {{ .Values.tilerServer.externalService.port }}
{{- else }}
# normal (internal) service
ports:
- port: 80
targetPort: http
protocol: TCP
name: http
{{- if and (eq .Values.serviceType "LoadBalancer") .Values.AWS_SSL_ARN }}
{{- if and (eq .Values.serviceType "LoadBalancer") .Values.AWS_SSL_ARN }}
- port: 443
targetPort: http
protocol: TCP
name: https
{{- end }}

{{- end }}
selector:
app: {{ template "osm-seed.name" . }}
release: {{ .Release.Name }}
run: {{ .Release.Name }}-tiler-server
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.tilerServer.enabled -}}
{{- if and .Values.tilerServer.enabled (not .Values.tilerServer.externalService.enabled) }}
{{ if eq .Values.tilerServer.env.TILER_CACHE_TYPE "file" }}
apiVersion: apps/v1
kind: StatefulSet
Expand Down

0 comments on commit 051d9ed

Please sign in to comment.