CI/CD & Deployment
KubeVela + CNPG Deployment (Kubernetes)¶
Team Health Check supports deployment to Kubernetes via KubeVela (Open Application Model) with CloudNativePG for production-grade PostgreSQL.
Prerequisites¶
- Docker (for building images)
- k3d (lightweight k3s-in-Docker for local clusters)
- kubectl (Kubernetes CLI)
- Helm (installed automatically for operator setup)
- KubeVela CLI (
vela) — installed automatically by Makefile targets /etc/hostsentry:127.0.0.1 teams360.local
Quick Start¶
# Full pipeline: create cluster, install operators, build images, deploy
make kubevela-deploy-all
# Monitor deployment (CNPG needs ~90s to bootstrap)
make kubevela-status
# Access the app
open http://teams360.local:8080/ # Frontend
curl http://teams360.local:8080/api/v1/health-dimensions # API
# Quick rebuild after code changes (skip cluster/operator setup)
make kubevela-deploy-quick
# Tear down
make kubevela-delete # Remove application
make kubevela-k3d-delete # Remove cluster
Architecture Overview¶
| File | Purpose |
|---|---|
kubevela/components/cnpg.cue |
CUE definition: cloud-native-postgres component type (renders CNPG Cluster CR) |
kubevela/components/gateway.cue |
CUE definition: gateway trait (renders Service + Ingress, k3d/Traefik only — production deployments should define their own ingress) |
kubevela/teams360-kubevela.yaml |
KubeVela Application manifest (2 components + ordered workflow) |
Makefile.kubevela |
All kubevela-* Make targets for automation |
Deployment workflow (defined in the YAML):
1. deploy-database — CNPG PostgreSQL cluster (1 instance, 0.5Gi)
2. wait-for-infrastructure — 90s suspend for CNPG to create cluster + secrets
3. deploy-app — Unified app container (Go API serving static frontend; gets DATABASE_URL from CNPG secret via service-binding)
Verification Checklist¶
After make kubevela-deploy-all, verify:
make kubevela-deploy-allcompletes from clean state- CNPG operator running:
kubectl get pods -n cnpg-system - KubeVela operator running:
kubectl get pods -n vela-system - PostgreSQL pod(s) running:
kubectl get pods -n teams360 -l cnpg.io/cluster=postgres - App pod running and healthy:
kubectl get pods -n teams360 -l app.oam.dev/component=app - Frontend loads:
curl -s http://teams360.local:8080/ - API returns data:
curl -s http://teams360.local:8080/api/v1/health-dimensions - Login with
demo/demoworks through the browser make kubevela-deletecleanly removes the appmake kubevela-k3d-deleteremoves the cluster