Skip to content
uencoder

K8s Secret

A Secret is a K8s resource for storing sensitive data (passwords/keys/certificates), base64-encoded, mountable as volumes or environment variables.

Purpose

Manage sensitive configuration securely, safer than ConfigMaps.

Mechanism

Secrets store sensitive key-value pairs (base64 encoding, not encryption). Pods consume them as environment variables or mounted volumes. Access must be constrained with RBAC. Production best practice: external secret management (Vault/Sealed Secrets) + encrypted storage.

Use cases

  • Secret management
  • Sensitive configuration
  • K8s security

Related terms

References