From 6cf79d36874a7baf2bb3849ec4db2504387c7a98 Mon Sep 17 00:00:00 2001 From: Alberto Clemente Date: Fri, 24 Mar 2023 19:29:19 +0100 Subject: [PATCH] Added "overrideNamespace" --- helm/mysql-innodbcluster/templates/cluster_secret.yaml | 2 +- helm/mysql-innodbcluster/templates/deployment_cluster.yaml | 2 +- helm/mysql-innodbcluster/templates/service_account_cluster.yaml | 2 +- helm/mysql-innodbcluster/values.yaml | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/helm/mysql-innodbcluster/templates/cluster_secret.yaml b/helm/mysql-innodbcluster/templates/cluster_secret.yaml index ab6c97b..c4f8a11 100644 --- a/helm/mysql-innodbcluster/templates/cluster_secret.yaml +++ b/helm/mysql-innodbcluster/templates/cluster_secret.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: Secret metadata: name: {{ $cluster_name }}-cluster-secret - namespace: {{ .Release.Namespace }} + namespace: {{ coalesce .Values.overrideNamespace .Release.Namespace }} stringData: rootUser: {{ .Values.credentials.root.user | default "root" | quote }} rootHost: {{ .Values.credentials.root.host | default "%%" | quote }} diff --git a/helm/mysql-innodbcluster/templates/deployment_cluster.yaml b/helm/mysql-innodbcluster/templates/deployment_cluster.yaml index 19bd804..16e901e 100644 --- a/helm/mysql-innodbcluster/templates/deployment_cluster.yaml +++ b/helm/mysql-innodbcluster/templates/deployment_cluster.yaml @@ -32,7 +32,7 @@ apiVersion: mysql.oracle.com/v2 kind: InnoDBCluster metadata: name: {{ $cluster_name }} - namespace: {{ .Release.Namespace }} + namespace: {{ coalesce .Values.overrideNamespace .Release.Namespace }} spec: instances: {{ required "serverInstances is required" .Values.serverInstances }} tlsUseSelfSigned: {{ $use_self_signed }} diff --git a/helm/mysql-innodbcluster/templates/service_account_cluster.yaml b/helm/mysql-innodbcluster/templates/service_account_cluster.yaml index d02c44c..d83db00 100644 --- a/helm/mysql-innodbcluster/templates/service_account_cluster.yaml +++ b/helm/mysql-innodbcluster/templates/service_account_cluster.yaml @@ -1,6 +1,6 @@ {{- $disable_lookups:= .Values.disableLookups }} {{- $cluster_name := default "mycluster" .Release.Name }} -{{- $install_namespace := .Release.Namespace }} +{{- $install_namespace := coalesce .Values.overrideNamespace .Release.Namespace }} apiVersion: v1 kind: ServiceAccount metadata: diff --git a/helm/mysql-innodbcluster/values.yaml b/helm/mysql-innodbcluster/values.yaml index cb06280..89192ad 100644 --- a/helm/mysql-innodbcluster/values.yaml +++ b/helm/mysql-innodbcluster/values.yaml @@ -1,3 +1,5 @@ +overrideNamespace: null + image: pullPolicy: IfNotPresent pullSecrets: