Skip to content

Commit

Permalink
fix: labels fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JannikZed committed May 5, 2024
1 parent 3b3ba9b commit 8e75c06
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/strapi/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions charts/strapi/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions charts/strapi/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ spec:
{{- end }}
labels:
{{- include "strapi.selectorLabels" . | nindent 8 }}
app.kubernetes.io/role: primary
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Expand Down Expand Up @@ -94,6 +95,8 @@ spec:
selector:
matchLabels:
{{- include "strapi.selectorLabels" . | nindent 6 }}
app.kubernetes.io/role: read-replica

strategy:
type: Recreate
template:
Expand All @@ -104,6 +107,7 @@ spec:
{{- end }}
labels:
{{- include "strapi.selectorLabels" . | nindent 8 }}
app.kubernetes.io/role: read-replica
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Expand All @@ -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
Expand Down

0 comments on commit 8e75c06

Please sign in to comment.