apiVersion: apps/v1
kind: StatefulSet
metadata:
  labels:
    app.kubernetes.io/component: ingester
    app.kubernetes.io/instance: RELEASE-NAME
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: loki-distributed
    app.kubernetes.io/part-of: memberlist
    app.kubernetes.io/version: 2.4.2
    helm.sh/chart: loki-distributed-0.42.1
  name: RELEASE-NAME-loki-distributed-ingester
spec:
  podManagementPolicy: Parallel
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app.kubernetes.io/component: ingester
      app.kubernetes.io/instance: RELEASE-NAME
      app.kubernetes.io/name: loki-distributed
  serviceName: RELEASE-NAME-loki-distributed-ingester-headless
  template:
    metadata:
      annotations:
        checksum/config: aed7b372047c9e9aaeba1d3f597d1af4af1c6a93a0e618711a6366bd1b4ef195
      labels:
        app.kubernetes.io/component: ingester
        app.kubernetes.io/instance: RELEASE-NAME
        app.kubernetes.io/name: loki-distributed
        app.kubernetes.io/part-of: memberlist
    spec:
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - podAffinityTerm:
              labelSelector:
                matchLabels:
                  app.kubernetes.io/component: ingester
                  app.kubernetes.io/instance: RELEASE-NAME
                  app.kubernetes.io/name: loki-distributed
              topologyKey: failure-domain.beta.kubernetes.io/zone
            weight: 100
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchLabels:
                app.kubernetes.io/component: ingester
                app.kubernetes.io/instance: RELEASE-NAME
                app.kubernetes.io/name: loki-distributed
            topologyKey: kubernetes.io/hostname
      containers:
      - args:
        - -config.file=/etc/loki/config/config.yaml
        - -target=ingester
        image: docker.io/grafana/loki:2.4.2
        imagePullPolicy: IfNotPresent
        name: ingester
        ports:
        - containerPort: 3100
          name: http
          protocol: TCP
        - containerPort: 9095
          name: grpc
          protocol: TCP
        - containerPort: 7946
          name: http-memberlist
          protocol: TCP
        readinessProbe:
          httpGet:
            path: /ready
            port: http
          initialDelaySeconds: 30
          timeoutSeconds: 1
        resources: {}
        securityContext:
          allowPrivilegeEscalation: false
          capabilities:
            drop:
            - ALL
          readOnlyRootFilesystem: true
        volumeMounts:
        - mountPath: /etc/loki/config
          name: config
        - mountPath: /var/loki
          name: data
      securityContext:
        fsGroup: 10001
        runAsGroup: 10001
        runAsNonRoot: true
        runAsUser: 10001
      serviceAccountName: RELEASE-NAME-loki-distributed
      terminationGracePeriodSeconds: 300
      volumes:
      - configMap:
          name: RELEASE-NAME-loki-distributed
        name: config
      - emptyDir: {}
        name: data
  updateStrategy:
    rollingUpdate:
      partition: 0
