Goal
A GitOps loop where a commit is the only way to change the cluster: an Argo CD app-of-apps, a Helm chart with three environments, a Gateway API entry point and trusted HTTPS certificates that renew themselves.
- App of appsOne root Application points at child Applications for the platform and for each environment.Done
- Helm chartOne chart, three values files: dev, staging and prod.Done
- Gateway APIEnvoy Gateway routes /api and /ws to the api and everything else to the web app.Done
- Automatic TLScert-manager issues and renews Let's Encrypt certificates.Done
- Self-healManual changes to the cluster are reverted to what Git says.Done
Steps and commands
Run these in dev first. Every step has a check that proves it worked, so you are never guessing.
Build and push the images
az acr build uploads the source and builds inside Azure, so you do not need Docker on your machine.
$ az acr build -r paktechacr -t paktech-chat-api:$TAG . $ az acr repository show-tags -n paktechacr --repository paktech-chat-api -o tsvCheck: the tag appears for both the api and web repositories.Lint and render the chart
Catch template mistakes before Argo CD finds them in the cluster.
$ helm lint charts/paktech-chat -f environments/dev/values.yaml $ helm template dev charts/paktech-chat -f environments/dev/values.yaml | head -60Check: helm lint reports 0 charts failed and the template prints valid YAML.Install Argo CD and apply the root app
This is the one thing you apply by hand. After it, Git drives everything.
$ kubectl -n argocd rollout status deploy/argocd-server --timeout=5m $ kubectl apply -f bootstrap/root-app.yaml $ kubectl -n argocd get applications -wCheck: the child applications appear and turn Synced and Healthy.Check the gateway and the certificates
The edge resources must be programmed before TLS can be issued.
$ kubectl get gatewayclass $ kubectl get gateway -n edge $ kubectl get certificate -ACheck: the gateway is Programmed and every certificate is Ready.Prove self-heal
Change the cluster by hand and watch Argo CD undo it.
$ kubectl -n paktech-chat-dev patch deployment web -p '{"spec":{"replicas":3}}' $ kubectl -n paktech-chat-dev get deploy web -wCheck: the deployment returns to one replica within seconds, with no Git change.
Workflow
A change reaches the cluster only through Git. Sync waves order the work inside Argo CD.
- STEP 1CommitTo the GitOps repo
- STEP 2Argo CDDetects the change
- STEP 3RenderHelm chart + values
- STEP 4SyncIn wave order
- STEP 5HealthyPods ready
Rollback: Revert the commit in the GitOps repository. Argo CD reconciles the cluster back to it.
Diagram




Issues met
These are real, from the run. The surprises are the useful part.
Trade-offs
Why: ingress-nginx is being retired and the Gateway API is the direction Kubernetes is moving. It also makes it easy to expose only /api and /ws.
It costs: Newer API, fewer examples, and a few more resources to understand.
Why: A broad ignore rule hides real drift along with the harmless kind.
It costs: You have to read the diff and write a precise jqPathExpression.