Skip to content

Conversation

walejandromt
Copy link

What problem does this solve?

Currently, when deploying Chatwoot on Kubernetes, the /app/storage directory uses ephemeral local storage for each pod. This creates issues when:

  1. A user uploads a file through the web pod
  2. A subsequent request is handled by a different pod (due to load balancing)
  3. The second pod cannot access the file because it's stored locally on the first pod

What changes have been made?

  1. New configuration section in values.yaml:

    • persistence.enabled: Enables/disables persistent storage (disabled by default)
    • Flexible configuration for StorageClass, size, and access modes
  2. New pvc.yaml template:

    • Creates a PersistentVolumeClaim (PVC) when persistence is enabled
    • Enables storage sharing between all pods
  3. Deployment modifications:

    • Mounts the persistent volume to /app/storage in both web and worker pods
    • Maintains backward compatibility when persistence is disabled

How to test the changes?

  1. Enable persistence in values.yaml:
   persistence:
     enabled: true
     size: 10Gi
     # storageClass: "standard"  # Uncomment and configure as needed
  1. Install/upgrade the release:
helm upgrade --install chatwoot ./charts/chatwoot -f values.yaml 
  1. Verify the PVC was created:
kubectl get pvc
  1. Upload a file and verify it's accessible from any pod.

Important Considerations

  • Migration: Existing files won't be automatically migrated when enabling persistence
  • Storage: Ensure the specified StorageClass exists in your cluster
  • Performance: Performance may vary based on the underlying storage type

Compatibility

  • Backward compatible
  • No application changes required
  • Doesn't affect existing deployments unless explicitly enabled

Additional Notes

  • Chart version bumped to 2.0.5 following semantic versioning
  • Documentation updated to reflect the new functionality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants