Deploy Mage to Kubernetes cluster with Helm.


Prerequisites

Install Helm

Full installation guide: https://helm.sh/docs/intro/install/

Setup a Kubernetes Cluster

Local

Enable Kubernetes in Docker Desktop to start a kubernetes cluster locally.

Other options for starting a Kubernetes cluster locally:

AWS EKS

Follow the guide to set up the EKS cluster.

Google Kubernetes Engine (GKE)

Follow the guide to create a GKE cluster.


Deploy Mage using Helm

Mage helm repo: https://mage-ai.github.io/helm-charts/

Add Helm repository

helm repo add mageai https://mage-ai.github.io/helm-charts

Install Helm charts with default config

helm install my-mageai mageai/mageai

Customize deployment

You can customize the deployment by updating the values.yaml file.

  • Get the values.yaml with the command

    helm show values mageai/mageai > values.yaml
    
  • Customize the mount volume

    • Local: Edit the volumes config in values.yaml to mount to your Mage project path
    • AWS EKS: Provision the Elastic File System and create the PersistentVolumeClaim (using ReadWriteMany access mode). Then edit the volumes config to
      volumes:
        - name: mage-fs
          persistentVolumeClaim:
              claimName: pvc-name
      
    • GKE: Provision the PersistentVolume and create the PersistentVolumeClaim (using ReadWriteMany access mode) and edit the volumes config to
      volumes:
        - name: mage-fs
          persistentVolumeClaim:
              claimName: pvc-name
      
    • Azure: Provision the PersistentVolume and create the PersistentVolumeClaim (using ReadWriteMany access mode) and edit the volumes config to
      volumes:
        - name: mage-fs
          persistentVolumeClaim:
              claimName: pvc-name
      
  • Install the Helm charts with updated values.yaml

    helm install --values path/to/values.yaml my-mageai mageai/mageai
    

Releases

https://github.com/mage-ai/helm-charts/releases