🚀 DevOps Deployment: Dockerize and Deploy a 3-Tier App with Helm on Kubernetes
As modern applications evolve, DevOps workflows bridge the gap between development and operations. In this post, we’ll walk through how to Dockerize a 3-tier web application—consisting of a frontend, backend, and PostgreSQL database—and deploy it to a Kubernetes cluster using a custom Helm chart.
You’ll learn:
- How to structure a 3-tier app for containerization
- Dockerfile tips for Go-based services
- Kubernetes deployment best practices
- How to create a reusable Helm chart for real-world deployments
🧱 3-Tier Architecture Overview
We’ll build and deploy the following:
- Frontend – a static site (React, Vue, or Hugo)
- Backend – a Go HTTP API
- Database – PostgreSQL
graph TD
client[Browser]
client --> nginx[Frontend Nginx]
nginx --> goapi[Backend Go App]
goapi --> pg[PostgreSQL DB]
📦 Step 1: Dockerize Each Tier
🔹 Frontend Dockerfile (e.g., Hugo + Nginx)
|
|
🔹 Backend Dockerfile (Go API)
|
|
🔹 PostgreSQL (Official Image)
No Dockerfile needed, just reference postgres:15-alpine in your docker-compose.yml or Kubernetes deployment.
🧪 Step 2: Local Testing with Docker Compose
Use Compose to test locally before pushing to Kubernetes:
|
|
✅ Once confirmed working, you’re ready for the cluster.
☸️ Step 3: Prepare Kubernetes Manifests
Break deployments into individual resources: Deployment
, Service
, ConfigMap
, and Secret
. Then, template them using Helm
.
📦 Step 4: Create a Custom Helm Chart
|
|
This generates:
|
|
Example: frontend-deployment.yaml
|
|
Example: values.yaml
|
|
🚢 Step 5: Deploy to Kubernetes
|
|
Need to update?
|
|
🧹 Cleanup
|
|
🎯 Final Thoughts
By combining Docker, Kubernetes, and Helm, you get:
- A repeatable deployment pipeline
- Configurable environments per stage (via Helm)
- Easy rollbacks and upgrades
Helm lets you treat infrastructure like code—enabling DevOps best practices like versioning, templating, and CI/CD automation.
🚀 Follow me on norbix.dev for more insights on Go, system design, and engineering wisdom.