Loki migration/upgrade from 3.8.1 to 5.22.0

Hello all,

I’d like to upgrade my loki helm deployment on my cluster from version 3.8.1. to version 5.22.0 without losing any of my data. My current deployment looks like this:

apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: loki
spec:
  chart:
    spec:
      chart: loki
      sourceRef:
        kind: HelmRepository
        name: grafana
      version: 3.8.1
  interval: 10m0s
  values:
    loki:
      storage:
        type: filesystem
      auth_enabled: false
    test:
      enabled: false
    monitoring:
      dashboards:
        enabled: false
      rules:
        enabled: false
      serviceMonitor:
        enabled: false
      selfMonitoring:
        enabled: false
        grafanaAgent:
          installOperator: false
      lokiCanary:
        enabled: false
    singleBinary:
      replicas: 3
      persistence:
        size: 200Gi
        storageClass: local

As you can see I use filesystemas storage and 3 replicas of the singlebinary, which is not allowed without proper storage in later versions. I want to deploy a newer version, without the loss of any data, as loki is used extensively.

Is this possible, or do I have to just switch to 1 singlebinary pod and start migrating from there? What would be the safest solution?

version 5.22.0 of what? As far as I know, the latest Loki release is v2.9.1

Sorry for the confusion, I meant the helm-chart versions. The actual image versions are upgrading from 2.7.0 to 2.9.1.