Skip to content

Commit 4daec72

Browse files
committed
Enable templating of environment name
1 parent 0dcf72e commit 4daec72

File tree

5 files changed

+16
-3
lines changed

5 files changed

+16
-3
lines changed

charts/trino/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ Fast distributed SQL query engine for big data analytics that helps you explore
4848
- name: registry-credentials
4949
```
5050
* `server.workers` - int, default: `2`
51-
* `server.node.environment` - string, default: `"production"`
51+
* `server.node.environment` - string, default: `"production"`
52+
53+
[node property configuration](https://trino.io/docs/current/installation/deployment.html#node-properties) The name of the environment. All Trino nodes in a cluster must have the same environment name. The name must start with a lowercase alphanumeric character and only contain lowercase alphanumeric or underscore (_) characters. Supports templating the files' contents with `tpl`.
5254
* `server.node.dataDir` - string, default: `"/data/trino"`
5355
* `server.node.pluginDir` - string, default: `"/usr/lib/trino/plugin"`
5456
* `server.log.trino.level` - string, default: `"INFO"`

charts/trino/templates/_helpers.tpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,10 @@ Create the secret name for the group-provider file
155155
{{- end }}
156156
{{- end }}
157157
{{- end }}
158+
159+
{{/*
160+
Return the environment name
161+
*/}}
162+
{{- define "trino.environment" -}}
163+
{{- tpl .Values.server.node.environment . }}
164+
{{- end }}

charts/trino/templates/configmap-coordinator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ metadata:
99
app.kubernetes.io/component: coordinator
1010
data:
1111
node.properties: |
12-
node.environment={{ .Values.server.node.environment }}
12+
node.environment={{ template "trino.environment" . }}
1313
node.data-dir={{ .Values.server.node.dataDir }}
1414
plugin.dir={{ .Values.server.node.pluginDir }}
1515
{{- range $configValue := .Values.additionalNodeProperties }}

charts/trino/templates/configmap-worker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ metadata:
1010
app.kubernetes.io/component: worker
1111
data:
1212
node.properties: |
13-
node.environment={{ .Values.server.node.environment }}
13+
node.environment={{ template "trino.environment" . }}
1414
node.data-dir={{ .Values.server.node.dataDir }}
1515
plugin.dir={{ .Values.server.node.pluginDir }}
1616
{{- range $configValue := .Values.additionalNodeProperties }}

charts/trino/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ imagePullSecrets: []
4040
server:
4141
workers: 2
4242
node:
43+
# server.node.environment -- [node property configuration](https://trino.io/docs/current/installation/deployment.html#node-properties)
44+
# The name of the environment. All Trino nodes in a cluster must have the same environment name. The name must
45+
# start with a lowercase alphanumeric character and only contain lowercase alphanumeric or underscore (_) characters.
46+
# Supports templating the files' contents with `tpl`.
4347
environment: production
4448
dataDir: /data/trino
4549
pluginDir: /usr/lib/trino/plugin

0 commit comments

Comments
 (0)