This repo uses a minimal GitOps workflow:
- GitHub Actions builds a Docker image on every push
- The image is pushed to Docker Hub with a unique tag (the commit SHA)
- The workflow updates the Kubernetes manifest to reference that new image tag
- Argo CD detects the manifest change in Git and deploys automatically to your local Kubernetes cluster
- Create a Docker Hub repository (example:
docker.io/<your-user>/flask-app) - Create a Docker Hub Access Token
In GitHub: Settings → Secrets and variables → Actions
Add:
DOCKERHUB_USERNAMEDOCKERHUB_TOKEN
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yamlkubectl create namespace flask-appkubectl -n argocd port-forward svc/argocd-server 8080:443Open https://localhost:8080
Get the admin password (PowerShell):
$pw_b64 = kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}"
[Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($pw_b64))In Argo CD:
- New App
- Repo URL: your GitHub repo
- Revision:
main - Path:
k8s - Destination namespace:
flask-app - Sync policy: Automated
On every push to main:
- builds the Docker image
- pushes it to Docker Hub as:
docker.io/<your-user>/flask-app:<commit-sha> - updates the manifest in
k8s/to use that new SHA tag - commits and pushes the manifest update back to
main
Argo CD sees the new commit and deploys it.
- Make a change to the app (even just a color/text change)
- Commit and push to
main - Watch GitHub Actions run
- After a short delay, Argo CD deploys automatically
If you exposed the app as NodePort 30080, you can access it at:
http://localhost:30080
On a local cluster, Argo CD usually checks Git every few minutes.
You can also press Refresh in the Argo CD UI to make it check immediately.