apiVersion: v1
kind: Service
metadata:
  name: {{ template "metrics-server.fullname" . }}
  namespace: {{ .Release.Namespace }}
  labels:
    app: {{ template "metrics-server.name" . }}
    chart: {{ template "metrics-server.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
    {{- with .Values.service.labels -}}
    {{ toYaml . | nindent 4 }}
    {{- end }}
  annotations:
    {{- toYaml .Values.service.annotations | trim | nindent 4 }}
spec:
  ports:
    - port: {{ .Values.service.port }}
      protocol: TCP
      targetPort: https
  selector:
    app: {{ template "metrics-server.name" . }}
    release: {{ .Release.Name }}
  type: {{ .Values.service.type }}

