mirror of
https://github.com/bitnami/charts.git
synced 2026-03-12 14:57:18 +08:00
* fix scoping variables in node port tcp and udp in controller-service.yaml * bump version
76 lines
3.1 KiB
YAML
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 }}
|