From e839e4998b5bac67b96881c7d1c8a01179f03b96 Mon Sep 17 00:00:00 2001 From: Manfred Moser Date: Mon, 14 Aug 2023 10:50:32 -0700 Subject: [PATCH] Add ingress for Trino coordinator Co-authored-by: Yixing Yan --- charts/trino/README.md | 5 ++++ charts/trino/templates/ingress.yaml | 41 +++++++++++++++++++++++++++++ charts/trino/values.yaml | 14 +++++++++- 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 charts/trino/templates/ingress.yaml diff --git a/charts/trino/README.md b/charts/trino/README.md index 0f278b3f..e8770bc7 100644 --- a/charts/trino/README.md +++ b/charts/trino/README.md @@ -88,6 +88,11 @@ The following table lists the configurable parameters of the Trino chart and the | `kafka.mountPath` | | `"/etc/trino/schemas"` | | `kafka.tableDescriptions` | | `{}` | | `commonLabels` | Labels that get applied to every resource's metadata | `{}` | +| `ingress.enabled` | | `false` | +| `ingress.className` | | `""` | +| `ingress.annotations` | | `{}` | +| `ingress.hosts` | | `[]` | +| `ingress.tls` | | `[]` | diff --git a/charts/trino/templates/ingress.yaml b/charts/trino/templates/ingress.yaml new file mode 100644 index 00000000..7869ab0b --- /dev/null +++ b/charts/trino/templates/ingress.yaml @@ -0,0 +1,41 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "trino.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ template "trino.coordinator" . }} + labels: + {{- include "trino.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + ingressClassName: {{ .Values.ingress.className }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .Values.ingress.tls.secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + pathType: {{ .pathType }} + backend: + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/trino/values.yaml b/charts/trino/values.yaml index 875dab8e..b8913d76 100644 --- a/charts/trino/values.yaml +++ b/charts/trino/values.yaml @@ -295,5 +295,17 @@ kafka: # ] # } # } - commonLabels: {} # Labels that get applied to every resource's metadata +ingress: + enabled: false + className: "" + annotations: {} + hosts: [] + # - host: trino.example.com + # paths: + # - path: / + # pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local