The pipeline had stalled. Deploys were green, but traffic was backing up. The fix required precision: run a Git checkout, update service routing, and point workloads to an external load balancer without downtime.
Using git checkout with an external load balancer is common in multi-environment CI/CD workflows. You check out the build artifact or branch you need, deploy it to a staging or production cluster, and update the load balancer config to route requests to the new deployment. This keeps zero-downtime rollouts predictable and reversible.
Start by checking out the commit or branch that contains the service code or deployment manifests:
git fetch origin
git checkout release-2024-05
Build and push the container image from this state. Once the image is deployed to your cluster, configure your external load balancer (AWS ELB, Google Cloud Load Balancing, or NGINX with external routing) to target the new service endpoints. Ensure health checks are active before draining old nodes.
When dealing with external load balancers in Git-driven deployments, automation is key. Integrate the checkout and balancer update steps into your deployment pipeline so rollbacks are as simple as checking out the previous commit and reapplying the config. Use infrastructure-as-code tools to define load balancer settings alongside application code, so you can store and version them in Git.
Security matters. Restrict load balancer admin APIs to your CI/CD service account. Track changes in Git to see exactly when and why routing was modified. This is crucial for audit compliance and postmortems.
Performance tuning is also critical. Review TTLs for DNS records, idle timeouts, and connection draining behavior. Proper settings reduce pressure during a deploy and keep user sessions stable while you switch traffic.
The synergy of git checkout and external load balancer control gives teams complete control over which version of code is live and where traffic flows. It’s scriptable, testable, and works at massive scale.
See how fast you can run a Git-powered deployment with live load balancer updates—spin it up in minutes at hoop.dev.