diff --git a/charts/cryostat/templates/_helpers.tpl b/charts/cryostat/templates/_helpers.tpl index c5acd82a..c68af86a 100644 --- a/charts/cryostat/templates/_helpers.tpl +++ b/charts/cryostat/templates/_helpers.tpl @@ -145,3 +145,11 @@ Get or generate a default secret key for auth proxy cookies. {{- end -}} {{- join "," (default list $l | compact | uniq) | quote -}} {{- end -}} + +{{/* +Get the name for managed deployments. +*/}} +{{- define "cryostat.deploymentName" -}} +{{- $version := semver .Chart.AppVersion -}} +{{- printf "%s-v%d" (include "cryostat.fullname" .) $version.Major -}} +{{- end -}} diff --git a/charts/cryostat/templates/cryostat_deployment.yaml b/charts/cryostat/templates/cryostat_deployment.yaml index 66ed91fd..6d836f9b 100644 --- a/charts/cryostat/templates/cryostat_deployment.yaml +++ b/charts/cryostat/templates/cryostat_deployment.yaml @@ -3,7 +3,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "cryostat.fullname" . }} + name: {{ include "cryostat.deploymentName" . }} labels: {{- include "cryostat.labels" . | nindent 4 }} app.kubernetes.io/component: cryostat diff --git a/charts/cryostat/templates/db_deployment.yaml b/charts/cryostat/templates/db_deployment.yaml index f1891318..c6c753fd 100644 --- a/charts/cryostat/templates/db_deployment.yaml +++ b/charts/cryostat/templates/db_deployment.yaml @@ -3,7 +3,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "cryostat.fullname" . }}-db + name: {{ include "cryostat.deploymentName" . }}-db labels: {{- include "cryostat.labels" . | nindent 4 }} app.kubernetes.io/component: db diff --git a/charts/cryostat/templates/reports_deployment.yaml b/charts/cryostat/templates/reports_deployment.yaml index c5b9b3d6..81507d0b 100644 --- a/charts/cryostat/templates/reports_deployment.yaml +++ b/charts/cryostat/templates/reports_deployment.yaml @@ -4,7 +4,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "cryostat.fullname" . }}-reports + name: {{ include "cryostat.deploymentName" . }}-reports labels: {{- include "cryostat.labels" . | nindent 4 }} app.kubernetes.io/component: reports diff --git a/charts/cryostat/templates/storage_deployment.yaml b/charts/cryostat/templates/storage_deployment.yaml index 6155450e..1525cb48 100644 --- a/charts/cryostat/templates/storage_deployment.yaml +++ b/charts/cryostat/templates/storage_deployment.yaml @@ -3,7 +3,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "cryostat.fullname" . }}-storage + name: {{ include "cryostat.deploymentName" . }}-storage labels: {{- include "cryostat.labels" . | nindent 4 }} app.kubernetes.io/component: storage