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 Common labels
*/}} */}}
{{- define "mailproxy.common.selectorLabels" -}}
app.kubernetes.io/name: {{ include "mailproxy.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{- define "mailproxy.labels" -}} {{- define "mailproxy.labels" -}}
helm.sh/chart: {{ include "mailproxy.chart" . }} helm.sh/chart: {{ include "mailproxy.chart" . }}
{{ include "mailproxy.selectorLabels" . }} {{ include "mailproxy.common.selectorLabels" . }}
{{- if .Chart.AppVersion }} {{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }} {{- end }}
@ -45,7 +51,12 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/* {{/*
Selector labels Selector labels
*/}} */}}
{{- define "mailproxy.selectorLabels" -}} {{- define "mailproxy.nginx.selectorLabels" -}}
app.kubernetes.io/name: {{ include "mailproxy.name" . }} {{ include "mailproxy.common.selectorLabels" . }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: nginx
{{- end }}
{{- define "mailproxy.mailauth.selectorLabels" -}}
{{ include "mailproxy.common.selectorLabels" . }}
app.kubernetes.io/component: mailauth
{{- end }} {{- end }}

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

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

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

@ -14,4 +14,4 @@ spec:
name: {{ $port.name }} name: {{ $port.name }}
{{- end }} {{- end }}
selector: 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 }} replicas: {{ .Values.nginx.replicaCount }}
selector: selector:
matchLabels: matchLabels:
{{- include "mailproxy.selectorLabels" . | nindent 6 }} {{- include "mailproxy.nginx.selectorLabels" . | nindent 6 }}
template: template:
metadata: metadata:
{{- with .Values.podAnnotations }} {{- with .Values.podAnnotations }}
@ -16,7 +16,7 @@ spec:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
labels: labels:
{{- include "mailproxy.selectorLabels" . | nindent 8 }} {{- include "mailproxy.nginx.selectorLabels" . | nindent 8 }}
spec: spec:
{{- with .Values.imagePullSecrets }} {{- with .Values.imagePullSecrets }}
imagePullSecrets: imagePullSecrets:

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

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

Loading…
Cancel
Save