diff --git a/helm/mail/templates/service.yaml b/helm/mail/templates/service.yaml index 9356408..482c17b 100644 --- a/helm/mail/templates/service.yaml +++ b/helm/mail/templates/service.yaml @@ -22,3 +22,27 @@ spec: {{ if eq .Values.service.type "NodePort" }}nodePort: {{ .Values.service.nodePort }}{{ end }} selector: {{- $selectorLabels | nindent 4 }} +--- +# https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#limitations +# StefullSets now require a headless service +apiVersion: v1 +kind: Service +metadata: + name: {{ print $fullName "-headless" | quote }} + namespace: {{ .Release.Namespace | quote }} + labels: + {{- $labels | nindent 4 }} + {{- with .Values.service.labels }}{{ toYaml . | nindent 4 }}{{ end }} + annotations: + {{- with .Values.service.annotations }}{{ toYaml . | nindent 4 }}{{ end }} +spec: + type: ClusterIP + clusterIP: None + ports: + - port: {{ .Values.service.port }} + targetPort: smtp + protocol: TCP + name: smtp + {{ if eq .Values.service.type "NodePort" }}nodePort: {{ .Values.service.nodePort }}{{ end }} + selector: + {{- $selectorLabels | nindent 4 }} \ No newline at end of file