From a6747be8f62a4dca950f87590727ea052ee870f7 Mon Sep 17 00:00:00 2001 From: Fabio Rauber Date: Mon, 14 Dec 2020 15:57:55 -0300 Subject: [PATCH] Fix issue with service selector labels --- charts/portalmodelo/v0.5.0/templates/_helpers.tpl | 12 ++++++++++-- .../v0.5.0/templates/plone-deployment.yaml | 4 ++-- .../portalmodelo/v0.5.0/templates/plone-service.yaml | 2 +- .../v0.5.0/templates/zeoserver-deployment.yaml | 4 ++-- .../v0.5.0/templates/zeoserver-service.yaml | 2 +- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/charts/portalmodelo/v0.5.0/templates/_helpers.tpl b/charts/portalmodelo/v0.5.0/templates/_helpers.tpl index e5b9570..14708b9 100644 --- a/charts/portalmodelo/v0.5.0/templates/_helpers.tpl +++ b/charts/portalmodelo/v0.5.0/templates/_helpers.tpl @@ -36,7 +36,8 @@ Common labels */}} {{- define "portalmodelo.labels" -}} helm.sh/chart: {{ include "portalmodelo.chart" . }} -{{ include "portalmodelo.selectorLabels" . }} +app.kubernetes.io/name: {{ include "portalmodelo.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} @@ -46,7 +47,14 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{/* Selector labels */}} -{{- define "portalmodelo.selectorLabels" -}} +{{- define "portalmodelo.ploneSelectorLabels" -}} +app.kubernetes.io/name: {{ include "portalmodelo.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +app.kubernetes.io/component: plone +{{- end }} + +{{- define "portalmodelo.zeoserverSelectorLabels" -}} app.kubernetes.io/name: {{ include "portalmodelo.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} +app.kubernetes.io/component: zeoserver {{- end }} diff --git a/charts/portalmodelo/v0.5.0/templates/plone-deployment.yaml b/charts/portalmodelo/v0.5.0/templates/plone-deployment.yaml index ffae9c5..d22d3ef 100644 --- a/charts/portalmodelo/v0.5.0/templates/plone-deployment.yaml +++ b/charts/portalmodelo/v0.5.0/templates/plone-deployment.yaml @@ -16,7 +16,7 @@ spec: {{- end }} selector: matchLabels: - {{- include "portalmodelo.selectorLabels" . | nindent 6 }} + {{- include "portalmodelo.ploneSelectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.podAnnotations }} @@ -24,7 +24,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "portalmodelo.selectorLabels" . | nindent 8 }} + {{- include "portalmodelo.zeoserverSelectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: diff --git a/charts/portalmodelo/v0.5.0/templates/plone-service.yaml b/charts/portalmodelo/v0.5.0/templates/plone-service.yaml index b75405f..1c77eab 100644 --- a/charts/portalmodelo/v0.5.0/templates/plone-service.yaml +++ b/charts/portalmodelo/v0.5.0/templates/plone-service.yaml @@ -11,4 +11,4 @@ spec: protocol: TCP name: "8080" selector: - {{- include "portalmodelo.selectorLabels" . | nindent 4 }} + {{- include "portalmodelo.ploneSelectorLabels" . | nindent 4 }} diff --git a/charts/portalmodelo/v0.5.0/templates/zeoserver-deployment.yaml b/charts/portalmodelo/v0.5.0/templates/zeoserver-deployment.yaml index 6bf8802..466eda4 100644 --- a/charts/portalmodelo/v0.5.0/templates/zeoserver-deployment.yaml +++ b/charts/portalmodelo/v0.5.0/templates/zeoserver-deployment.yaml @@ -11,7 +11,7 @@ spec: type: Recreate selector: matchLabels: - {{- include "portalmodelo.selectorLabels" . | nindent 6 }} + {{- include "portalmodelo.zeoserverSelectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.podAnnotations }} @@ -19,7 +19,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "portalmodelo.selectorLabels" . | nindent 8 }} + {{- include "portalmodelo.zeoserverSelectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: diff --git a/charts/portalmodelo/v0.5.0/templates/zeoserver-service.yaml b/charts/portalmodelo/v0.5.0/templates/zeoserver-service.yaml index 6466204..18dd974 100644 --- a/charts/portalmodelo/v0.5.0/templates/zeoserver-service.yaml +++ b/charts/portalmodelo/v0.5.0/templates/zeoserver-service.yaml @@ -12,6 +12,6 @@ spec: protocol: TCP name: "8100" selector: - {{- include "portalmodelo.selectorLabels" . | nindent 4 }} + {{- include "portalmodelo.zeoserverSelectorLabels" . | nindent 4 }} {{- end }}