Skip to content

Commit 99162f1

Browse files
authored
Config enpoint for external IP in vtiles, for latest version of ingress-nginx (#365)
* Add enpoint config to use external ip for vtiles * Specify custom ports for the tiler service
1 parent caac6cf commit 99162f1

File tree

2 files changed

+36
-28
lines changed

2 files changed

+36
-28
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{- if and .Values.tilerServer.enabled .Values.tilerServer.externalService.enabled }}
2+
apiVersion: v1
3+
kind: Endpoints
4+
metadata:
5+
name: {{ .Release.Name }}-tiler-server
6+
namespace: {{ .Release.Namespace }}
7+
labels:
8+
app: {{ template "osm-seed.name" . }}
9+
component: tiler-server-service
10+
environment: {{ .Values.environment }}
11+
release: {{ .Release.Name }}
12+
subsets:
13+
- addresses:
14+
- ip: {{ .Values.tilerServer.externalService.ip }}
15+
ports:
16+
- name: http
17+
port: {{ .Values.tilerServer.externalService.port }}
18+
protocol: TCP
19+
{{- end }}

osm-seed/templates/tiler-server/tiler-server-service.yaml

Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,53 +9,42 @@ metadata:
99
environment: {{ .Values.environment }}
1010
release: {{ .Release.Name }}
1111
annotations:
12+
{{- if eq .Values.serviceType "ClusterIP" }}
13+
kubernetes.io/ingress.class: nginx
14+
cert-manager.io/cluster-issuer: letsencrypt-prod-issuer
15+
{{- end }}
1216
{{- if and (eq .Values.serviceType "LoadBalancer") .Values.AWS_SSL_ARN }}
1317
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: {{ .Values.AWS_SSL_ARN }}
1418
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http
1519
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: https
1620
service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "600"
1721
{{- end }}
18-
{{- if eq .Values.serviceType "ClusterIP" }}
19-
kubernetes.io/ingress.class: nginx
20-
cert-manager.io/cluster-issuer: letsencrypt-prod-issuer
21-
{{- else }}
22-
fake.annotation: fake
23-
{{- end }}
2422
{{- with .Values.tilerServer.serviceAnnotations }}
2523
{{- toYaml . | nindent 4 }}
2624
{{- end }}
2725
spec:
28-
# If tilerServer.externalService.enabled = true, we use ExternalName; otherwise use user-defined serviceType
29-
type: {{- if .Values.tilerServer.externalService.enabled }} ExternalName {{- else }} {{ .Values.serviceType }} {{- end }}
30-
31-
{{- if .Values.tilerServer.externalService.enabled }}
32-
# external name service
33-
externalName: "{{ .Values.tilerServer.externalService.ip }}"
26+
# This is a workaround for the issue with the external service
27+
{{- if and .Values.tilerServer.enabled .Values.tilerServer.externalService.enabled }}
3428
ports:
35-
- port: 80
36-
protocol: TCP
37-
name: http
38-
targetPort: {{ .Values.tilerServer.externalService.port }}
39-
- port: 443
29+
- name: http
30+
port: 80
31+
targetPort: {{ .Values.tilerServer.externalService.port | default "9090" }}
4032
protocol: TCP
41-
name: https
42-
targetPort: {{ .Values.tilerServer.externalService.port }}
4333
{{- else }}
44-
# normal (internal) service
34+
# This is the default service, atached to the deployment
35+
type: {{ default "ClusterIP" .Values.serviceType }}
4536
ports:
46-
- port: 80
47-
targetPort: http
37+
- name: http
38+
port: 80
4839
protocol: TCP
49-
name: http
50-
{{- if and (eq .Values.serviceType "LoadBalancer") .Values.AWS_SSL_ARN }}
51-
- port: 443
5240
targetPort: http
41+
- name: https
42+
port: 443
5343
protocol: TCP
54-
name: https
55-
{{- end }}
44+
targetPort: http
5645
selector:
5746
app: {{ template "osm-seed.name" . }}
5847
release: {{ .Release.Name }}
59-
run: {{ .Release.Name }}-tiler-server
48+
run: {{ .Release.Name }}-tiler-server # This is working for deployment and not for statefulset , make sure you use "s3" to storage the vtiles
6049
{{- end }}
6150
{{- end }}

0 commit comments

Comments
 (0)