apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: compactor
  namespace: logging
spec:
  replicas: 1
  selector:
    matchLabels:
      name: compactor
  serviceName: compactor
  template:
    metadata:
      annotations:
        config_hash: 9979aff380ca3ecdb768703174f63193
      labels:
        name: compactor
    spec:
      containers:
      - args:
        - -boltdb.shipper.compactor.shared-store=s3
        - -boltdb.shipper.compactor.working-directory=/data/compactor
        - -config.expand-env=true
        - -config.file=/etc/loki/config/config.yaml
        - -target=compactor
        image: quay.io/cybozu/loki
        imagePullPolicy: IfNotPresent
        name: compactor
        ports:
        - containerPort: 3100
          name: http-metrics
        readinessProbe:
          httpGet:
            path: /ready
            port: 3100
          timeoutSeconds: 1
        resources:
          requests:
            cpu: "4"
            memory: 2Gi
        volumeMounts:
        - mountPath: /data
          name: compactor-data
        - mountPath: /etc/loki/config
          name: loki
      securityContext:
        fsGroup: 10001
      volumes:
      - configMap:
          name: loki
        name: loki
  updateStrategy:
    type: RollingUpdate
  volumeClaimTemplates:
  - apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: compactor-data
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 10Gi
      storageClassName: ceph-ssd-block
