From da7637287e7086f74b9953ff14d4badb68dfb520 Mon Sep 17 00:00:00 2001 From: zxlong Date: Tue, 28 Nov 2023 14:49:14 +0800 Subject: [PATCH 1/3] When the pod starts, add host aliases to the /etc/hosts file --- charts/trino/templates/_helpers.tpl | 14 ++++++++++++++ charts/trino/templates/deployment-coordinator.yaml | 3 +++ charts/trino/templates/deployment-worker.yaml | 3 +++ charts/trino/values.yaml | 11 +++++++++++ 4 files changed, 31 insertions(+) diff --git a/charts/trino/templates/_helpers.tpl b/charts/trino/templates/_helpers.tpl index ade06df1..4b4ce061 100644 --- a/charts/trino/templates/_helpers.tpl +++ b/charts/trino/templates/_helpers.tpl @@ -92,3 +92,17 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} + +{{/* +Create the hostaliases +*/}} +{{- define "trino.hostAliases" -}} +hostAliases: +{{- range .Values.hostaliases }} +- ip: {{ .ip }} + hostnames: + {{- range .hostnames }} + - {{ . }} + {{- end }} +{{- end }} +{{- end -}} \ No newline at end of file diff --git a/charts/trino/templates/deployment-coordinator.yaml b/charts/trino/templates/deployment-coordinator.yaml index a6ab9811..47f82b4d 100644 --- a/charts/trino/templates/deployment-coordinator.yaml +++ b/charts/trino/templates/deployment-coordinator.yaml @@ -34,6 +34,9 @@ spec: {{- tpl (toYaml .Values.commonLabels) . | nindent 8 }} {{- end }} spec: + {{- if .Values.hostAliases }} + {{- include "trino.hostAliases" . | nindent 6 }} + {{- end }} serviceAccountName: {{ include "trino.serviceAccountName" . }} {{- with .Values.securityContext }} securityContext: diff --git a/charts/trino/templates/deployment-worker.yaml b/charts/trino/templates/deployment-worker.yaml index 99a3281f..02bd8eaf 100644 --- a/charts/trino/templates/deployment-worker.yaml +++ b/charts/trino/templates/deployment-worker.yaml @@ -38,6 +38,9 @@ spec: {{- tpl (toYaml .Values.commonLabels) . | nindent 8 }} {{- end }} spec: + {{- if .Values.hostAliases }} + {{- include "trino.hostAliases" . | nindent 6 }} + {{- end }} serviceAccountName: {{ include "trino.serviceAccountName" . }} {{- with .Values.securityContext }} securityContext: diff --git a/charts/trino/values.yaml b/charts/trino/values.yaml index 2947e134..963e383c 100644 --- a/charts/trino/values.yaml +++ b/charts/trino/values.yaml @@ -174,6 +174,17 @@ secretMounts: [] # secretName: sample-secret # path: /secrets/sample.json +hostAliases: [] +# When the pod starts, add the following host aliases to the /etc/hosts file +# - ip: "127.0.0.1" +# hostnames: +# - "localhost" +# - "test-datanode-01" +# - ip: "127.0.0.1" +# hostnames: +# - "localhost" +# - "test-datanode-01" + coordinator: jvm: maxHeapSize: "8G" From 3c2be2b42c9a1abcc881a1ab7f95248bb74fe6ca Mon Sep 17 00:00:00 2001 From: zxlong Date: Tue, 28 Nov 2023 16:08:38 +0800 Subject: [PATCH 2/3] Update README.md for additional host aliases --- charts/trino/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/charts/trino/README.md b/charts/trino/README.md index 4f63c873..4440ab88 100644 --- a/charts/trino/README.md +++ b/charts/trino/README.md @@ -56,6 +56,7 @@ The following table lists the configurable parameters of the Trino chart and the | `serviceAccount.name` | | `""` | | `serviceAccount.annotations` | | `{}` | | `secretMounts` | | `[]` | +| `hostAliases` | Additional host aliases | `[]` | | `coordinator.jvm.maxHeapSize` | | `"8G"` | | `coordinator.jvm.gcMethod.type` | | `"UseG1GC"` | | `coordinator.jvm.gcMethod.g1.heapRegionSize` | | `"32M"` | From 38b9de69ae8950fd07ed9cb12a89c52d7a2772df Mon Sep 17 00:00:00 2001 From: zxlong Date: Thu, 7 Dec 2023 14:55:50 +0800 Subject: [PATCH 3/3] Update for `hostAliases` comment --- charts/trino/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/trino/values.yaml b/charts/trino/values.yaml index 963e383c..3b8c4665 100644 --- a/charts/trino/values.yaml +++ b/charts/trino/values.yaml @@ -174,7 +174,7 @@ secretMounts: [] # secretName: sample-secret # path: /secrets/sample.json -hostAliases: [] +hostAliases: [] # Additional host aliases # When the pod starts, add the following host aliases to the /etc/hosts file # - ip: "127.0.0.1" # hostnames: