loki icon indicating copy to clipboard operation
loki copied to clipboard

[helm/loki] Option to use emptyDir for backend component

Open ehlomarcus opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe. Backend component requires a PersistentVolumeClaim, but do support persistentVolumeClaimRetentionPolicy on (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version). Running Loki on AWS EKS with Fargate requires use of AWS EFS for persistence, but cleanup is not needed then. Setting enableStatefulSetAutoDeletePVC solves this.

It would be beneficial to be able to run without a PVC and instead use an emptyDir.

Describe the solution you'd like Running Loki on AWS EKS with Fargate allow you to use local storage that comes with Fargate. I would like to be able to use an emptyDir and use spec.containers[].resources.limits.ephemeral-storage and spec.containers[].resources.requests.ephemeral-storage, to set how much should be available.

Describe alternatives you've considered Alternative is to continue using EFS, which is working just fine.

Additional context statefulset-backend

Example

    spec:
      volumes:
      {{- if .Values.backend.persistence.enableUseOfEmptyDir }}
        - name: data
          emptyDir: {}
      {{- end }}
  {{- if ne .Values.backend.persistence.enableUseOfEmptyDir }}
  volumeClaimTemplates:
    - metadata:
        name: data
      spec:
        accessModes:
          - ReadWriteOnce
        {{- with .Values.backend.persistence.storageClass }}
        storageClassName: {{ if (eq "-" .) }}""{{ else }}{{ . }}{{ end }}
        {{- end }}
        resources:
          requests:
            storage: {{ .Values.backend.persistence.size | quote }}
        {{- with .Values.backend.persistence.selector }}
        selector:
          {{- toYaml . | nindent 10 }}
        {{- end }}
  {{- end }}

ehlomarcus avatar Sep 18 '23 07:09 ehlomarcus

We're facing a similar issue where when deploying Loki with argo-cd, the app will always show out of sync because the backend stateful set is always trying to update the manifest with:

persistentVolumeClaimRetentionPolicy:
    whenDeleted: Delete
    whenScaled: Delete

We are using K8s 1.25.10. So it should support that?

tman5 avatar Nov 17 '23 14:11 tman5

Looks like it has been covered with https://github.com/grafana/loki/pull/10338

Perdjesk avatar May 15 '24 08:05 Perdjesk