GPG encryption with kubectl isn’t just about hiding secrets. It’s about making every push, pull, apply, and update safe without slowing you down. When Kubernetes manifests contain sensitive data, a single misconfiguration can expose tokens, passwords, and internal URLs. Encrypting with GPG before it even touches your cluster means those secrets never sit around in the open.
The workflow is straightforward. Store secrets as YAML files, encrypt them with gpg --encrypt, commit to version control, and only decrypt on a trusted local machine or in a secure CI/CD pipeline right before running kubectl apply. There’s no reason to let .env files, ConfigMaps, or Secrets float unencrypted between repos and environments.
Done right, kubectl and GPG operate as a single unit. Developers can commit encrypted Kubernetes resource files, review them in PRs without exposing values, and control who can decrypt by managing GPG keys. Access control becomes as simple as key distribution. When you rotate keys, you instantly change who can manage secrets in your clusters.