Documentation/Deployment/Kubernetes
Kubernetes Deployment Guide
Deploy B2ALABS SMART GATEWAY to production Kubernetes in 45 minutes with PostgreSQL, Redis, and full observability.
⏱️ 45 minutes•📊 Intermediate•Last updated: Oct 9, 2025
Overview
This guide walks you through deploying B2ALABS SMART GATEWAY to a production Kubernetes cluster. You'll deploy:
- Gateway API with 3 replicas and auto-scaling
- Next.js Web Platform
- PostgreSQL 16 database with persistent storage
- Redis 7 for caching and rate limiting
- Full observability: Prometheus, Grafana, Loki, Tempo
- NGINX Ingress with TLS/SSL
Prerequisites
Required Tools
# kubectl - Kubernetes CLI
kubectl version --client
# Verify cluster access
kubectl cluster-infoCluster Requirements
- Kubernetes: 1.24 or higher
- Storage: StorageClass with dynamic provisioning
- Load Balancer: Cloud provider or MetalLB
- Resources:
- Minimum: 8 CPU, 16GB RAM
- Recommended: 16 CPU, 32GB RAM
Step-by-Step Deployment
💡 Quick Deploy
Deploy everything at once using Kustomize:
kubectl apply -k infrastructure/kubernetes/base/Step 1: Create Namespace
kubectl apply -f infrastructure/kubernetes/base/namespace.yaml
kubectl get namespace b2alabsStep 2: Configure Secrets
# Copy example and edit with your values
cp infrastructure/kubernetes/base/secrets.example.yaml \
infrastructure/kubernetes/base/secrets.yaml
# Apply secrets
kubectl apply -f infrastructure/kubernetes/base/secrets.yamlStep 3: Deploy Database
kubectl apply -f infrastructure/kubernetes/base/postgres-statefulset.yaml
kubectl wait --for=condition=ready pod -l app=postgres -n b2alabs --timeout=300sVerification & Health Checks
# Check all pods
kubectl get pods -n b2alabs -o wide
# Test gateway health
kubectl port-forward -n b2alabs svc/b2alabs-gateway 8080:8080
curl http://localhost:8080/healthFrequently Asked Questions
What are the minimum requirements?
Kubernetes 1.24+, 8 CPU cores, 16GB RAM, StorageClass with dynamic provisioning, and a load balancer. Recommended: 16 CPU, 32GB RAM for production.
How long does deployment take?
30-45 minutes for manual step-by-step deployment. 15-20 minutes using Kustomize for automated deployment.
Does it support auto-scaling?
Yes, includes HPA (Horizontal Pod Autoscaler) for automatic scaling from 3 to 10 replicas based on CPU and memory metrics.
Related Documentation
Need Help?
Join our community or contact support for assistance with deployment.
Was this page helpful?
