This repository follows a GitOps workflow to deploy a Flask-based web application using:
- Local Kubernetes Cluster:
k3d
for lightweight cluster management - Cluster Management:
Azure Arc
to integrate with Azure - GitOps CD Operator:
FluxCD
for automated deployments - CI/CD:
GitHub Actions
/CircleCI
for Continuous Integration - Containerization:
Docker
📦 gitOps-project
├── 📂 .github/workflows # GitHub Actions CI/CD pipeline
├── 📂 env # Environment code web
│ ├── 📂 arc_and_ fluxCD # Kubernetes manifests for FluxCD
│ ├── 📂 terraform # Terraform scripts
│ └── k3d-config-file # Config file for k3d cluster setup
├── 📂 app # Flask web application source code
│ ├── app.py
│ ├── templates/
│ ├── requirements.txt
│ └── Dockerfile
├── 📂 images # screenshots
└── README.md
- Migrating from GitHub to Azure DevOps
✅ Automate infrastructure deployment using GitOps principles
✅ Ensure reproducibility and consistency using FluxCD
✅ Manage a local k3d cluster integrated with Azure Arc
✅ CI/CD integration with GitHub Actions or CircleCI
✅ Containerize the Flask app and deploy it to Kubernetes
Ensure you have the following installed:
- Docker: Install Docker
- K3d (K3s in Docker): Install K3d
- kubectl (Kubernetes CLI): Install kubectl
- FluxCD: Install Flux
- Azure CLI (For Arc): Install Azure CLI
k3d cluster create gitops-cluster --servers 1 --agents 2 -p "8080:8080@loadbalancer"
kubectl get nodes # Verify cluster is running
az login
az connectedk8s connect --name gitops-cluster --resource-group my-resource-group
flux bootstrap github \
--owner=<GITHUB_USERNAME> \
--repository=<GITHUB_REPO> \
--path=./manifests \
--personal
kubectl apply -f manifests/
A GitHub Actions pipeline (.github/workflows/deploy.yml
) is included to:
- Build & push the Docker image
- Update Kubernetes manifests
- Trigger a FluxCD sync
A .circleci/config.yml
is also available for CircleCI integration.
To trigger deployments, push changes to the repository:
git add .
git commit -m "Deploy new version"
git push origin main
After deployment, access the Flask app via:
kubectl port-forward svc/webapp-service 8080:8080
Then visit:
📌 http://localhost:8080
# Check FluxCD sync status
flux get all
# List running pods
kubectl get pods -n default
# View app logs
kubectl logs -l app=webapp
Contributions are welcome! Feel free to submit a pull request.
If you have any issues, open a GitHub Issue or contact me. 🚀