Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ADR: Bitnami Supabase deprecation continuation #968

Open
CollectiveUnicorn opened this issue Aug 30, 2024 · 1 comment
Open

ADR: Bitnami Supabase deprecation continuation #968

CollectiveUnicorn opened this issue Aug 30, 2024 · 1 comment
Assignees
Labels
ADR 🧐 Architecture Decision Record

Comments

@CollectiveUnicorn
Copy link
Contributor

Describe what should be investigated or refactored

Supabase has been deprecated by Bitnami, so there's a need to determine a path forward. This ADR should determine what path we're going to take.

  • Switch to supabase-community and maintain custom configs
  • Maintain the bitnami charts/images
  • Move off of Supabase
@CollectiveUnicorn
Copy link
Contributor Author

ADR Supplement: Supabase Deployment Options

Primary Focus

This ADR supplement evaluates the maintainability and initial effort required to set up and maintain various Supabase deployment options, including supabase-community, maintaining the deprecated supabase/bitnami charts + images, and assessing alternatives listed on the official Supabase website.

Deployment Options

1. Supabase-Community (https://github.com/supabase-community/supabase-kubernetes)

  • Effort

    • Approximately two weeks for one person, primarily dealing with Helm charts and ensuring clean integration with LeapfrogAI.
    • Parallelizing configuration work by service (realtime, Kong, REST, storage, etc.) across multiple contributors could potentially reduce this timeframe.
  • Additional Considerations

    • Database migration testing may require extra time. Ideally, this would involve swapping out the PVC, but additional work may be necessary if the new Postgres container doesn't seamlessly adopt existing database files, variables, and configurations.
    • Requires comparing the new supabase-community values file and templates with our existing values file and the previous Bitnami values file and templates.
  • Advantages

    • Actively maintained
    • Good Kubernetes deployment base and images
    • Supports all Supabase features
    • Potential to contribute changes back to the upstream repository
  • Initial Integration Notes

    • Initial configurations available on the branch 968-adr-bitnami-supabase-deprecation-continuation
    • Working Docker containers compatible with a uds-core cluster
    • Functional Kubernetes deployment with all Supabase components running and networked
    • Supabase accessible via "https://supabase-kong.uds.dev" with working dashboard, database, and realtime features
    • DB migration container runs sucessfully
    • Operational Zarf package
    • Not yet ready for LeapfrogAI integration; requires at minimum adjustments to secrets management
    • Configs not production-ready; includes hardcoded credentials in charts and default values needs additional evaluation for security and sensibility
    • Requires additional templates to reduce manual configuration
    • Some configurations and templates may be adaptable from the Bitnami chart and alternative setups
  • Required Improvements

    • Implement JWT job/secrets
    • Enhance database persistence to prevent accidental deletion
    • Secure Postgres credentials
    • Align declarative config names
    • Test and potentially modify Supabase Realtime changes for Kong
    • Adjust max file size for storage
    • Ensure secrets availability so that other components can complete startup and migrations, namely the LeapfrogAI UI and API
    • Address any issues with pgvector and dashboard configurations
    • Resolve any read/write issues due to dockerfile user permissions
    • Configure gotrue site URL for auth and Keycloak integration
  • Maintenance Requirements

    • Maintain two small Dockerfiles primarily to resolve permissions issues due to assumed root user
    • Additional Dockerfiles may be necessary for extended feature support
    • Ongoing maintenance of templates and values file for use with the base supabase-community Helm chart
  • Resources

2. Alternative Supabase Versions (https://supabase.com/docs/guides/self-hosting)

2.1 Maintaining Fork of Deprecated Supabase Bitnami Images/Charts

  • Effort

    • Fastest setup (estimated 1-2 days) due to minimal changes in chart configurations and images. This time would primarily involve pushing updated images, adjusting configurations to reflect new image locations, and establishing a new repository for ongoing maintenance.
  • Advantages

    • Fastest setup option
    • No database migration required
    • Useful as a reference for supabase-community configuration
  • Disadvantages

    • Removed from Bitnami repo; full maintenance responsibility falls on our team
    • 3 external dependencies from Bitnami
  • Maintenance Requirements

    • Requires maintaining 5 custom images and 1 chart with 7 templates and in-depth understanding of Supabase.
    • Potentially maintaining the Kong chart if Bitnami decides to remove it.
  • Resources

2.2 Stackgres Supabase Deployment

2.3 DigitalOcean Deployment

2.4 AWS Deployment

  • Effort

    • Not applicable for direct deployment within our environment
  • Advantages

    • Useful as a reference for environment variables
  • Disadvantages

    • AWS-focused deployment using CloudFormation
    • No Kubernetes configs
    • Not suitable for our purposes (SAAS deployment)
  • Maintenance Requirements

    • Not applicable for direct deployment within our environment
  • Resources

2.5 Postgres AIO Docker Container

  • Effort

    • Estimated 2 weeks to 1 month for one person to create a new Helm chart and associated templates.
  • Advantages

    • Useful as a reference for supabase-community configuration
    • Simplest implementation in terms of number of pods and configuration between services, may integrate with istio without modification
  • Disadvantages

    • Not suitable for production use in its current state, built for Postgres testing
    • Lacks charts, requiring full chart and template maintenance
    • Unclear feature support
    • Infrequently maintained
  • Maintenance Requirements

    • Requires an in-depth understanding of Supabase to maintain a single complex dockerfile, helm chart, all templates, and values.
  • Resources

2.6 Supabase Terraform

  • Effort

    • Not applicable for direct deployment within our environment
  • Advantages

    • None
  • Disadvantages

    • Similar to DigitalOcean deployment but unmaintained and focused on terraform
  • Maintenance Requirements

    • Not applicable for direct deployment within our environment
  • Resources

2.7 Supabase Traefik

  • Effort

    • Not applicable for direct deployment within our environment
  • Advantages

    • None
  • Disadvantages

    • Docker Compose-centric deployment
    • Unmaintained
    • Likely superseded by updates from supabase-community and official Supabase Docker images
  • Maintenance Requirements

    • Not applicable for direct deployment within our environment
  • Resources

Recommendation

This analysis suggests that supabase-community offers the most promising long-term solution due to its active maintenance, comprehensive feature support, and potential for community contributions. While maintaining a fork of the deprecated Bitnami chart offers the fastest initial setup, it carries a significant, ongoing maintenance burden. Other alternatives are either unsuitable for our environment or lack the necessary features and maintenance support.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
ADR 🧐 Architecture Decision Record
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants