Kubernetes
secrets management
security
DevOps
infrastructure

Kubernetes with secrets alternative

Master System Design with Codemia

Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.

Introduction

Kubernetes Secret objects are the default way to store sensitive configuration for workloads, but they are not always the best final design. Teams often look for alternatives because native Secrets are still Kubernetes objects, are commonly consumed in plaintext inside the cluster, and by default are stored unencrypted in etcd unless encryption at rest is configured.

Start by Clarifying the Real Requirement

There is no single replacement for Kubernetes Secrets because different teams are solving different problems:

  • keeping secrets out of Git
  • avoiding long-lived copies in etcd
  • centralizing secret rotation in an external vault
  • supporting GitOps safely
  • reducing application changes

The best alternative depends on which of those constraints matters most.

Option 1: External Secret Manager Plus Operator

A common pattern is to store the source of truth in an external manager such as AWS Secrets Manager, Google Secret Manager, Azure Key Vault, or HashiCorp Vault, then sync selected values into the cluster with an operator such as External Secrets Operator.

yaml
1apiVersion: external-secrets.io/v1beta1
2kind: ExternalSecret
3metadata:
4  name: app-config
5spec:
6  refreshInterval: 1h
7  secretStoreRef:
8    name: aws-secrets
9    kind: ClusterSecretStore
10  target:
11    name: app-config
12  data:
13    - secretKey: database-password
14      remoteRef:
15        key: prod/app/database
16        property: password

This approach gives you centralized rotation and auditing in the external store, while still letting Kubernetes workloads consume a normal Secret.

The tradeoff is that the secret still ends up as a native Kubernetes Secret unless you choose a mount-based approach instead.

Option 2: Secrets Store CSI Driver

If you want to avoid storing the secret in etcd as a normal Kubernetes Secret, the Secrets Store CSI Driver is often a better fit. It retrieves secrets from an external provider and mounts them into the pod as files.

yaml
1apiVersion: secrets-store.csi.x-k8s.io/v1
2kind: SecretProviderClass
3metadata:
4  name: app-secrets
5spec:
6  provider: aws
7  parameters:
8    objects: |
9      - objectName: "prod/app/database"
10        objectType: "secretsmanager"

This is attractive when applications can read credentials from files and you want to minimize duplicated secret storage inside the cluster control plane.

Option 3: Sealed Secrets for GitOps

If the main problem is "I want secrets in Git, but not in plaintext", Sealed Secrets is a strong GitOps-oriented option. You encrypt the secret client-side and commit the encrypted SealedSecret resource. The controller in the cluster decrypts it and creates a normal Kubernetes Secret.

That makes repository storage safer, but it is not the same as using an external secret manager. Once unsealed, the secret still exists in the cluster as a native Secret.

So Sealed Secrets is best understood as a safer Git workflow, not as a total replacement for in-cluster secrets.

Option 4: Application Fetches Secrets Directly

Some teams avoid Kubernetes secret objects entirely and let the application fetch credentials directly from Vault or a cloud secret manager at runtime using workload identity. This removes the sync layer, but it pushes secret-fetching logic, retries, and caching into the application or sidecar architecture.

That can be the cleanest security model when the platform already has strong workload identity and the application stack is comfortable with runtime secret retrieval.

Which Alternative Fits Which Problem

A simple decision guide is:

  • choose External Secrets Operator when you want external source of truth with Kubernetes-native consumption
  • choose Secrets Store CSI Driver when you prefer file mounts and want to reduce secret copies in etcd
  • choose Sealed Secrets when GitOps safety is the main goal
  • choose direct runtime fetch when you want the app to talk to the secret manager itself

None of these removes the need for RBAC, node security, and careful pod access control.

Common Pitfalls

Treating base64 encoding as encryption is a security mistake. Native Kubernetes Secrets need proper access control and usually benefit from encryption at rest.

Assuming Sealed Secrets means the cluster never sees plaintext is incorrect. The controller eventually produces a normal Kubernetes Secret.

Syncing from an external manager into Kubernetes may centralize rotation, but it still creates another secret copy inside the cluster.

Mount-based CSI solutions work well only if the application can read secrets from files or be adapted to do so.

Choosing an alternative without first identifying the real problem often leads to extra operational complexity with little security gain.

Summary

  • Native Kubernetes Secrets are convenient, but they are not always the right final design.
  • External secret managers plus operators are good when you want centralized secret ownership.
  • Secrets Store CSI Driver is useful when you want mount-based delivery without relying entirely on native Secret storage.
  • Sealed Secrets is mainly a GitOps-safe encryption workflow, not a full replacement for secret handling inside the cluster.
  • Pick the approach that matches your actual constraint: Git safety, rotation, reduced copies, or direct runtime retrieval.

Course illustration
Course illustration

All Rights Reserved.