$ cat post/the-function-returned-/-we-documented-nothing-then-/-the-daemon-still-hums.md

the function returned / we documented nothing then / the daemon still hums


March 8, 2021: Debugging Kubernetes’ Complexity with ArgoCD

Today is a day to reflect on the journey of debugging and implementing a solution for our team’s Kubernetes infrastructure. We’ve been wrestling with the complexity that comes with managing multiple clusters and services, and we finally hit upon a silver bullet in the form of ArgoCD.

The Problem: Multiple Clusters, Manual Pain

We have several Kubernetes clusters scattered across different environments—development, staging, production, etc. Every time a feature gets pushed to a new environment, there’s manual intervention required to sync the changes. This process is error-prone and incredibly tedious. It’s like having 20 different databases that you need to keep in sync manually. Not fun.

To add another layer of complexity, we use Flux for our GitOps operations across these clusters. While it helps a lot with keeping things in sync, it doesn’t cover all the scenarios we need. We still end up with manual deployments and rollbacks, which is a no-no when you’re talking about production environments.

The Solution: ArgoCD

ArgoCD entered our radar as a potential savior. It promised to take over the manual synchronization of Kubernetes resources from GitOps repositories. With its declarative approach, it can keep all your clusters in sync automatically, much like Flux does but with a broader scope and better automation.

We set up an initial test cluster to experiment with ArgoCD. We thought it would be straightforward—just follow the docs, configure the repo and sync rules, and we’re good to go. But as always, reality hit us hard.

The Hurdles: Configuration Hell

Setting up ArgoCD wasn’t just about following instructions; there were a myriad of configuration details that needed to be ironed out. One of the biggest issues was ensuring that our Kubernetes RBAC (Role-Based Access Control) policies allowed ArgoCD to do its thing without overstepping boundaries. We had to meticulously review and adjust permissions until everything worked smoothly.

Another hurdle was dealing with custom resource definitions (CRDs). Some of our services use CRDs, which weren’t as well-supported in ArgoCD at the time. We spent a lot of time figuring out how to map these CRDs to Kubernetes resources that ArgoCD could understand. It wasn’t glamorous, but it had to be done.

The Victory: Continuous Integration for Cluster Management

After weeks of debugging and fine-tuning, we finally hit the sweet spot. Now, our teams can push changes to GitOps repos, and ArgoCD takes care of deploying them across all environments without manual intervention. It’s like having a continuous integration pipeline but for cluster management.

The impact on our development process has been immense. We’ve reduced deployment errors by 80% and significantly cut down the time spent on manual syncs. Teams can now focus more on writing code rather than worrying about infrastructure details.

Lessons Learned

This journey taught us that while Kubernetes is a powerful tool, it’s not without its own set of complexities. ArgoCD helps mitigate some of these issues but requires thoughtful setup and ongoing maintenance. The key takeaway for me was the importance of having robust GitOps strategies in place to ensure consistency across environments.

Looking back, I realize how much I’ve grown as an engineer during this process. From wrestling with RBAC policies to understanding CRDs, every problem we solved brought us closer to a more efficient and reliable infrastructure.

Looking Ahead

As we continue to scale our operations, we’ll keep ArgoCD at the forefront of our GitOps strategy. The path ahead isn’t easy, but with the right tools and methodologies, we can ensure that our teams are productive and our systems are robust.


That’s where we stand today. There’s still a long way to go, but I’m confident that as we continue to evolve our infrastructure practices, we’ll be better equipped to handle the challenges ahead.