Skip to content

Infrastructure Overview

BANA uses separate Kubernetes clusters for staging and production on VNPAY Cloud. Both share the same Kustomize base but differ significantly in architecture maturity.

StagingProduction
PurposeInternal testing, demos, integration envLive traffic
Domainsgw.staging.bana.com.vn (API), *.staging.bana.com.vn (frontend)TBD
Nodes6 (3 control-plane managed by VNPAY + 2 default + 1 stateful)7+ (2 system + 3 app + 2 stateful)
Ingressnginx-ingress (single)nginx-ingress (HA pair)
API GatewayTraefik (single)Traefik (HA pair)
CDManual kubectl applyGitLab CI/CD pipelines
SecretsManual (create-secrets.sh)Sealed Secrets
TLScert-manager with Let's Encryptcert-manager
ScalingManualHPA + PDB + topology spread
MonitoringPrometheus + Grafana + LokiPrometheus + Grafana + Loki + Tempo + OTel

Traffic Flow

The architecture separates edge ingress (nginx-ingress) from API gateway (Traefik). Traefik is not an ingress controller — it's a backend API gateway with rate limiting, circuit breaking, and security headers.

Design Principles

PrincipleDecisionRationale
Separate clustersStaging + ProductionZero blast radius, independent scaling
Edge vs Gatewaynginx-ingress (edge) + Traefik (API gateway)Separation of concerns — TLS/static vs API middleware
CI/CDGitLab CI/CD + GitLab Container RegistryTeam already uses GitLab
TLScert-manager with Let's EncryptAuto-renewal, no manual cert management
ConfigKustomize overlaysSame base, different overlays per environment
SecretsManual create-secrets.sh (staging) / Sealed Secrets (production)Staging uses manual creation, production uses Git-safe encryption
Identity-firstInit containers wait for identityAll VerifierApps need JWKS from IssuerApp
MigrationsK8s Jobs before deploymentSeparate from runtime, idempotent
Payment split2 Deployments from 1 imageapi, worker via APP_MODE env
Signal dual-routeREST with middleware, WebSocket withoutNo rate-limit on persistent connections

Documentation Structure

PageDescription
Multi-Tenancy (PRD)Tenant isolation tiers (Pool / Bridge / Silo) and tenant migration strategy
DecisionsCross-cutting infrastructure ADRs
Cluster DesignNode pools, namespaces — staging vs production
WorkloadsEvery Deployment/StatefulSet spec
Networkingnginx-ingress + Traefik API gateway, TLS, routing
Data LayerPostgreSQL, Redis, Kafka, Typesense
ConfigurationConfigMaps, Secrets, env var mapping
ObservabilityPrometheus, Grafana, Loki, Tempo, OpenTelemetry
Security & HardeningPod security, RBAC, image supply chain, PriorityClass
OperationsGitLab CI/CD, migrations, deployment procedures

Proprietary and Confidential. Unauthorized copying, distribution, or use of this software is strictly prohibited.