apiVersion: v1
kind: Service
metadata:
  name: {{ include "pod-cleaner.fullname" . }}
  labels:
    {{- include "pod-cleaner.labels" . | nindent 4 }}
spec:
  type: {{ .Values.service.type }}
  ports:
    - port: {{ .Values.service.port }}
      targetPort: http-metric
      protocol: TCP
      name: http-metric
      {{- if semverCompare ">= 1.24-0" .Capabilities.KubeVersion.Version }}
      appProtocol: http
      {{- end }}
  selector:
    {{- include "pod-cleaner.selectorLabels" . | nindent 4 }}
