Skip to content

Commit

Permalink
Enabled overrides for worker and coordinator configmap resources
Browse files Browse the repository at this point in the history
Co-authored-by: Jan Waś <jan@was.net.pl>
  • Loading branch information
silent-lad and nineinchnick committed May 30, 2024
1 parent 3932c8f commit e01ce69
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 13 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ jobs:
include:
- { label: default, args: '' }
# last Trino version that requires JDK 21
- { label: 446, args: '--set image.tag=446' }
- { label: 446, args: '-a --set image.tag=446' }
# last Trino version that requires JDK 17
- { label: 435, args: '--set image.tag=435' }
- { label: 435, args: '-a --set image.tag=435' }
# multiple clusters in same namespace
- { label: multiple-clusters, args: '-t multiple_clusters' }
steps:
- uses: actions/checkout@v4
- name: Set up Helm
Expand All @@ -51,7 +53,7 @@ jobs:
- name: Create kind cluster
uses: helm/kind-action@v1.10.0
- name: Run tests
run: ./test.sh -a "${{ matrix.args }}"
run: ./test.sh ${{ matrix.args }}

docs:
runs-on: ubuntu-latest
Expand Down
11 changes: 11 additions & 0 deletions charts/trino/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ Fast distributed SQL query engine for big data analytics that helps you explore
* <https://github.com/trinodb/trino/tree/master/core/docker>

## Values
* `nameOverride` - string, default: `nil`

Override resource names to avoid name conflicts when deploying multiple releases in the same namespace.
Example:
```yaml
coordinatorNameOverride: trino-adhoc
workerNameOverride: trino-adhoc
nameOverride: trino-adhoc
```
* `coordinatorNameOverride` - string, default: `nil`
* `workerNameOverride` - string, default: `nil`
* `image.registry` - string, default: `""`

Image registry, defaults to empty, which results in DockerHub usage
Expand Down
6 changes: 3 additions & 3 deletions charts/trino/templates/configmap-coordinator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ data:
apiVersion: v1
kind: ConfigMap
metadata:
name: trino-access-control-volume-coordinator
name: {{ template "trino.fullname" . }}-access-control-volume-coordinator
namespace: {{ .Release.Namespace }}
labels:
{{- include "trino.labels" . | nindent 4 }}
Expand All @@ -148,7 +148,7 @@ data:
apiVersion: v1
kind: ConfigMap
metadata:
name: trino-resource-groups-volume-coordinator
name: {{ template "trino.fullname" . }}-resource-groups-volume-coordinator
namespace: {{ .Release.Namespace }}
labels:
{{- include "trino.labels" . | nindent 4 }}
Expand All @@ -161,7 +161,7 @@ data:
apiVersion: v1
kind: ConfigMap
metadata:
name: schemas-volume-coordinator
name: {{ template "trino.fullname" . }}-schemas-volume-coordinator
namespace: {{ .Release.Namespace }}
labels:
{{- include "trino.labels" . | nindent 4 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/trino/templates/configmap-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ data:
apiVersion: v1
kind: ConfigMap
metadata:
name: schemas-volume-worker
name: {{ template "trino.fullname" . }}-schemas-volume-worker
namespace: {{ .Release.Namespace }}
labels:
{{- include "trino.labels" . | nindent 4 }}
Expand Down
6 changes: 3 additions & 3 deletions charts/trino/templates/deployment-coordinator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ spec:
name: {{ template "trino.catalog" . }}
- name: schemas-volume
configMap:
name: schemas-volume-coordinator
name: {{ template "trino.fullname" . }}-schemas-volume-coordinator
{{- if .Values.accessControl }}{{- if eq .Values.accessControl.type "configmap" }}
- name: access-control-volume
configMap:
name: trino-access-control-volume-coordinator
name: {{ template "trino.fullname" . }}-access-control-volume-coordinator
{{- end }}{{- end }}
{{- if .Values.resourceGroups }}
- name: resource-groups-volume
configMap:
name: trino-resource-groups-volume-coordinator
name: {{ template "trino.fullname" . }}-resource-groups-volume-coordinator
{{- end }}
{{- if or .Values.auth.passwordAuth .Values.auth.passwordAuthSecret .Values.auth.groups }}
- name: file-authentication-volume
Expand Down
2 changes: 1 addition & 1 deletion charts/trino/templates/deployment-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ spec:
name: {{ template "trino.catalog" . }}
- name: schemas-volume
configMap:
name: schemas-volume-worker
name: {{ template "trino.fullname" . }}-schemas-volume-worker
{{- range .Values.configMounts }}
- name: {{ .name }}
configMap:
Expand Down
13 changes: 13 additions & 0 deletions charts/trino/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

# -- Override resource names to avoid name conflicts when deploying multiple
# releases in the same namespace.
# @raw
# Example:
# ```yaml
# coordinatorNameOverride: trino-adhoc
# workerNameOverride: trino-adhoc
# nameOverride: trino-adhoc
# ```
nameOverride:
coordinatorNameOverride:
workerNameOverride:

image:
# -- Image registry, defaults to empty, which results in DockerHub usage
registry: ""
Expand Down
11 changes: 9 additions & 2 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ declare -A testCases=(
[default]=""
[single_node]="--set server.workers=0"
[complete_values]="--values test-values.yaml"
[multiple_clusters]="--set coordinatorNameOverride=overriden,workerNameOverride=overriden,nameOverride=overriden"
)

function join_by {
Expand Down Expand Up @@ -79,8 +80,14 @@ CT_ARGS+=(--namespace "$NAMESPACE")
for test_name in "${TEST_NAMES[@]}"; do
echo ""
echo "🧪 Running test $test_name"
echo ""
time ct install "${CT_ARGS[@]}" --helm-extra-set-args "$HELM_EXTRA_SET_ARGS ${testCases[$test_name]}"
echo "${testCases[$test_name]}"
if [ "$test_name" == "multiple_clusters" ]; then
time ct install "${CT_ARGS[@]}" --helm-extra-set-args "$HELM_EXTRA_SET_ARGS ${testCases[default]}" --skip-clean-up
time ct install "${CT_ARGS[@]}" --helm-extra-set-args "$HELM_EXTRA_SET_ARGS ${testCases[$test_name]}"
else
time ct install "${CT_ARGS[@]}" --helm-extra-set-args "$HELM_EXTRA_SET_ARGS ${testCases[$test_name]}"
fi

echo "Test $test_name completed"
done

Expand Down

0 comments on commit e01ce69

Please sign in to comment.