apiVersion: v1
kind: Service
metadata:
  name: {{ include "marmot.fullname" . }}
  labels:
    {{- include "marmot.labels" . | nindent 4 }}
spec:
  type: {{ .Values.service.type }}
  ports:
    - port: {{ .Values.service.port }}
      targetPort: http
      protocol: TCP
      name: http
    {{- if .Values.config.metrics.enabled }}
    - port: {{ .Values.config.metrics.port }}
      targetPort: metrics
      protocol: TCP
      name: metrics
    {{- end }}
  selector:
    {{- include "marmot.selectorLabels" . | nindent 4 }}
    app.kubernetes.io/component: server
