diff --git a/charts/influxdb2/Chart.yaml b/charts/influxdb2/Chart.yaml index 5f2d876c..18cc7e74 100644 --- a/charts/influxdb2/Chart.yaml +++ b/charts/influxdb2/Chart.yaml @@ -4,7 +4,7 @@ name: influxdb2 description: A Helm chart for InfluxDB v2 home: https://www.influxdata.com/products/influxdb/ type: application -version: 2.1.1 +version: 2.1.2 maintainers: - name: rawkode email: rawkode@influxdata.com diff --git a/charts/influxdb2/templates/_helpers.tpl b/charts/influxdb2/templates/_helpers.tpl index aa82dac2..0a7d4e01 100644 --- a/charts/influxdb2/templates/_helpers.tpl +++ b/charts/influxdb2/templates/_helpers.tpl @@ -62,3 +62,10 @@ Create the name of the service account to use {{ default "default" .Values.serviceAccount.name }} {{- end -}} {{- end -}} + +{{/* +Create the name of the namespace +*/}} +{{- define "influxdb.namespaceName" -}} +{{- default .Release.Namespace .Values.namespace }} +{{- end }} diff --git a/charts/influxdb2/templates/ingress.yaml b/charts/influxdb2/templates/ingress.yaml index c5bbcd43..92b3da13 100644 --- a/charts/influxdb2/templates/ingress.yaml +++ b/charts/influxdb2/templates/ingress.yaml @@ -7,6 +7,7 @@ apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: {{ include "influxdb.fullname" . }} + namespace: {{ include "influxdb.namespaceName" . }} labels: {{- include "influxdb.labels" . | nindent 4 }} annotations: diff --git a/charts/influxdb2/templates/init-config.yaml b/charts/influxdb2/templates/init-config.yaml index 5f608985..01a6c69d 100644 --- a/charts/influxdb2/templates/init-config.yaml +++ b/charts/influxdb2/templates/init-config.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ include "influxdb.fullname" . }}-init + namespace: {{ include "influxdb.namespaceName" . }} labels: {{- include "influxdb.labels" . | nindent 4 }} data: diff --git a/charts/influxdb2/templates/pdb.yaml b/charts/influxdb2/templates/pdb.yaml index 32ff0dad..e0079337 100644 --- a/charts/influxdb2/templates/pdb.yaml +++ b/charts/influxdb2/templates/pdb.yaml @@ -7,6 +7,7 @@ apiVersion: policy/v1beta1 kind: PodDisruptionBudget metadata: name: {{ template "influxdb.fullname" . }} + namespace: {{ include "influxdb.namespaceName" . }} labels: {{- include "influxdb.labels" . | nindent 4 }} spec: diff --git a/charts/influxdb2/templates/persistent-volume-claim.yaml b/charts/influxdb2/templates/persistent-volume-claim.yaml index e1cb54d1..7cf53765 100644 --- a/charts/influxdb2/templates/persistent-volume-claim.yaml +++ b/charts/influxdb2/templates/persistent-volume-claim.yaml @@ -3,6 +3,7 @@ kind: PersistentVolumeClaim apiVersion: v1 metadata: name: "{{- if not (empty .Values.persistence.name) }}{{ .Values.persistence.name }}{{- else }}{{ template "influxdb.fullname" . }}{{- end }}" + namespace: {{ include "influxdb.namespaceName" . }} labels: {{- include "influxdb.labels" . | nindent 4 }} annotations: diff --git a/charts/influxdb2/templates/secret.yaml b/charts/influxdb2/templates/secret.yaml index a45fd062..b17f6362 100644 --- a/charts/influxdb2/templates/secret.yaml +++ b/charts/influxdb2/templates/secret.yaml @@ -6,8 +6,9 @@ metadata: {{- include "influxdb.labels" . | nindent 4 }} {{- $name := printf "%s-auth" (include "influxdb.fullname" .) }} name: {{ $name }} + namespace: {{ include "influxdb.namespaceName" . }} data: - {{- $previous := lookup "v1" "Secret" .Release.Namespace $name }} + {{- $previous := lookup "v1" "Secret" (include "influxdb.namespaceName" .) $name }} {{- if $previous }} admin-token: {{ index $previous.data "admin-token" }} diff --git a/charts/influxdb2/templates/service.yaml b/charts/influxdb2/templates/service.yaml index daada35a..c74fab23 100644 --- a/charts/influxdb2/templates/service.yaml +++ b/charts/influxdb2/templates/service.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: Service metadata: name: {{ template "influxdb.fullname" . }} + namespace: {{ include "influxdb.namespaceName" . }} labels: {{- include "influxdb.labels" . | nindent 4 }} {{- with .Values.service.annotations }} annotations: diff --git a/charts/influxdb2/templates/serviceaccount.yaml b/charts/influxdb2/templates/serviceaccount.yaml index c4966965..cb5999ee 100644 --- a/charts/influxdb2/templates/serviceaccount.yaml +++ b/charts/influxdb2/templates/serviceaccount.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "influxdb.serviceAccountName" . }} + namespace: {{ include "influxdb.namespaceName" . }} labels: {{- include "influxdb.labels" . | nindent 4 }} {{- with .Values.serviceAccount.annotations }} diff --git a/charts/influxdb2/templates/statefulset.yaml b/charts/influxdb2/templates/statefulset.yaml index a18d7a20..7b5b7477 100644 --- a/charts/influxdb2/templates/statefulset.yaml +++ b/charts/influxdb2/templates/statefulset.yaml @@ -2,6 +2,7 @@ apiVersion: apps/v1 kind: StatefulSet metadata: name: {{ template "influxdb.fullname" . }} + namespace: {{ include "influxdb.namespaceName" . }} labels: {{- include "influxdb.labels" . | nindent 4 }} spec: diff --git a/charts/influxdb2/values.yaml b/charts/influxdb2/values.yaml index 1fb111f4..7780736b 100644 --- a/charts/influxdb2/values.yaml +++ b/charts/influxdb2/values.yaml @@ -17,6 +17,10 @@ podLabels: {} nameOverride: "" fullnameOverride: "" +# The name of the Namespace to deploy +# If not set, `.Release.Namespace` is used +namespace: null + ## Configure resource requests and limits ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ ##