Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When the pod starts, add host aliases to the /etc/hosts file #110

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions charts/trino/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"` |
Expand Down
14 changes: 14 additions & 0 deletions charts/trino/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
3 changes: 3 additions & 0 deletions charts/trino/templates/deployment-coordinator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions charts/trino/templates/deployment-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 11 additions & 0 deletions charts/trino/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,17 @@ secretMounts: []
# secretName: sample-secret
# path: /secrets/sample.json

hostAliases: [] # Additional host aliases
# 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"
Expand Down