Skip to content

Commit

Permalink
Fix #140: Adding headless service for newer versions of Kubernetes
Browse files Browse the repository at this point in the history
  • Loading branch information
bokysan committed Sep 29, 2023
1 parent 53f3fce commit 3e10ea6
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions helm/mail/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit 3e10ea6

Please sign in to comment.