Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[influxdb2] add namespace to resources #560

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/influxdb2/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]
Expand Down
7 changes: 7 additions & 0 deletions charts/influxdb2/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
1 change: 1 addition & 0 deletions charts/influxdb2/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions charts/influxdb2/templates/init-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions charts/influxdb2/templates/pdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions charts/influxdb2/templates/persistent-volume-claim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion charts/influxdb2/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }}
Expand Down
1 change: 1 addition & 0 deletions charts/influxdb2/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions charts/influxdb2/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
1 change: 1 addition & 0 deletions charts/influxdb2/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions charts/influxdb2/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
##
Expand Down