Files
charts/bitnami/nginx-ingress-controller/templates/controller-service.yaml
Andrea Beggiato 9e4ca5f051 [bitnami/nginx-ingress-controller] Fix variable scope in tcp and/or udp (#2079)
* fix scoping variables in node port tcp and udp in controller-service.yaml

* bump version
2020-03-19 11:14:00 +01:00

76 lines
3.1 KiB
YAML

apiVersion: v1
kind: Service
metadata:
name: {{ template "nginx-ingress.fullname" . }}
labels: {{- include "nginx-ingress.labels" . | nindent 4 }}
component: {{ .Values.name }}
{{- if .Values.service.labels }}
{{- include "nginx-ingress.tplValue" (dict "value" .Values.service.labels "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.service.annotations }}
annotations: {{- include "nginx-ingress.tplValue" (dict "value" .Values.service.annotations "context" $) | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.service.type }}
{{- if not (empty .Values.service.clusterIP) }}
clusterIP: {{ .Values.service.clusterIP | quote }}
{{- end }}
{{- if .Values.service.externalIPs }}
externalIPs: {{- toYaml .Values.service.externalIPs | nindent 4 }}
{{- end }}
{{- if .Values.service.loadBalancerIP }}
loadBalancerIP: {{ .Values.service.loadBalancerIP | quote }}
{{- end }}
{{- if .Values.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges: {{- toYaml .Values.service.loadBalancerSourceRanges | nindent 4 }}
{{- end }}
{{- if .Values.service.externalTrafficPolicy }}
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }}
{{- end }}
{{- if .Values.service.healthCheckNodePort }}
healthCheckNodePort: {{ .Values.service.healthCheckNodePort }}
{{- end }}
ports:
- name: http
port: {{ .Values.service.ports.http }}
protocol: TCP
targetPort: http
{{- if and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) (not (empty .Values.service.nodePorts.http)) }}
nodePort: {{ .Values.service.nodePorts.http }}
{{- else if eq .Values.service.type "ClusterIP" }}
nodePort: null
{{- end }}
- name: https
port: {{ .Values.service.ports.https }}
protocol: TCP
targetPort: https
{{- if and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) (not (empty .Values.service.nodePorts.https)) }}
nodePort: {{ .Values.service.nodePorts.https }}
{{- else if eq .Values.service.type "ClusterIP" }}
nodePort: null
{{- end }}
{{- range $key, $value := .Values.tcp }}
- name: {{ $key }}-tcp
port: {{ $key }}
protocol: TCP
targetPort: {{ $key }}-tcp
{{- if and (or (eq $.Values.service.type "NodePort") (eq $.Values.service.type "LoadBalancer")) (index $.Values.service.nodePorts.tcp $key) }}
nodePort: {{ index $.Values.service.nodePorts.tcp $key }}
{{- else if eq $.Values.service.type "ClusterIP" }}
nodePort: null
{{- end }}
{{- end }}
{{- range $key, $value := .Values.udp }}
- name: {{ $key }}-udp
port: {{ $key }}
protocol: UDP
targetPort: {{ $key }}-udp
{{- if and (or (eq $.Values.service.type "NodePort") (eq $.Values.service.type "LoadBalancer")) (index $.Values.service.nodePorts.udp $key) }}
nodePort: {{ index $.Values.service.nodePorts.udp $key }}
{{- else if eq $.Values.service.type "ClusterIP" }}
nodePort: null
{{- end }}
{{- end }}
selector: {{- include "nginx-ingress.matchLabels" . | nindent 4 }}
component: {{ .Values.name }}