Looking for a new opportunity as DevOps engineer
I am currently seeking a new opportunity as a DevOps Engineer, available from January 2026. I am open to remote or hybrid work from Prague, Czechia (Europe), for a long-term, full-time position or B2B contract. Please feel free to contact me for further details. You can also review my professional background on my LinkedIn profile.
SOPS Git Hooks for Kubernetes Secrets Management
I decided to build a Git-based tool to manage Kubernetes secrets more efficiently. The whole idea was to automatically encrypt password and value fields in my Kubernetes YAML and Helm files before committing them into Git, and decrypt them effortlessly when checking out.
I wanted to share something pretty exciting that I’ve been working on lately. If you’ve ever dabbled in Kubernetes, you know managing secrets can sometimes feel like trying to solve a Rubik’s Cube blindfolded. So, I decided to take matters into my own hands and came up with a solution that has the potential to make our lives a lot easier.
The Inspiration Behind the Project#
Managing Kubernetes secrets in a secure yet straightforward manner has always been a headache, especially in smaller deployments. Most existing solutions felt like using a sledgehammer to crack a nut — powerful but overcomplicated. Tools like HashiCorp Vault are fantastic at scale, yet too heavy for single-node clusters.
So, the goal was simple: create something lightweight, secure, and practical. Something that doesn’t add unnecessary complexity but still keeps secrets safe.
My Approach#
Drawing on some automation and AI-driven logic, I built a Git-based tool that automatically encrypts sensitive values in Kubernetes YAML and Helm files before committing them, and decrypts them again after checkout. In other words, secrets are always stored encrypted in Git, but remain simple to work with locally.
The Problem It Solves#
One of my biggest frustrations with SOPS (Secrets OperationS by Mozilla) is how it encrypts files differently each time — even when the actual content hasn’t changed. This causes Git history noise, making it hard to see real modifications.
My solution uses hashing to detect whether a secret truly changed before re-encrypting. If it’s identical, the tool skips re-encryption, keeping the Git history clean and meaningful.
The Technical Grit#
I chose AGE (a modern encryption tool) for key management because of its balance between simplicity and security. Then, I implemented a Git pre-commit hook that detects and encrypts secrets automatically, and a post-checkout hook that decrypts them when switching branches or environments.
In practice:
- Changes trigger automatic encryption before you commit.
- Secrets decrypt instantly when checking out or deploying.
This makes the workflow fully transparent while keeping your repository secure.
Why It’s a Game-Changer for Me#
This tool completely transformed how I handle Kubernetes configurations. It checks the boxes for security, efficiency, and simplicity. No risk of leaking secrets in Git, no manual encryption steps, and no bloated tools to maintain.
Sharing Is Caring#
After realizing how much this improved my own workflow, I decided to share it with the community. Everything you need—from detailed setup instructions to actual scripts—is available in the GitHub repository:
If you’ve faced similar frustrations with Kubernetes secrets management, this might be just the tool to simplify your life too.
Reflecting on the Journey#
Building this solution was as rewarding as it was educational. It allowed me to dive deeper into encryption, Git automation, and Kubernetes’ internal workflows. Projects like these remind me why working in tech is so rewarding—every problem solved opens a path to learning and sharing.
If this project sparks your curiosity, check it out, try it in your environment, and share your thoughts. Maybe it’ll make secrets management as effortless for you as it became for me.
Looking for a new opportunity as DevOps engineer
I am currently seeking a new opportunity as a DevOps Engineer, available from January 2026. I am open to remote or hybrid work from Prague, Czechia (Europe), for a long-term, full-time position or B2B contract. Please feel free to contact me for further details. You can also review my professional background on my LinkedIn profile.