2022-07-13 09:35:13 +00:00
|
|
|
{{- if .Values.controller.service.create }}
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
2023-05-08 19:57:58 +00:00
|
|
|
name: {{ default (include "nginx-ingress.controller.fullname" .) .Values.serviceNameOverride }}
|
2022-07-13 09:35:13 +00:00
|
|
|
namespace: {{ .Release.Namespace }}
|
|
|
|
labels:
|
|
|
|
{{- include "nginx-ingress.labels" . | nindent 4 }}
|
|
|
|
{{- if .Values.controller.service.extraLabels }}
|
|
|
|
{{ toYaml .Values.controller.service.extraLabels | indent 4 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.controller.service.annotations }}
|
|
|
|
annotations:
|
|
|
|
{{ toYaml .Values.controller.service.annotations | indent 4 }}
|
|
|
|
{{- end }}
|
|
|
|
spec:
|
|
|
|
{{- if or (eq .Values.controller.service.type "LoadBalancer") (eq .Values.controller.service.type "NodePort") }}
|
|
|
|
{{- if .Values.controller.service.externalTrafficPolicy }}
|
|
|
|
externalTrafficPolicy: {{ .Values.controller.service.externalTrafficPolicy }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if eq .Values.controller.service.type "LoadBalancer" }}
|
|
|
|
{{- if and (semverCompare ">=1.22.0-0" .Capabilities.KubeVersion.Version) (.Values.controller.service.allocateLoadBalancerNodePorts) }}
|
|
|
|
allocateLoadBalancerNodePorts: {{ .Values.controller.service.allocateLoadBalancerNodePorts }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.controller.service.loadBalancerIP }}
|
|
|
|
loadBalancerIP: {{ .Values.controller.service.loadBalancerIP }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.controller.service.loadBalancerSourceRanges }}
|
|
|
|
loadBalancerSourceRanges:
|
|
|
|
{{ toYaml .Values.controller.service.loadBalancerSourceRanges | indent 4 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
type: {{ .Values.controller.service.type }}
|
|
|
|
{{- if .Values.controller.service.ipFamilyPolicy }}
|
|
|
|
ipFamilyPolicy: {{ .Values.controller.service.ipFamilyPolicy }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.controller.service.ipFamilies }}
|
|
|
|
ipFamilies: {{ .Values.controller.service.ipFamilies }}
|
|
|
|
{{- end }}
|
|
|
|
ports:
|
|
|
|
{{- if .Values.controller.service.customPorts }}
|
|
|
|
{{ toYaml .Values.controller.service.customPorts | indent 2 }}
|
|
|
|
{{ end }}
|
|
|
|
{{- if .Values.controller.service.httpPort.enable }}
|
|
|
|
- port: {{ .Values.controller.service.httpPort.port }}
|
|
|
|
targetPort: {{ .Values.controller.service.httpPort.targetPort }}
|
|
|
|
protocol: TCP
|
|
|
|
name: http
|
|
|
|
{{- if eq .Values.controller.service.type "NodePort" }}
|
|
|
|
nodePort: {{ .Values.controller.service.httpPort.nodePort }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.controller.service.httpsPort.enable }}
|
|
|
|
- port: {{ .Values.controller.service.httpsPort.port }}
|
|
|
|
targetPort: {{ .Values.controller.service.httpsPort.targetPort }}
|
|
|
|
protocol: TCP
|
|
|
|
name: https
|
|
|
|
{{- if eq .Values.controller.service.type "NodePort" }}
|
|
|
|
nodePort: {{ .Values.controller.service.httpsPort.nodePort }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
selector:
|
2023-03-28 14:02:53 +00:00
|
|
|
{{- include "nginx-ingress.selectorLabels" . | nindent 4 }}
|
2022-07-13 09:35:13 +00:00
|
|
|
{{- if .Values.controller.service.externalIPs }}
|
|
|
|
externalIPs:
|
|
|
|
{{ toYaml .Values.controller.service.externalIPs | indent 4 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|