{{- if and .Values.mixCoordinator.enabled .Values.cluster.enabled .Values.metrics.enabled }}
apiVersion: v1
kind: Service
metadata:
  name: {{ template "milvus.mixcoord.fullname" . }}
  namespace: {{ .Release.Namespace }}
  labels:
{{ include "milvus.labels" . | indent 4 }}
{{- if .Values.mixCoordinator.service.labels }}
{{ toYaml .Values.mixCoordinator.service.labels | indent 4 }}
{{- end }}
    component: "mixcoord"
{{- with .Values.mixCoordinator.service.annotations }}
  annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
  type: ClusterIP
  {{- if .Values.mixCoordinator.service.clusterIP }}
  clusterIP: {{ .Values.mixCoordinator.service.clusterIP }}
  {{- end }}
  ports:
    - name: metrics
      protocol: TCP
      port: 9091
      targetPort: metrics
  selector:
{{ include "milvus.matchLabels" . | indent 4 }}
    component: "mixcoord"
{{- end }}