diff --git a/charts/graylog/templates/_helpers.tpl b/charts/graylog/templates/_helpers.tpl index 7467982..862f0af 100644 --- a/charts/graylog/templates/_helpers.tpl +++ b/charts/graylog/templates/_helpers.tpl @@ -53,11 +53,18 @@ app.kubernetes.io/name: {{ include "graylog.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} +{{/* +Init script ConfigMap name +*/}} +{{- define "graylog.cm.init.name" }} +{{- include "graylog.fullname" . | printf "%s-init-cm" }} +{{- end }} + {{/* Service account name */}} -{{- define "graylog.serviceAccountName" -}} -{{ $defaultName := "default" }} +{{- define "graylog.serviceAccountName" }} +{{- $defaultName := "default" }} {{- if .Values.serviceAccount.create }} {{- $defaultName = include "graylog.fullname" . | printf "%s-sa" }} {{- end }} @@ -67,8 +74,8 @@ Service account name {{/* MongoDB service account name */}} -{{- define "graylog.mongodb.serviceAccountName" -}} -{{ $defaultName := "default" }} +{{- define "graylog.mongodb.serviceAccountName" }} +{{- $defaultName := "default" }} {{- if .Values.mongodb.serviceAccount.create }} {{- $defaultName = include "graylog.fullname" . | printf "%s-mongo-sa" }} {{- end }} diff --git a/charts/graylog/templates/config/init-graylog.yaml b/charts/graylog/templates/config/init-graylog.yaml index f35e887..475fc91 100644 --- a/charts/graylog/templates/config/init-graylog.yaml +++ b/charts/graylog/templates/config/init-graylog.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: - name: init-script-cm + name: {{ include "graylog.cm.init.name" . }} data: init-script.sh: | #!/bin/sh diff --git a/charts/graylog/templates/policy/pdb/datanode.yaml b/charts/graylog/templates/policy/pdb/datanode.yaml index b88e0dc..cafe58a 100644 --- a/charts/graylog/templates/policy/pdb/datanode.yaml +++ b/charts/graylog/templates/policy/pdb/datanode.yaml @@ -3,7 +3,7 @@ apiVersion: policy/v1 kind: PodDisruptionBudget metadata: - name: graylog-datanode + name: {{ include "graylog.fullname" . | printf "%s-pdb-datanode" }} namespace: {{ .Release.Namespace }} labels: app: graylog-datanode diff --git a/charts/graylog/templates/service/ingress/graylog-forwarder.yaml b/charts/graylog/templates/service/ingress/graylog-forwarder.yaml index 72fb8ec..410292d 100644 --- a/charts/graylog/templates/service/ingress/graylog-forwarder.yaml +++ b/charts/graylog/templates/service/ingress/graylog-forwarder.yaml @@ -2,7 +2,7 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - name: graylog-forwarder + name: {{ include "graylog.fullname" . | printf "%s-forwarder" }} labels: {{- include "graylog.labels" . | nindent 4 }} {{- with .Values.ingress.forwarder.annotations }} diff --git a/charts/graylog/templates/workload/statefulsets/graylog.yaml b/charts/graylog/templates/workload/statefulsets/graylog.yaml index 8bea0db..6a781d0 100644 --- a/charts/graylog/templates/workload/statefulsets/graylog.yaml +++ b/charts/graylog/templates/workload/statefulsets/graylog.yaml @@ -182,7 +182,7 @@ spec: volumes: - name: init-script configMap: - name: init-script-cm + name: {{ include "graylog.cm.init.name" . }} defaultMode: 0755 {{- if .Values.graylog.config.tls.enabled }} - name: tls-creds