From fc92125a036f88cfc3f8ae772dcb20dbc6f52458 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Sat, 25 Feb 2023 21:01:16 +0100 Subject: [PATCH] Create a namespace withing a chart --- chart/Chart.yaml | 2 +- chart/templates/namespace.yaml | 6 ++++++ chart/values.yaml | 4 ++++ kube/template.yaml | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 chart/templates/namespace.yaml diff --git a/chart/Chart.yaml b/chart/Chart.yaml index 2b8688a..c224182 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: badhouseplants-net description: A Helm chart for Kubernetes type: application -version: 0.3.6 +version: 0.3.7 appVersion: "1.16.0" diff --git a/chart/templates/namespace.yaml b/chart/templates/namespace.yaml new file mode 100644 index 0000000..b1bd790 --- /dev/null +++ b/chart/templates/namespace.yaml @@ -0,0 +1,6 @@ +{{- if .Values.istio.enabled -}} +apiVersion: v1 +kind: Namespace +metadata: + name: {{ .Values.namespace.name }} +{{- end }} \ No newline at end of file diff --git a/chart/values.yaml b/chart/values.yaml index 2317388..04ddab5 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -1,5 +1,9 @@ replicaCount: 1 +namespace: + enabled: true + name: badhouseplants-application + nginx: container: name: nginx diff --git a/kube/template.yaml b/kube/template.yaml index 93c1108..0b346f5 100644 --- a/kube/template.yaml +++ b/kube/template.yaml @@ -3,6 +3,7 @@ branch: $ARGO_APP_BRANCH chart_version: $ARGO_APP_CHART_VERSION value: | + namespace: badhouseplants-$ARGO_APP_BRANCH istio: hosts: - $ARGO_APP_HOSTNAME