apiVersion: v1
kind: Service
metadata:
  name: {{ template "grafana-loki.gossip-ring.fullname" . }}
  namespace: {{ .Release.Namespace | quote }}
  labels: {{- include "common.labels.standard" . | nindent 4 }}
    app.kubernetes.io/part-of: grafana-loki
    app.kubernetes.io/component: loki
    {{- if .Values.commonLabels }}
    {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
    {{- end }}
  {{- if or .Values.commonAnnotations .Values.loki.gossipRing.service.annotations }}
  annotations:
    {{- if .Values.loki.gossipRing.service.annotations }}
    {{- include "common.tplvalues.render" ( dict "value" .Values.loki.gossipRing.service.annotations "context" $ ) | nindent 4 }}
    {{- end }}
    {{- if .Values.commonAnnotations }}
    {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
    {{- end }}
  {{- end }}
spec:
  type: ClusterIP
  publishNotReadyAddresses: true
  clusterIP: None
  ports:
    - name: http
      port: {{ .Values.loki.gossipRing.service.ports.http }}
      targetPort: http-memberlist
      protocol: TCP
  selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
    loki-gossip-member: "true"
