From 867f9da9093ecaa9e0106f25ae81626b0dd595dc Mon Sep 17 00:00:00 2001 From: Florian Hansen Date: Wed, 26 Jun 2024 22:55:51 +0200 Subject: [PATCH] fix: helm chart --- charts/dasher/templates/_helpers.tpl | 20 +++++++++---------- charts/dasher/templates/ingress.yaml | 4 ++-- charts/dasher/templates/server.service.yaml | 3 +-- .../dasher/templates/server.statefulset.yaml | 4 ++-- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/charts/dasher/templates/_helpers.tpl b/charts/dasher/templates/_helpers.tpl index dfc8505..3a86526 100644 --- a/charts/dasher/templates/_helpers.tpl +++ b/charts/dasher/templates/_helpers.tpl @@ -1,7 +1,7 @@ {{/* Expand the name of the chart. */}} -{{- define "dasher-chart.name" -}} +{{- define "dasher.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} @@ -10,7 +10,7 @@ Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). If release name contains chart name it will be used as a full name. */}} -{{- define "dasher-chart.fullname" -}} +{{- define "dasher.fullname" -}} {{- if .Values.fullnameOverride }} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- else }} @@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name. {{/* Create chart name and version as used by the chart label. */}} -{{- define "dasher-chart.chart" -}} +{{- define "dasher.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Common labels */}} -{{- define "dasher-chart.labels" -}} -helm.sh/chart: {{ include "dasher-chart.chart" . }} -{{ include "dasher-chart.selectorLabels" . }} +{{- define "dasher.labels" -}} +helm.sh/chart: {{ include "dasher.chart" . }} +{{ include "dasher.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} @@ -45,17 +45,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{/* Selector labels */}} -{{- define "dasher-chart.selectorLabels" -}} -app.kubernetes.io/name: {{ include "dasher-chart.name" . }} +{{- define "dasher.selectorLabels" -}} +app.kubernetes.io/name: {{ include "dasher.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} {{/* Create the name of the service account to use */}} -{{- define "dasher-chart.serviceAccountName" -}} +{{- define "dasher.serviceAccountName" -}} {{- if .Values.serviceAccount.create }} -{{- default (include "dasher-chart.fullname" .) .Values.serviceAccount.name }} +{{- default (include "dasher.fullname" .) .Values.serviceAccount.name }} {{- else }} {{- default "default" .Values.serviceAccount.name }} {{- end }} diff --git a/charts/dasher/templates/ingress.yaml b/charts/dasher/templates/ingress.yaml index e5a966b..a35a8a1 100644 --- a/charts/dasher/templates/ingress.yaml +++ b/charts/dasher/templates/ingress.yaml @@ -2,7 +2,7 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - name: {{ include "dasher-chart.fullname" . }} # Corrected indentation + name: {{ include "dasher.fullname" . }} spec: {{- if .Values.ingress.ingressClassName }} ingressClassName: {{ .Values.ingress.ingressClassName }} @@ -13,7 +13,7 @@ spec: - path: / backend: service: - name: dasher-server-service + name: {{ include "dasher.fullname" }} port: name: web pathType: Prefix diff --git a/charts/dasher/templates/server.service.yaml b/charts/dasher/templates/server.service.yaml index d0827e7..b825e63 100644 --- a/charts/dasher/templates/server.service.yaml +++ b/charts/dasher/templates/server.service.yaml @@ -1,9 +1,8 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "dasher-chart.fullname" . }} + name: {{ include "dasher.fullname" . }} spec: - clusterIP: None selector: app: dasher-server ports: diff --git a/charts/dasher/templates/server.statefulset.yaml b/charts/dasher/templates/server.statefulset.yaml index 1e86ca2..d8c3412 100644 --- a/charts/dasher/templates/server.statefulset.yaml +++ b/charts/dasher/templates/server.statefulset.yaml @@ -1,12 +1,12 @@ apiVersion: apps/v1 kind: StatefulSet metadata: - name: {{ include "dasher-chart.fullname" . }} + name: {{ include "dasher.fullname" . }} spec: selector: matchLabels: app: dasher-server - serviceName: dasher-server-service + serviceName: {{ include "dasher.fullname" . }}-headless replicas: {{ .Values.replicas }} template: metadata: