5. C# App on Kubernetes
What we’re building
A small full-stack application — frontend and backend in a single ASP.NET Core container — deployed onto the AKS cluster provisioned in the previous chapters and backed by a managed PostgreSQL database.
| Component | Technology | Details |
|---|---|---|
| Frontend | Static HTML served by ASP.NET Core | Input box + submit button; displays all submitted texts below |
| Backend | ASP.NET Core minimal API | POST /texts writes timestamp + text; GET /texts returns JSON |
| Database | PostgreSQL (Azure Flexible Server) | Automatic SQLite fallback when DB_CONNECTION_STRING is not set |
The fallback to SQLite means the app runs entirely locally with dotnet run — no database server needed
during development.
Delivery path
- Build the app and run it locally (SQLite)
- Containerize and push the image to ACR
- Deploy to Kubernetes with
kubectland raw YAML - Provision a managed PostgreSQL database with Pulumi
- Replace the raw manifests with Pulumi-managed Kubernetes resources
- (Stretch) Package everything as a Helm chart