From 8e75c066a144b56050756ea0d28024e213f0825c Mon Sep 17 00:00:00 2001 From: Jannik Zinkl Date: Sun, 5 May 2024 17:36:12 +0200 Subject: [PATCH] fix: labels fix --- charts/strapi/Chart.yaml | 2 +- charts/strapi/templates/_helpers.tpl | 7 +++++++ charts/strapi/templates/deployment.yaml | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/charts/strapi/Chart.yaml b/charts/strapi/Chart.yaml index e79311c..9bcfb1a 100644 --- a/charts/strapi/Chart.yaml +++ b/charts/strapi/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.1 +version: 0.2.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/strapi/templates/_helpers.tpl b/charts/strapi/templates/_helpers.tpl index b380790..cbf4b8b 100644 --- a/charts/strapi/templates/_helpers.tpl +++ b/charts/strapi/templates/_helpers.tpl @@ -38,6 +38,13 @@ Create chart name and version as used by the chart label. {{- end }} {{- end }} +{{- define "strapi.internalDatabaseUrlReplica"-}} +{{- if eq .Values.postgresql.architecture "replication" }} +{{- printf "%s%s%s%s%s%s%s%s" "postgresql://" .Values.postgresql.auth.username ":" .Values.postgresql.auth.password "@" .Release.Name "-postgresql-read:5432/" .Values.postgresql.auth.database }} +{{- end }} +{{- end }} + + {{/* Common labels diff --git a/charts/strapi/templates/deployment.yaml b/charts/strapi/templates/deployment.yaml index caa85cd..970eef5 100644 --- a/charts/strapi/templates/deployment.yaml +++ b/charts/strapi/templates/deployment.yaml @@ -22,6 +22,7 @@ spec: {{- end }} labels: {{- include "strapi.selectorLabels" . | nindent 8 }} + app.kubernetes.io/role: primary spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: @@ -94,6 +95,8 @@ spec: selector: matchLabels: {{- include "strapi.selectorLabels" . | nindent 6 }} + app.kubernetes.io/role: read-replica + strategy: type: Recreate template: @@ -104,6 +107,7 @@ spec: {{- end }} labels: {{- include "strapi.selectorLabels" . | nindent 8 }} + app.kubernetes.io/role: read-replica spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: @@ -116,7 +120,11 @@ spec: - name: {{ .Chart.Name }}-read-replica securityContext: {{- toYaml .Values.securityContext | nindent 12 }} + {{- if .Values.image.imageName }} + image: "{{ lower .Values.image.imageName }}" + {{- else }} image: "{{ lower .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + {{- end }} imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: http