{{- if .Values.service.enabled }}

kind: Service
apiVersion: v1
metadata:
  name: {{ include "fullname" . }}
  labels:
    app: {{ include "fullname" . }}
    chart: {{ .Chart.Name }}-{{ .Chart.Version }}
    component: "lenses"
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
    lenses.io/app: {{ include "fullname" . }}
    lenses.io/app.type: lenses-service
{{- if .Values.service.annotations }}
  annotations:
{{ toYaml .Values.service.annotations | indent 4 }}
{{- end }}
spec:
  type: "{{ .Values.service.type }}"
  ports:
  - name: lenses
    port: {{ .Values.servicePort }}   
    target: {{ .Values.restPort }}   
  - name: http-metrics
    port: {{ .Values.monitoring.port }}
  selector:
    app: {{ include "fullname" . }}
    component: "lenses"

{{- if contains "LoadBalancer" .Values.service.type }}
  {{- if .Values.service.loadBalancerIP }}
  loadBalancerIP: {{ .Values.service.loadBalancerIP }}
  {{- end -}}
  {{- if .Values.service.loadBalancerSourceRanges }}
  loadBalancerSourceRanges:
  {{- range .Values.service.loadBalancerSourceRanges }}
  - {{ . }}
  {{- end }}
  {{- end -}}
{{- end -}}
{{- end -}}

{{- if .Values.service.enabled }}

kind: Service
apiVersion: v1
metadata:
  name: {{ include "fullname" . }}
  labels:
    app: {{ include "fullname" . }}
    chart: {{ .Chart.Name }}-{{ .Chart.Version }}
    component: "lenses"
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
    lenses.io/app: {{ include "fullname" . }}
    lenses.io/app.type: lenses-service
{{- if .Values.service.annotations }}
  annotations:
{{ toYaml .Values.service.annotations | indent 4 }}
{{- end }}
spec:
  type: "{{ .Values.service.type }}"
  ports:
  - name: lenses
    port: {{ .Values.servicePort }}   
    targetPort: {{ .Values.restPort }}
  - name: http-metrics
    port: {{ .Values.monitoring.port }}
  selector:
    app: {{ include "fullname" . }}
    component: "lenses"

{{- if contains "LoadBalancer" .Values.service.type }}
  {{- if .Values.service.loadBalancerIP }}
  loadBalancerIP: {{ .Values.service.loadBalancerIP }}
  {{- end -}}
  {{- if .Values.service.loadBalancerSourceRanges }}
  loadBalancerSourceRanges:
  {{- range .Values.service.loadBalancerSourceRanges }}
  - {{ . }}
  {{- end }}
  {{- end -}}
{{- end -}}
{{- end -}}

Fix targetPort in Lenses chart
Fix targetPort in Lenses chart
