/news/kubernetes-secret-storage-requires-an-architecture-decision-d9fb5e70

Kubernetes Secret Storage Requires an Architecture Decision

Infisical’s Kubernetes secrets management guide outlines the core choice: keep secrets in Kubernetes, store encrypted values in Git, or inject them from an external manager.

Kubernetes has a built-in Secret object, but that does not answer the harder operational question: where should a credential be authoritative, and how should it reach a running pod?

Infisical’s Kubernetes secrets management guide centers on that decision instead of assuming every cluster needs the same tooling. It compares three broad patterns: native Kubernetes Secrets, encrypted secrets stored with application configuration in Git, and external secrets managers that deliver values into Kubernetes during deployment or at runtime.

For platform teams, the distinction matters. A Secret manifest is a delivery mechanism and an in-cluster API object. By itself, it is not a complete lifecycle system for production credentials.

Native Kubernetes Secrets are the simplest path

The native option is direct: create Kubernetes Secret resources and reference them from pods as environment variables or mounted files. It is usually the least complicated model to run. Applications use familiar Kubernetes primitives, manifests remain easy to inspect, and no third-party control plane is required in the request path.

Native Secrets can suit lower-risk values, short-lived development environments, or clusters where a small team tightly controls access. They may also fit secrets that originate in a cluster workflow and do not need broad sharing across systems.

Base64 encoding is not encryption. Teams using Kubernetes Secrets still need deliberate choices around encryption at rest, RBAC, auditability, backups, and access to secret-bearing manifests or permissions that expose them. A credential available to a workload may also be visible to people or automation with broad enough cluster access.

Scope is the practical constraint. Kubernetes can make a value available to a pod, but it is less naturally suited to acting as the sole system of record for credentials used across multiple clusters, CI jobs, cloud accounts, and non-Kubernetes services.

Encrypted Git keeps delivery in the GitOps workflow

The second model keeps encrypted secret data in Git and decrypts it during deployment. It fits GitOps workflows because application configuration and encrypted secret material can move through the same pull request, review, and promotion process.

The benefit is operational visibility. Teams can see that a secret changed, connect the change to a commit, and promote encrypted configuration between environments without committing plaintext to the repository. It also avoids a separate manual route for each configuration update.

Key management remains the tradeoff. Encryption covers only part of the system: the cluster or deployment automation still needs a way to obtain the decryption key. That key is a critical bootstrap credential. Teams need to decide where it resides, which controller or pipeline can use it, how access is constrained, and how rotation can occur without breaking deployments.

Encrypted Git works best when Git is already the controlled source of truth for deployment state and the team can operate the encryption and decryption workflow reliably. It is less suitable when credentials change often, require independent ownership, or need revocation and rotation outside the application deployment cadence.

External managers separate secret authority from Kubernetes

The third option uses an external secrets manager as the authoritative store. Kubernetes receives values through an operator, synchronization process, deployment-time injection, or application-level retrieval method. The guide presents this as a way to centralize secrets that span environments and systems.

This approach helps when credentials extend beyond Kubernetes. Database passwords, API tokens, certificates, and cloud credentials may involve shared services, security teams, CI systems, and workloads in multiple clusters. A dedicated secrets platform can establish a clearer ownership boundary and a central location for access controls, auditing, and rotation processes.

More moving parts come with the model. Operators need permissions, and synchronization can fail. Teams also need to know whether a secret is copied into a Kubernetes Secret, fetched only when an application starts, or refreshed while workloads run. Those implementation choices affect availability, rotation behavior, and what exposure remains inside the cluster.

An external manager does not eliminate Kubernetes security work. When a value is synchronized into a native Secret for pod consumption, Kubernetes RBAC, encryption, and workload isolation still apply. The design separates the upstream source of truth from the cluster-side delivery format.

Choose by lifecycle, not by fashion

Infisical’s comparison points to lifecycle and blast radius as the criteria for selecting a pattern, rather than applying one model everywhere.

Native Kubernetes Secrets are often sufficient when the environment is limited and another system would add more operational burden than benefit. Encrypted Git fits organizations that need declarative, reviewable GitOps delivery and can secure the decryption path. External managers are better suited to shared, sensitive, or frequently rotated credentials that must outlive a single cluster or deployment repository.

A mixed architecture is often the realistic outcome. A platform might use an external manager for production credentials, encrypted Git for environment-specific deployment values, and native Secrets for narrowly scoped cluster-native data. Document which system is authoritative for each class of value, and avoid accidental duplication.

What this means in practice

Before selecting a controller or adding another base64 string to a manifest, map the path from secret creation to pod consumption. Identify the source of truth, the identities allowed to read it, the bootstrap credential needed for delivery, and the rotation behavior when a value changes. Kubernetes can consume secrets effectively in several ways. The engineering work is selecting a model whose access boundaries and failure modes fit the systems in use.

Comments

Sign in or create an account to leave a comment.

Sign inCreate account

0 comments

No comments yet.