Mailu / helm-charts

Development repo for helm charts
127 stars 131 forks source link

[BUG] Upgrade to > 2.0.0 deleted PVC together with all data #366

Closed NotANormalNerd closed 1 month ago

NotANormalNerd commented 3 months ago

Describe the bug When upgrading the helm-chart from 1.x to 2.x my whole setup is being deleted including the PVC, which subsequently deletes all my data and e-mails.

Subsequently having a fresh install, I can't access the admin because of "Internal Server Error"

helm_v3 install --namespace mailu-v2 --version 2.1.1 mailu-v2 mailu-v2/mailu --values /config/values-01_HelmChart.yaml

Environment

Additional context

    mariadb:
      enabled: false
    postgresql:
      enabled: false
    domain: example.com
    hostnames:
    - mail.example.com
    admin:
      extraEnvVars:
      - name: LD_PRELOAD
        value: /usr/lib/libhardened_malloc.so
      - name: DEBUG
        value: "true"
    ingress:
      annotations:
        cert-manager.io/cluster-issuer: letsencrypt-production
        nginx.ingress.kubernetes.io/proxy-body-size: "0"
        traefik.ingress.kubernetes.io/router.middlewares: default-redirect-https@kubernetescrd
      className: ""
      enabled: true
      realIpFrom: 0.0.0.0/0
      realIpHeader: X-Forwarded-For
    initialAccount:
      domain: example.com
      password: chang3m3!
      username: mailadmin
    persistence:
      accessMode: ReadWriteOnce
      single_pvc: true
      size: 11Gi
    postmaster: postmaster
    webmail:
      enabled: false
    secretKey: blablabla
    front:
      hostPort:
        enabled: false
      externalService:
        enabled: True
        type: LoadBalancer
        ports:
          pop3: false
          pop3s: true
          imap: false
          imaps: true
          smtp: true
          smtps: true
          submission: true
dlford commented 2 months ago

@NotANormalNerd I had the same issue with admin access, here's how I fixed it (assuming you are using Traefik like me):

  1. Turn off the ingress in values.yaml (set enabled: false), it used to point to port 80 on mailu-front, but now points to port 443, which causes Traefik to throw an error 500 because the backend certificate is not valid for the domain [service].[namespace].svc.[cluster-domain]
  2. Create a servers transport for mailu-front (make sure your cluster domain is cluster.local or change it in serverName below to match).
    apiVersion: traefik.io/v1alpha1
    kind: ServersTransport
    metadata:
      name: mailu-web
    spec:
      serverName: mailu-front.[namespace].svc.cluster.local
      insecureSkipVerify: true # <-- This fixes the issue
  3. Create manually an ingress (and certificate if needed), but change the services to use the new servers transport.
    services:
      - name: mailu-front
        serversTransport: mailu-web
        port: 443
WebSpider commented 2 months ago

The removal of the PVC is documented behaviour in https://github.com/Mailu/helm-charts/blob/master/mailu/MIGRATION_GUIDE.md

NotANormalNerd commented 2 months ago

@WebSpider This migration guide applies for migrating to 1.0.0

grafik

If this also applies to 2.0.0 then at least the documentation should be updated.

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 1 month ago

This issue was closed because it has been stalled for 5 days with no activity.