Skip to content

Deployment

This guide walks you through deploying Menatic AI on a Kubernetes cluster using kubectl and the provided manifests.

  • Kubernetes cluster (1.28+) with kubectl access
  • Docker registry accessible from the cluster
  • Traefik ingress controller installed
  • cert-manager for TLS (optional but recommended)
Terminal window
git clone https://github.com/menatic-ai/ftn-ai.git
cd ftn-ai

Copy the example configuration and edit values for your environment:

Terminal window
cp k8s/config.example.yaml k8s/config.yaml

Key configuration values:

VariableDescription
DOMAINBase domain for ingress (e.g., ai.example.com)
JWT_SECRETSecret key for JWT signing (generate with openssl rand -hex 32)
DB_PASSWORDDatabase password
ADMIN_PASSWORDInitial admin password
Terminal window
# Build backend
docker build -t your-registry/ftn-ai-backend:latest ./backend
docker push your-registry/ftn-ai-backend:latest
# Build frontend
docker build -t your-registry/ftn-ai-frontend:latest ./frontend
docker push your-registry/ftn-ai-frontend:latest
Terminal window
kubectl create namespace ftn-ai
kubectl create namespace apps
Terminal window
kubectl apply -f k8s/rbac/

This creates the necessary ClusterRole and ClusterRoleBinding so the backend can manage workloads across namespaces.

Terminal window
kubectl apply -f k8s/

This deploys:

  • Backend API server
  • Frontend (Next.js)
  • PostgreSQL database
  • Traefik ingress rules
Terminal window
kubectl get pods -n ftn-ai

All pods should reach Running status within a few minutes.

The dashboard requires metrics-server for real-time CPU and memory usage:

Terminal window
# For k3d / local clusters:
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
# For k3d, patch to disable TLS verification:
kubectl patch deployment metrics-server -n kube-system \
--type=json \
-p='[{"op":"add","path":"/spec/template/spec/containers/0/args/-","value":"--kubelet-insecure-tls"}]'
# For managed clusters (EKS, GKE, AKS):
# metrics-server is usually pre-installed or available via the cloud provider add-on

Navigate to https://your-domain and log in with the admin credentials configured in Step 2.

For local development, use k3d to run a cluster with a local image registry:

Terminal window
# Create cluster with registry
k3d cluster create ftn-ai \
--registry-create localhost:5050 \
-p "80:80@loadbalancer" \
-p "443:443@loadbalancer"
# Build and push to local registry
docker build -t localhost:5050/ftn-ai-backend:latest ./backend
docker push localhost:5050/ftn-ai-backend:latest

To upgrade the platform, rebuild and push new images, then roll out the deployments:

Terminal window
kubectl rollout restart deployment/ftn-ai-backend -n ftn-ai
kubectl rollout restart deployment/ftn-ai-frontend -n ftn-ai