mage-ai

by SVTECH-NMAA

Helm chartv0.3.6App 0.9.72Verified publisher

A Helm chart for Mage AI

About this chart

📦 MageAI Helm Chart

This Helm chart deploys the Mage AI Stack for building and managing data pipelines. It includes components such as the webserver, scheduler, Redis, Traefik, and optional services. It supports external PostgreSQL, shared volumes (e.g., SeaweedFS), scheduling, ingress, and custom volume mounts.


🚀 Prerequisites

  • Helm v3 or newer
  • A running Kubernetes cluster
  • Network access to GitHub Container Registry (ghcr.io)
  • An existing PostgreSQL instance (required):
    • We use this Helm chart to deploy PostgreSQL HA on Kubernetes:
      https://github.com/svtechnmaa/charts/tree/feature/mage-ai/kubernetes/postgresql-ha
  • If MageAI runs on a VM, configure the VM’s CPU type as host
  • PersistentVolume (PV) and PersistentVolumeClaim (PVC) for MageAI must be provisioned using the provided values file and the shared-volume chart:
    https://github.com/svtechnmaa/charts/tree/main/kubernetes/shared-volume

⚙️ Required Configuration

🔧 Global Settings

  • Set pullCode: true to pull pipeline code from https://github.com/svtechnmaa/netlogic_ETL_pipelines.git into the shared volume.
  • If pullCode: false, manually mount the pipeline code (e.g., for offline environments).
  • Leaving hostPath empty may result in missing or overwritten pipeline code.
  • Set hostPathPV.enabled: true to use hostPath volumes.
  • Set storageClass: seaweedfs-storage to use SeaweedFS.
  • Provide GitHub credentials (user, token) for private repo access.
global:
  mageai:
    pullCode: true
    projectName: "NMAA_pipelines"

  github:
    user: ""
    token: ""
    fg_token: ""

  basePath: /opt/shared/
  sharedVolume:
    enabled: true

  hostPathPV:
    enabled: true

### 🔑 Image Pull Token

You **must provide** a secret to pull container images:

- In the full NMAA stack, this secret is already applied.

- If deploying this chart independently, manually create the pull secret and fill the secret name.

```yaml
imagePullSecrets:
  - name: "ghcr-pull-secret"

External PostgreSQL configuration:

Set postgresqlExternalHost to match the service name of your PostgreSQL statefulset. Auth values must match the database credentials.

postgresqlExternal:
  enabled: true
  postgresqlExternalHost: "postgresql-ha-pgpool" 
  auth:
    username: postgres
    password: ""
    database: "etl_nmaa"

🚀 Step to launch:

Step 1: Install postgresql-ha as external database for mageai: https://github.com/svtechnmaa/charts/tree/feature/mage-ai/kubernetes/postgresql-ha If redeploy the postgresql-ha and change the config of headless service, make sure you delete all pvc, pv and data to remove cache.

Step 2: Fill the value file according the above note.

Step 3: Install the shared volume using the Helm chart: https://github.com/svtechnmaa/charts/tree/main/kubernetes/shared-volume

Using value.yaml from the MageAI chart.

   helm install shared-volume . --values /opt/test/mage-ai/charts/kubernetes/mage-ai/values.yaml

Step 4: Ensure that if you're using hostPath, the pipeline folder mounted to the PV is synchronized using Syncthing.

Step 5: You can install MageAI in any namespace, but make sure that:

  • The imagePullSecrets resource exists in the target namespace.
  • If PostgreSQL is in a different namespace, update postgresqlExternalHost to the full service name (including the namespace).

Install mageai:

    helm install mageai . --values /opt/test/mage-ai/charts/kubernetes/mage-ai/values.yaml

Deploy mage-ai with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has mage-ai on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartmage-ai is pinned at v0.3.6 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply