{{ if .Values.enterprise.enabled -}}
apiVersion: v1
kind: Service
metadata:
{{- if .Values.service.annotations }}
  annotations:
{{ toYaml .Values.service.annotations | indent 4 }}
{{- end }}
  name: {{ include "influxdb.fullname" . }}-meta
  labels:
    {{- include "influxdb.labels" . | nindent 4 }}
    app.kubernets.io/component: meta
spec:
  type: ClusterIP
  clusterIP: None
  # publishNotReadyAddresses is used for service discovery of meta and data nodes by querying the service's SRV record.
  publishNotReadyAddresses: true
  ports:
    - name: meta
      port: {{ .Values.config.meta.bind_address | default 8091 }}
      targetPort: meta
  selector:
    {{- include "influxdb.selectorLabels" . | nindent 4 }}
    app.kubernets.io/component: meta
{{- end }}
