Skip to content

Commit

Permalink
Enabled overrides for worker and coordinator configmap resources
Browse files Browse the repository at this point in the history
  • Loading branch information
nineinchnick committed May 31, 2024
1 parent 0022d68 commit e033dcd
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 12 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"' }
# skip cleanup to test deploying multiple releases in a single namespace
- { label: overrides, args: '-s -t default,overrides' }
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-coordinator-adhoc
workerNameOverride: trino-worker-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 @@ -127,7 +127,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 @@ -142,7 +142,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 @@ -155,7 +155,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 @@ -83,7 +83,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 @@ -48,16 +48,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 @@ -50,7 +50,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-coordinator-adhoc
# workerNameOverride: trino-worker-adhoc
# nameOverride: trino-adhoc
# ```
nameOverride:
coordinatorNameOverride:
workerNameOverride:

image:
# -- Image registry, defaults to empty, which results in DockerHub usage
registry: ""
Expand Down
3 changes: 2 additions & 1 deletion 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"
[overrides]="--set coordinatorNameOverride=coordinator-overridden,workerNameOverride=worker-overridden,nameOverride=overridden"
)

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

usage() {
cat <<EOF 1>&2
Expand Down

0 comments on commit e033dcd

Please sign in to comment.