apiVersion: v1
kind: Service
metadata:
  name: {{ include "nextcloud-mcp-server.fullname" . }}
  labels:
    {{- include "nextcloud-mcp-server.labels" . | nindent 4 }}
  {{- with .Values.service.annotations }}
  annotations:
    {{- toYaml . | nindent 4 }}
  {{- end }}
spec:
  type: {{ .Values.service.type }}
  ports:
    - port: {{ .Values.service.port }}
      targetPort: http
      protocol: TCP
      name: http
    {{- if .Values.observability.metrics.enabled }}
    - port: {{ .Values.observability.metrics.port }}
      targetPort: metrics
      protocol: TCP
      name: metrics
    {{- end }}
  selector:
    {{- include "nextcloud-mcp-server.selectorLabels" . | nindent 4 }}
