Skip to content

Commit 1d8c734

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

File tree

5 files changed

+33
-7
lines changed

5 files changed

+33
-7
lines changed

charts/trino/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,7 @@ Fast distributed SQL query engine for big data analytics that helps you explore
629629
path: /secrets/sample.json
630630
subPath: sample.json
631631
```
632+
* `coordinator.service` - object, default: `{}`
632633
* `worker.deployment.annotations` - object, default: `{}`
633634
* `worker.deployment.progressDeadlineSeconds` - int, default: `600`
634635

@@ -795,6 +796,7 @@ Fast distributed SQL query engine for big data analytics that helps you explore
795796
path: /secrets/sample.json
796797
subPath: sample.json
797798
```
799+
* `worker.service` - object, default: `{}`
798800
* `kafka.mountPath` - string, default: `"/etc/trino/schemas"`
799801
* `kafka.tableDescriptions` - object, default: `{}`
800802

charts/trino/templates/service-coordinator.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- $svc := .Values.coordinator.service | default .Values.service }}
12
{{- $coordinatorJmx := merge .Values.jmx.coordinator (omit .Values.jmx "coordinator" "worker") -}}
23
apiVersion: v1
34
kind: Service
@@ -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.worker.service | default .Values.service }}
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
@@ -734,6 +734,15 @@ coordinator:
734734
# subPath: sample.json
735735
# ```
736736

737+
service: {}
738+
# annotations: {}
739+
# type: ClusterIP
740+
# port: 8080
741+
# # service.nodePort -- The port the service listens on the host, for the `NodePort` type. If not set, Kubernetes will
742+
# # [allocate a port
743+
# # automatically](https://kubernetes.io/docs/concepts/services-networking/service/#nodeport-custom-port).
744+
# nodePort: ""
745+
737746
worker:
738747
deployment:
739748
annotations: {}
@@ -961,6 +970,15 @@ worker:
961970
# subPath: sample.json
962971
# ```
963972

973+
service: {}
974+
# annotations: {}
975+
# type: ClusterIP
976+
# port: 8080
977+
# # service.nodePort -- The port the service listens on the host, for the `NodePort` type. If not set, Kubernetes will
978+
# # [allocate a port
979+
# # automatically](https://kubernetes.io/docs/concepts/services-networking/service/#nodeport-custom-port).
980+
# nodePort: ""
981+
964982
kafka:
965983
mountPath: "/etc/trino/schemas"
966984
tableDescriptions: {}

tests/trino/test-values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ coordinator:
7878
rollingUpdate:
7979
maxSurge: 25%
8080
maxUnavailable: 50%
81+
service:
82+
annotations:
83+
custom/name: coordinator
84+
port: 8080
8185

8286
jvm:
8387
maxHeapSize: "8G"

0 commit comments

Comments
 (0)