kubernetes-handbook/manifests/nginx-ingress/templates/default-backend-service.yaml

38 lines
1.3 KiB
YAML
Raw Permalink Normal View History

2017-10-27 19:09:01 +08:00
{{- if .Values.defaultBackend.enabled }}
apiVersion: v1
kind: Service
metadata:
{{- if .Values.defaultBackend.service.annotations }}
annotations:
{{ toYaml .Values.defaultBackend.service.annotations | indent 4 }}
{{- end }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: "{{ .Values.defaultBackend.name }}"
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ template "defaultBackend.fullname" . }}
spec:
clusterIP: "{{ .Values.defaultBackend.service.clusterIP }}"
{{- if .Values.defaultBackend.service.externalIPs }}
externalIPs:
{{ toYaml .Values.defaultBackend.service.externalIPs | indent 4 }}
{{- end }}
{{- if .Values.defaultBackend.service.loadBalancerIP }}
loadBalancerIP: "{{ .Values.defaultBackend.service.loadBalancerIP }}"
{{- end }}
{{- if .Values.defaultBackend.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{ toYaml .Values.defaultBackend.service.loadBalancerSourceRanges | indent 4 }}
{{- end }}
ports:
- port: {{ .Values.defaultBackend.service.servicePort }}
targetPort: 8080
selector:
app: {{ template "name" . }}
component: "{{ .Values.defaultBackend.name }}"
release: {{ .Release.Name }}
type: "{{ .Values.defaultBackend.service.type }}"
{{- end }}