kubernetes-handbook/manifests/nginx-ingress/templates/controller-stats-service.yaml

39 lines
1.3 KiB
YAML

{{- if .Values.controller.stats.enabled }}
apiVersion: v1
kind: Service
metadata:
{{- if .Values.controller.stats.service.annotations }}
annotations:
{{ toYaml .Values.controller.stats.service.annotations | indent 4 }}
{{- end }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: "{{ .Values.controller.name }}"
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ template "controller.fullname" . }}-stats
spec:
clusterIP: "{{ .Values.controller.stats.service.clusterIP }}"
{{- if .Values.controller.stats.service.externalIPs }}
externalIPs:
{{ toYaml .Values.controller.stats.service.externalIPs | indent 4 }}
{{- end }}
{{- if .Values.controller.stats.service.loadBalancerIP }}
loadBalancerIP: "{{ .Values.controller.stats.service.loadBalancerIP }}"
{{- end }}
{{- if .Values.controller.stats.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{ toYaml .Values.controller.stats.service.loadBalancerSourceRanges | indent 4 }}
{{- end }}
ports:
- name: stats
port: {{ .Values.controller.stats.service.servicePort }}
targetPort: 18080
selector:
app: {{ template "name" . }}
component: "{{ .Values.controller.name }}"
release: {{ .Release.Name }}
type: "{{ .Values.controller.stats.service.type }}"
{{- end }}