Skip to content

Config enpoint for external IP in vtiles, for latest version of ingress-nginx #365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions osm-seed/templates/tiler-server/tiler-server-endpoint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if and .Values.tilerServer.enabled .Values.tilerServer.externalService.enabled }}
apiVersion: v1
kind: Endpoints
metadata:
name: {{ .Release.Name }}-tiler-server
namespace: {{ .Release.Namespace }}
labels:
app: {{ template "osm-seed.name" . }}
component: tiler-server-service
environment: {{ .Values.environment }}
release: {{ .Release.Name }}
subsets:
- addresses:
- ip: {{ .Values.tilerServer.externalService.ip }}
ports:
- name: http
port: {{ .Values.tilerServer.externalService.port }}
protocol: TCP
{{- end }}
45 changes: 17 additions & 28 deletions osm-seed/templates/tiler-server/tiler-server-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,53 +9,42 @@ metadata:
environment: {{ .Values.environment }}
release: {{ .Release.Name }}
annotations:
{{- if eq .Values.serviceType "ClusterIP" }}
kubernetes.io/ingress.class: nginx
cert-manager.io/cluster-issuer: letsencrypt-prod-issuer
{{- end }}
{{- if and (eq .Values.serviceType "LoadBalancer") .Values.AWS_SSL_ARN }}
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"
{{- end }}
{{- if eq .Values.serviceType "ClusterIP" }}
kubernetes.io/ingress.class: nginx
cert-manager.io/cluster-issuer: letsencrypt-prod-issuer
{{- else }}
fake.annotation: fake
{{- end }}
{{- with .Values.tilerServer.serviceAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
# 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 }}"
# This is a workaround for the issue with the external service
{{- if and .Values.tilerServer.enabled .Values.tilerServer.externalService.enabled }}
ports:
- port: 80
protocol: TCP
name: http
targetPort: {{ .Values.tilerServer.externalService.port }}
- port: 443
- name: http
port: 80
targetPort: {{ .Values.tilerServer.externalService.port | default "9090" }}
protocol: TCP
name: https
targetPort: {{ .Values.tilerServer.externalService.port }}
{{- else }}
# normal (internal) service
# This is the default service, atached to the deployment
type: {{ default "ClusterIP" .Values.serviceType }}
ports:
- port: 80
targetPort: http
- name: http
port: 80
protocol: TCP
name: http
{{- if and (eq .Values.serviceType "LoadBalancer") .Values.AWS_SSL_ARN }}
- port: 443
targetPort: http
- name: https
port: 443
protocol: TCP
name: https
{{- end }}
targetPort: http
selector:
app: {{ template "osm-seed.name" . }}
release: {{ .Release.Name }}
run: {{ .Release.Name }}-tiler-server
run: {{ .Release.Name }}-tiler-server # This is working for deployment and not for statefulset , make sure you use "s3" to storage the vtiles
{{- end }}
{{- end }}
Loading