Skip to content

Commit e033dcd

Browse files
committed
Enabled overrides for worker and coordinator configmap resources
1 parent 0022d68 commit e033dcd

File tree

8 files changed

+39
-12
lines changed

8 files changed

+39
-12
lines changed

.github/workflows/ci-cd.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@ jobs:
3737
include:
3838
- { label: default, args: '' }
3939
# last Trino version that requires JDK 21
40-
- { label: 446, args: '--set image.tag=446' }
40+
- { label: 446, args: '-a "--set image.tag=446"' }
4141
# last Trino version that requires JDK 17
42-
- { label: 435, args: '--set image.tag=435' }
42+
- { label: 435, args: '-a "--set image.tag=435"' }
43+
# skip cleanup to test deploying multiple releases in a single namespace
44+
- { label: overrides, args: '-s -t default,overrides' }
4345
steps:
4446
- uses: actions/checkout@v4
4547
- name: Set up Helm
@@ -51,7 +53,7 @@ jobs:
5153
- name: Create kind cluster
5254
uses: helm/[email protected]
5355
- name: Run tests
54-
run: ./test.sh -a "${{ matrix.args }}"
56+
run: ./test.sh ${{ matrix.args }}
5557

5658
docs:
5759
runs-on: ubuntu-latest

charts/trino/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ Fast distributed SQL query engine for big data analytics that helps you explore
1212
* <https://github.com/trinodb/trino/tree/master/core/docker>
1313

1414
## Values
15+
* `nameOverride` - string, default: `nil`
16+
17+
Override resource names to avoid name conflicts when deploying multiple releases in the same namespace.
18+
Example:
19+
```yaml
20+
coordinatorNameOverride: trino-coordinator-adhoc
21+
workerNameOverride: trino-worker-adhoc
22+
nameOverride: trino-adhoc
23+
```
24+
* `coordinatorNameOverride` - string, default: `nil`
25+
* `workerNameOverride` - string, default: `nil`
1526
* `image.registry` - string, default: `""`
1627

1728
Image registry, defaults to empty, which results in DockerHub usage

charts/trino/templates/configmap-coordinator.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ data:
127127
apiVersion: v1
128128
kind: ConfigMap
129129
metadata:
130-
name: trino-access-control-volume-coordinator
130+
name: {{ template "trino.fullname" . }}-access-control-volume-coordinator
131131
namespace: {{ .Release.Namespace }}
132132
labels:
133133
{{- include "trino.labels" . | nindent 4 }}
@@ -142,7 +142,7 @@ data:
142142
apiVersion: v1
143143
kind: ConfigMap
144144
metadata:
145-
name: trino-resource-groups-volume-coordinator
145+
name: {{ template "trino.fullname" . }}-resource-groups-volume-coordinator
146146
namespace: {{ .Release.Namespace }}
147147
labels:
148148
{{- include "trino.labels" . | nindent 4 }}
@@ -155,7 +155,7 @@ data:
155155
apiVersion: v1
156156
kind: ConfigMap
157157
metadata:
158-
name: schemas-volume-coordinator
158+
name: {{ template "trino.fullname" . }}-schemas-volume-coordinator
159159
namespace: {{ .Release.Namespace }}
160160
labels:
161161
{{- include "trino.labels" . | nindent 4 }}

charts/trino/templates/configmap-worker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ data:
8383
apiVersion: v1
8484
kind: ConfigMap
8585
metadata:
86-
name: schemas-volume-worker
86+
name: {{ template "trino.fullname" . }}-schemas-volume-worker
8787
namespace: {{ .Release.Namespace }}
8888
labels:
8989
{{- include "trino.labels" . | nindent 4 }}

charts/trino/templates/deployment-coordinator.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ spec:
4848
name: {{ template "trino.catalog" . }}
4949
- name: schemas-volume
5050
configMap:
51-
name: schemas-volume-coordinator
51+
name: {{ template "trino.fullname" . }}-schemas-volume-coordinator
5252
{{- if .Values.accessControl }}{{- if eq .Values.accessControl.type "configmap" }}
5353
- name: access-control-volume
5454
configMap:
55-
name: trino-access-control-volume-coordinator
55+
name: {{ template "trino.fullname" . }}-access-control-volume-coordinator
5656
{{- end }}{{- end }}
5757
{{- if .Values.resourceGroups }}
5858
- name: resource-groups-volume
5959
configMap:
60-
name: trino-resource-groups-volume-coordinator
60+
name: {{ template "trino.fullname" . }}-resource-groups-volume-coordinator
6161
{{- end }}
6262
{{- if or .Values.auth.passwordAuth .Values.auth.passwordAuthSecret .Values.auth.groups }}
6363
- name: file-authentication-volume

charts/trino/templates/deployment-worker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ spec:
5050
name: {{ template "trino.catalog" . }}
5151
- name: schemas-volume
5252
configMap:
53-
name: schemas-volume-worker
53+
name: {{ template "trino.fullname" . }}-schemas-volume-worker
5454
{{- range .Values.configMounts }}
5555
- name: {{ .name }}
5656
configMap:

charts/trino/values.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22
# This is a YAML-formatted file.
33
# Declare variables to be passed into your templates.
44

5+
# -- Override resource names to avoid name conflicts when deploying multiple
6+
# releases in the same namespace.
7+
# @raw
8+
# Example:
9+
# ```yaml
10+
# coordinatorNameOverride: trino-coordinator-adhoc
11+
# workerNameOverride: trino-worker-adhoc
12+
# nameOverride: trino-adhoc
13+
# ```
14+
nameOverride:
15+
coordinatorNameOverride:
16+
workerNameOverride:
17+
518
image:
619
# -- Image registry, defaults to empty, which results in DockerHub usage
720
registry: ""

test.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ declare -A testCases=(
66
[default]=""
77
[single_node]="--set server.workers=0"
88
[complete_values]="--values test-values.yaml"
9+
[overrides]="--set coordinatorNameOverride=coordinator-overridden,workerNameOverride=worker-overridden,nameOverride=overridden"
910
)
1011

1112
function join_by {
@@ -20,7 +21,7 @@ NAMESPACE=trino-$(LC_ALL=C tr -dc 'a-z0-9' </dev/urandom | head -c 6 || true)
2021
HELM_EXTRA_SET_ARGS=
2122
CT_ARGS=(--charts=charts/trino --skip-clean-up)
2223
CLEANUP_NAMESPACE=true
23-
TEST_NAMES=("${!testCases[@]}")
24+
TEST_NAMES=(default single_node complete_values)
2425

2526
usage() {
2627
cat <<EOF 1>&2

0 commit comments

Comments
 (0)