Kubernetes · Docker · FastAPI · MongoDB · React · Node.js

CKsFinBot

Problem

Migrate a multi-service AI financial analysis platform from a serverless setup to Kubernetes for better control over scaling, networking, and stateful storage.

Architecture

CKsFinBot Kubernetes ArchitectureKubernetes ClusterIngress ControllerReact FrontendDeployment (2 replicas)ClusterIP ServiceNode.js APIDeployment (3 replicas)ClusterIP ServiceFastAPI AIDeployment (2 replicas)ClusterIP ServiceMongoDBStatefulSet + PVCHeadless ServiceConfigMapsSecrets

Key Decisions

  • Kubernetes Deployments for stateless services — FastAPI and Node.js backends with configurable replica counts for horizontal scaling.
  • MongoDB as a StatefulSet with PersistentVolumeClaim — ensures data durability and stable network identities across pod restarts.
  • ClusterIP Services for internal communication — services talk to each other without external exposure.
  • Ingress resource for external HTTP routing — single entry point with path-based routing to different backends.
  • ConfigMaps and Secrets for environment configuration — no hardcoded credentials, environment-agnostic manifests.

Outcome

Successfully migrated from serverless to self-managed Kubernetes. Gained fine-grained control over scaling, networking, and persistent storage. Reduced cold-start latency and improved reliability.

Stack

KubernetesDockerFastAPIMongoDBReactNode.jsIngress