mirror of
https://github.com/bokysan/docker-postfix.git
synced 2025-09-06 14:37:45 +08:00
Fix #140: Adding headless service for newer versions of Kubernetes
This commit is contained in:
parent
53f3fce380
commit
3e10ea64f9
1 changed files with 24 additions and 0 deletions
|
@ -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 }}
|
Loading…
Add table
Reference in a new issue