This repository automates the CI/CD deployment of a Fullstack application (backend + frontend) on Azure Kubernetes Service (AKS) using Jenkins. The pipeline handles Azure login, Docker image builds, ACR pushes, Kubernetes secrets management, and service deployment using manifests.
- 🧱 Terraform (for infrastructure provisioning - optional)
- ☸️ Azure Kubernetes Service (AKS)
- 🐳 Docker + Azure Container Registry (ACR)
- 📦 Backend & Frontend app
- 🔐 Jenkins Credentials
- 🧾 Kubernetes YAML files
| Variable | Description | Source (Jenkins Credentials) |
|---|---|---|
DB_URL |
Database URL | john_url |
DB_USER |
Database username | john_username |
DB_PASSWORD |
Database password | john_password |
azure_principle |
Azure Service Principal (SPN) | Azure App Registration SPN |
- Logs into Azure using a service principal.
- Fetches credentials for the AKS cluster named
dilliin resource groupterra-resource.
- Authenticates into Azure.
- Logs into ACR:
billgates.azurecr.io.
- Builds the Docker image from the
./backenddirectory.
- Pushes the image to ACR:
billgates.azurecr.io/backend
- Uses
kubectlto create Kubernetes secrets:kubectl create secret generic db-credentials \ --from-literal=DB_URL=$DB_URL \ --from-literal=DB_USER=$DB_USER \ --from-literal=DB_PASSWORD=$DB_PASSWORD
- Applies the
./yamlat/backend.yamlmanifest to deploy the backend.
- Executes
./frontend/ip.shto dynamically configure frontend with backend IP (e.g., environment replacement).
- Builds the frontend Docker image from
./frontend.
- Pushes the image to:
billgates.azurecr.io/frontend
- Applies the
./yamlat/frontend.yamlmanifest to deploy the frontend.
| ID | Description |
|---|---|
azure_principle |
Azure service principal for az login |
john_url |
DB URL for backend |
john_username |
DB username for backend |
john_password |
DB password for backend |
- Ensure ACR is enabled for admin access or assign proper RBAC.
- The script assumes ACR is
billgatesand AKS isdilliin RGterra-resource. - Update YAML files (
yamlat/backend.yaml&frontend.yaml) to reference the correct image paths and secrets.
# Test AKS credentials locally
az aks get-credentials --resource-group terra-resource --name dilli
# Verify deployment
kubectl get pods
kubectl describe svc <service-name>atharrvv
🔗 GitHub