{{- if eq .Values.architecture "high-availability" }}
apiVersion: v1
kind: Service
metadata:
  name: {{ include "influxdb.fullname" . }}-headless
  labels: 
    {{- include "influxdb.labels" . | nindent 4 }}
    app.kubernetes.io/component: influxdb
spec:
  type: ClusterIP
  clusterIP: None
  ports:
    - port: {{ .Values.influxdb.service.port }}
      targetPort: http
      protocol: TCP
      name: http
    - port: {{ .Values.influxdb.service.rpcPort }}
      targetPort: rpc
      protocol: TCP
      name: rpc
  selector: 
    {{- include "influxdb.matchLabels" . | nindent 4 }}
    app.kubernetes.io/component: influxdb
{{- end }}
