# grafana_charts_service-memcached-index-writes.yaml
{{- if .Values.memcachedIndexWrites.enabled }}
apiVersion: v1
kind: Service
metadata:
  name: {{ include "loki.memcachedIndexWritesFullname" . }}
  namespace: {{ .Release.Namespace }}
  labels:
    {{- include "loki.memcachedIndexWritesSelectorLabels" . | nindent 4 }}
    {{- with .Values.memcachedIndexWrites.serviceLabels }}
    {{- toYaml . | nindent 4 }}
    {{- end }}
  {{- with .Values.memcached.serviceAnnotations }}
  annotations:
    {{- toYaml . | nindent 4 }}
  {{- end }}
spec:
  type: ClusterIP
  clusterIP: None
  ports:
    - name: memcached-client
      port: 11211
      targetPort: http
      protocol: TCP
      {{- if .Values.memcached.appProtocol }}
      appProtocol: {{ .Values.memcached.appProtocol }}
      {{- end }}
    - name: http-metrics
      port: 9150
      targetPort: http-metrics
      protocol: TCP
  selector:
    {{- include "loki.memcachedIndexWritesSelectorLabels" . | nindent 4 }}
{{- end }}