apiVersion: v1
kind: Service
metadata:
{{- if .Values.service.annotations }}
  annotations:
{{ toYaml .Values.service.annotations | indent 4 }}
{{- end }}
  labels:
{{ include "cluster-autoscaler.labels" . | indent 4 }}
  name: {{ template "cluster-autoscaler.fullname" . }}
spec:
{{- if .Values.service.clusterIP }}
  clusterIP: "{{ .Values.service.clusterIP }}"
{{- end }}
{{- if .Values.service.externalIPs }}
  externalIPs:
{{ toYaml .Values.service.externalIPs | indent 4 }}
{{- end }}
{{- if .Values.service.loadBalancerIP }}
  loadBalancerIP: "{{ .Values.service.loadBalancerIP }}"
{{- end }}
{{- if .Values.service.loadBalancerSourceRanges }}
  loadBalancerSourceRanges:
{{ toYaml .Values.service.loadBalancerSourceRanges | indent 4 }}
{{- end }}
  ports:
    - port: {{ .Values.service.servicePort }}
      protocol: TCP
      targetPort: 8085
      name: {{ .Values.service.portName }}
  selector:
{{ include "cluster-autoscaler.instance-name" . | indent 4 }}
  type: "{{ .Values.service.type }}"
