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