
main. Merging to the protected main branch automatically triggers a pipeline with additional stages compared with a feature-branch pipeline: build, test, review (DAST), staging, and manual production rollout jobs that enable incremental canary promotion. The pipeline also includes performance and cleanup jobs.

staging job deploys the application into the staging namespace. Verify the deployed resources with kubectl (or your alias k):
STAGING_ENABLED, CANARY_ENABLED, and PRODUCTION_MANUAL.
You can toggle staging and production behaviors with CI/CD variables:
STAGING_ENABLED=trueenables the staging step.CANARY_ENABLED=trueenables canary-style deployments.PRODUCTION_MANUAL=truerequires manual jobs for production rollouts (useful with protected environments).
Production state before changes
Before launching any rollout, check the current production resources:



- Validate Kubernetes domain and kubecontext.
- Fetch or use the built-in Helm chart for your app.
- Ensure the
productionnamespace exists. - Create or update any required Kubernetes secrets.
- Install a canary Helm release (for example,
production-canary) into theproductionnamespace. - Create a canary-specific Ingress annotated with a weight to split traffic.
- Persist the environment URL as a job artifact.
nginx.ingress.kubernetes.io/canary: "true"marks the ingress resource as a canary target.nginx.ingress.kubernetes.io/canary-weight: "10"instructs the ingress controller to route ~10% of requests to the canary backend and the remainder to stable.nginx.ingress.kubernetes.io/canary-by-header: canaryenables header-based routing if you want deterministic routing for tests.
/os):
production-canary-* pods.
UI verification
From the browser you may notice small visual differences when a canary is active. In this demo the canary uses a static, non-spinning solar system background while the stable production uses a dynamic/spinning version. Refreshing the page repeatedly will intermittently show the canary UI for some requests.

production-canary Helm release and updates the canary ingress annotation, for example:
production-canary-* pods.
Rolling out 100% (promote canary to stable)
When you approve the 100% rollout, Auto DevOps promotes the canary to stable:
- Update the
productionHelm release with the new version. - Wait for the stable rollout to complete.
- Uninstall the
production-canaryrelease and delete canary-specific secrets/resources. - Persist the environment URL and finish the job.
production-* pods remain:
Once you perform a 100% rollout (promotion), the canary release is removed and the new version becomes the stable production release. You cannot reduce the production rollout percentage after promotion — to revert to a previous version you must perform a rollback to an earlier release.
- Merging into
maintriggered the Auto DevOps pipeline that runs review, staging, and manual production rollouts. - Staging validates the deployment in its own namespace, and Auto DevOps can create temporary DAST environments for security scans.
- Production rollouts are manual when the environment is protected and support incremental canary percentages (10%, 25%, 50%, 100%) — each percentage maps to a manual job requiring approval.
- The canary is deployed as a separate Helm release plus an Ingress annotated for weighted routing. The ingress weight (not pod counts) determines the traffic split.
- Promoting to 100% updates the stable
productionrelease and deletes canary resources. - To revert after a 100% promotion, perform a rollback to a previous release.

- GitLab Auto DevOps and deployment strategies: https://docs.gitlab.com/ee/topics/autodevops/
- Helm — The Kubernetes Package Manager: https://helm.sh/docs/
- NGINX Ingress Controller annotations for canary deployments: https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/