Browse Source

Fix selector labels

master
Fábio Kaiser Rauber 3 years ago
parent
commit
2e0c4ef0c6
  1. 19
      charts/mailproxy/v0.1.0/templates/_helpers.tpl
  2. 4
      charts/mailproxy/v0.1.0/templates/mailauth-deployment.yaml
  3. 2
      charts/mailproxy/v0.1.0/templates/mailauth-service.yaml
  4. 4
      charts/mailproxy/v0.1.0/templates/nginx-deployment.yaml
  5. 2
      charts/mailproxy/v0.1.0/templates/nginx-service.yaml

19
charts/mailproxy/v0.1.0/templates/_helpers.tpl

@ -33,9 +33,15 @@ Create chart name and version as used by the chart label.
{{/*
Common labels
*/}}
{{- define "mailproxy.common.selectorLabels" -}}
app.kubernetes.io/name: {{ include "mailproxy.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{- define "mailproxy.labels" -}}
helm.sh/chart: {{ include "mailproxy.chart" . }}
{{ include "mailproxy.selectorLabels" . }}
{{ include "mailproxy.common.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
@ -45,7 +51,12 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Selector labels
*/}}
{{- define "mailproxy.selectorLabels" -}}
app.kubernetes.io/name: {{ include "mailproxy.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- define "mailproxy.nginx.selectorLabels" -}}
{{ include "mailproxy.common.selectorLabels" . }}
app.kubernetes.io/component: nginx
{{- end }}
{{- define "mailproxy.mailauth.selectorLabels" -}}
{{ include "mailproxy.common.selectorLabels" . }}
app.kubernetes.io/component: mailauth
{{- end }}

4
charts/mailproxy/v0.1.0/templates/mailauth-deployment.yaml

@ -8,7 +8,7 @@ spec:
replicas: {{ .Values.mailauth.replicaCount }}
selector:
matchLabels:
{{- include "mailproxy.selectorLabels" . | nindent 6 }}
{{- include "mailproxy.mailauth.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
@ -16,7 +16,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "mailproxy.selectorLabels" . | nindent 8 }}
{{- include "mailproxy.mailauth.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:

2
charts/mailproxy/v0.1.0/templates/mailauth-service.yaml

@ -14,4 +14,4 @@ spec:
name: {{ $port.name }}
{{- end }}
selector:
{{- include "mailproxy.selectorLabels" . | nindent 4 }}
{{- include "mailproxy.mailauth.selectorLabels" . | nindent 4 }}

4
charts/mailproxy/v0.1.0/templates/nginx-deployment.yaml

@ -8,7 +8,7 @@ spec:
replicas: {{ .Values.nginx.replicaCount }}
selector:
matchLabels:
{{- include "mailproxy.selectorLabels" . | nindent 6 }}
{{- include "mailproxy.nginx.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
@ -16,7 +16,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "mailproxy.selectorLabels" . | nindent 8 }}
{{- include "mailproxy.nginx.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:

2
charts/mailproxy/v0.1.0/templates/nginx-service.yaml

@ -14,4 +14,4 @@ spec:
name: {{ $port.name }}
{{- end }}
selector:
{{- include "mailproxy.selectorLabels" . | nindent 4 }}
{{- include "mailproxy.nginx.selectorLabels" . | nindent 4 }}

Loading…
Cancel
Save