Skip to content

Commit de9293c

Browse files
committed
service: seperate coordinator and worker service
Signed-off-by: Parsa Yousefi <[email protected]>
1 parent 2856eba commit de9293c

File tree

4 files changed

+32
-7
lines changed

4 files changed

+32
-7
lines changed

charts/trino/templates/service-coordinator.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{{- $coordinatorJmx := merge .Values.jmx.coordinator (omit .Values.jmx "coordinator" "worker") -}}
2+
{{- $svc := .Values.service | default .Values.serviceCoordinator }}
23
apiVersion: v1
34
kind: Service
45
metadata:
@@ -8,16 +9,16 @@ metadata:
89
{{- include "trino.labels" . | nindent 4 }}
910
app.kubernetes.io/component: coordinator
1011
annotations:
11-
{{- toYaml .Values.service.annotations | nindent 4 }}
12+
{{- toYaml $svc.annotations | nindent 4 }}
1213
spec:
13-
type: {{ .Values.service.type }}
14+
type: {{ $svc.type }}
1415
ports:
15-
- port: {{ .Values.service.port }}
16+
- port: {{ $svc.port }}
1617
targetPort: http
1718
protocol: TCP
1819
name: http
19-
{{- if .Values.service.nodePort }}
20-
nodePort: {{ .Values.service.nodePort }}
20+
{{- if $svc.nodePort }}
21+
nodePort: {{ $svc.nodePort }}
2122
{{- end }}
2223
{{- if .Values.server.config.https.enabled }}
2324
- port: {{ .Values.server.config.https.port }}

charts/trino/templates/service-worker.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- $svc := .Values.service | default .Values.serviceWorker }}
12
{{- $workerJmx := merge .Values.jmx.worker (omit .Values.jmx "coordinator" "worker") -}}
23
apiVersion: v1
34
kind: Service
@@ -8,11 +9,11 @@ metadata:
89
{{- include "trino.labels" . | nindent 4 }}
910
app.kubernetes.io/component: worker
1011
annotations:
11-
{{- toYaml .Values.service.annotations | nindent 4 }}
12+
{{- toYaml $svc.annotations | nindent 4 }}
1213
spec:
1314
clusterIP: None
1415
ports:
15-
- port: {{ .Values.service.port }}
16+
- port: {{ $svc.port }}
1617
targetPort: http
1718
protocol: TCP
1819
name: http

charts/trino/values.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,24 @@ shareProcessNamespace:
486486
coordinator: false
487487
worker: false
488488

489+
# serviceCoordinator:
490+
# annotations: {}
491+
# type: ClusterIP
492+
# port: 8080
493+
# # service.nodePort -- The port the service listens on the host, for the `NodePort` type. If not set, Kubernetes will
494+
# # [allocate a port
495+
# # automatically](https://kubernetes.io/docs/concepts/services-networking/service/#nodeport-custom-port).
496+
# nodePort: ""
497+
498+
# serviceWorker:
499+
# annotations: {}
500+
# type: ClusterIP
501+
# port: 8080
502+
# # service.nodePort -- The port the service listens on the host, for the `NodePort` type. If not set, Kubernetes will
503+
# # [allocate a port
504+
# # automatically](https://kubernetes.io/docs/concepts/services-networking/service/#nodeport-custom-port).
505+
# nodePort: ""
506+
489507
service:
490508
annotations: {}
491509
type: ClusterIP

tests/trino/test-values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ additionalConfigProperties:
4444
- http-server.authentication.allow-insecure-over-http=true
4545
- http-server.process-forwarded=true
4646

47+
serviceCoordinator:
48+
annotations:
49+
custom/worker: value
50+
port: 8080
51+
4752
service:
4853
annotations:
4954
custom/name: value

0 commit comments

Comments
 (0)