Skip to content

Instantly share code, notes, and snippets.

View Ak0p's full-sized avatar
🏠
Working from home

Andrei Băroiu Ak0p

🏠
Working from home
  • POLITEHNICA University of Bucharest
  • Bucharest, Romania
  • LinkedIn in/andreibaroiu
View GitHub Profile
@Ak0p
Ak0p / sops.md
Created July 26, 2026 13:53
Secure your Kubernetes Secrets and Resources with SOPS

Using GitOps with Kubernetes comes with big advantages to maintainability and reproducibility. Using a tool like FluxCD alongside Kustomize makes cluster resource managemement a breeze even in complex setups. So after pushing your manifests to git you come to ask yourself a question: "What do I do with secrets?".

SOPS is a tool that solves that problem. It encrypts your Kubernetes Secrets and any other manifests you wish before pushing them to git. The magic of SOPS comes with the Flux integration which allows you to push encrypted manifests to git which will later be decrypted by Flux and applied on your cluster.

Here is how to get started with ops

Install age and sops via your package manager. (SOPS supports multiple encryption backends) Create a keypair with age. Be sure to put the key in a secure location outside of any git repositories:

age-keygen -o ~/.keys/age.key