Shobhit Sharma
Posted on:August 5, 2025 at 01:12 AM

GitOps: The right way to do DevOps

I used to dread managing my Kubernetes cluster. What started as excitement about container orchestration quickly turned into going crazy managing various YAML files, copy-pasting commands into the CLI, and the constant fear that I’d forget to update something important. One wrong command could break everything, and I’d have no idea what the “correct” state was supposed to be.

Then I discovered Flux CD, and it completely changed how I think about infrastructure management.

What I Was Doing Wrong

Before Flux, my workflow was a mess. I’d go crazy managing various YAML files, copy-pasting commands into the CLI, and constantly fight configuration inconsistencies. I’d make a change, forget to commit it, and weeks later wonder why my cluster wasn’t behaving the way I expected.

The breaking point came when I realized I had no idea what was actually running in my cluster. I’d made so many manual changes that my Git repository was completely out of sync with reality. That’s when I knew I needed a different approach.

How Flux Changed Everything

Flux is a GitOps tool that runs inside your cluster and continuously watches your Git repository. When I push a change, Flux automatically applies it. But more importantly, it also works in reverse—if someone (or something) changes the cluster directly, Flux detects the drift and reverts it back to match what’s in Git.

This pull-based approach means Flux runs inside the cluster and pulls configuration from Git, rather than requiring external systems to push changes. I don’t need to store cluster credentials in my CI/CD system anymore, which feels much more secure.

What I Love About It

The biggest win for me has been eliminating configuration drift. I used to worry about manual changes getting lost or forgetting to commit updates. Now, Flux’s reconciliation loop continuously checks that my cluster matches Git, and automatically fixes any deviations.

Deployments are now just git pushes. I update a YAML file, commit, and push. Flux handles the rest—applying changes, managing Helm charts, and even watching container registries to update image tags automatically.

Managing multiple environments became trivial too. I point each environment to different branches or paths in my repository, and Flux handles the rest. No more copying YAML files between directories or forgetting to update one environment.

I also appreciate how Flux handles secrets. It integrates with Mozilla SOPS, so I can store encrypted secrets in Git while keeping the GitOps workflow intact. Everything stays version controlled, but nothing sensitive is exposed.

The Peace of Mind

The real game-changer has been trust. I know my cluster always matches what’s committed in Git. If something breaks, I check the Git history, revert the change, and Flux automatically applies the fix. I don’t have to remember what I changed or when—it’s all in the commit history.

Whether I’m managing my homelab or working with production clusters, Flux has transformed Kubernetes from a maintenance nightmare into something I can actually trust. Once it’s set up, managing my entire infrastructure is as simple as pushing to Git. I can’t imagine going back to the old way.

Open to Collaboration

Hey there! If you've got a new project brewing in your head, or just want to share something cool, or even just drop a casual hi, please feel free to hit me up! It's always great to connect with folks who stop by, so don't be shy!