From 5720e8384c7dfb30f473dfc35545fdc8fa6fec09 Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Wed, 20 Dec 2023 13:35:19 +0900 Subject: [PATCH] Support namespace specification This PR attempts to close #114 This would be the standard way to support namespace specification. --- README.md | 6 ++++++ charts/trino/templates/autoscaler.yaml | 1 + charts/trino/templates/configmap-catalog.yaml | 1 + charts/trino/templates/configmap-coordinator.yaml | 3 +++ charts/trino/templates/configmap-worker.yaml | 2 ++ charts/trino/templates/deployment-coordinator.yaml | 1 + charts/trino/templates/deployment-worker.yaml | 1 + charts/trino/templates/ingress.yaml | 1 + charts/trino/templates/secret.yaml | 1 + charts/trino/templates/service.yaml | 1 + charts/trino/templates/serviceaccount.yaml | 1 + 11 files changed, 19 insertions(+) diff --git a/README.md b/README.md index 2e1c80e3..e8fd30c5 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,12 @@ Then you can install chart using: helm install my-trino trino/trino --version 0.19.0 ``` +Also, you can check the manifests using: + +```console +helm template my-trino trino/trino --namespace +``` + ## Documentation You can find documentation about the chart [here](./charts/trino/README.md). diff --git a/charts/trino/templates/autoscaler.yaml b/charts/trino/templates/autoscaler.yaml index 7476b3ab..4d15275f 100644 --- a/charts/trino/templates/autoscaler.yaml +++ b/charts/trino/templates/autoscaler.yaml @@ -3,6 +3,7 @@ apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ template "trino.worker" . }} + namespace: {{ .Release.Namespace }} {{- if .Values.commonLabels }} labels: {{- tpl (toYaml .Values.commonLabels) . | nindent 4 }} diff --git a/charts/trino/templates/configmap-catalog.yaml b/charts/trino/templates/configmap-catalog.yaml index 9c1fea67..08d6cddf 100644 --- a/charts/trino/templates/configmap-catalog.yaml +++ b/charts/trino/templates/configmap-catalog.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ template "trino.catalog" . }} + namespace: {{ .Release.Namespace }} labels: app: {{ template "trino.name" . }} chart: {{ template "trino.chart" . }} diff --git a/charts/trino/templates/configmap-coordinator.yaml b/charts/trino/templates/configmap-coordinator.yaml index ba88283e..fd2fc0bb 100644 --- a/charts/trino/templates/configmap-coordinator.yaml +++ b/charts/trino/templates/configmap-coordinator.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ template "trino.coordinator" . }} + namespace: {{ .Release.Namespace }} labels: app: {{ template "trino.name" . }} chart: {{ template "trino.chart" . }} @@ -132,6 +133,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: trino-access-control-volume-coordinator + namespace: {{ .Release.Namespace }} labels: {{- include "trino.labels" . | nindent 4 }} app.kubernetes.io/component: coordinator @@ -162,6 +164,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: schemas-volume-coordinator + namespace: {{ .Release.Namespace }} labels: {{- include "trino.labels" . | nindent 4 }} app.kubernetes.io/component: coordinator diff --git a/charts/trino/templates/configmap-worker.yaml b/charts/trino/templates/configmap-worker.yaml index 03617a9b..6fae54db 100644 --- a/charts/trino/templates/configmap-worker.yaml +++ b/charts/trino/templates/configmap-worker.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ template "trino.worker" . }} + namespace: {{ .Release.Namespace }} labels: app: {{ template "trino.name" . }} chart: {{ template "trino.chart" . }} @@ -90,6 +91,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: schemas-volume-worker + namespace: {{ .Release.Namespace }} labels: {{- include "trino.labels" . | nindent 4 }} app.kubernetes.io/component: worker diff --git a/charts/trino/templates/deployment-coordinator.yaml b/charts/trino/templates/deployment-coordinator.yaml index 844be4e7..1574a399 100644 --- a/charts/trino/templates/deployment-coordinator.yaml +++ b/charts/trino/templates/deployment-coordinator.yaml @@ -2,6 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "trino.coordinator" . }} + namespace: {{ .Release.Namespace }} labels: app: {{ template "trino.name" . }} chart: {{ template "trino.chart" . }} diff --git a/charts/trino/templates/deployment-worker.yaml b/charts/trino/templates/deployment-worker.yaml index 5d9dd373..05c32221 100644 --- a/charts/trino/templates/deployment-worker.yaml +++ b/charts/trino/templates/deployment-worker.yaml @@ -3,6 +3,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "trino.worker" . }} + namespace: {{ .Release.Namespace }} labels: app: {{ template "trino.name" . }} chart: {{ template "trino.chart" . }} diff --git a/charts/trino/templates/ingress.yaml b/charts/trino/templates/ingress.yaml index b7849748..136259f9 100644 --- a/charts/trino/templates/ingress.yaml +++ b/charts/trino/templates/ingress.yaml @@ -5,6 +5,7 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ template "trino.coordinator" . }} + namespace: {{ .Release.Namespace }} labels: {{- include "trino.labels" . | nindent 4 }} {{- if .Values.commonLabels }} diff --git a/charts/trino/templates/secret.yaml b/charts/trino/templates/secret.yaml index 754353a5..445eabc0 100644 --- a/charts/trino/templates/secret.yaml +++ b/charts/trino/templates/secret.yaml @@ -7,6 +7,7 @@ metadata: {{- else }} name: trino-file-authentication {{- end }} + namespace: {{ .Release.Namespace }} labels: {{- include "trino.labels" . | nindent 4 }} data: diff --git a/charts/trino/templates/service.yaml b/charts/trino/templates/service.yaml index cfb0b2f3..8e10a842 100644 --- a/charts/trino/templates/service.yaml +++ b/charts/trino/templates/service.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: Service metadata: name: {{ template "trino.fullname" . }} + namespace: {{ .Release.Namespace }} labels: app: {{ template "trino.name" . }} chart: {{ template "trino.chart" . }} diff --git a/charts/trino/templates/serviceaccount.yaml b/charts/trino/templates/serviceaccount.yaml index 29dfdcc2..a61c0724 100644 --- a/charts/trino/templates/serviceaccount.yaml +++ b/charts/trino/templates/serviceaccount.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "trino.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} labels: {{- include "trino.labels" . | nindent 4 }} {{- with .Values.serviceAccount.annotations }}