Kubernetes manifests · Config and storage

Secret

Store sensitive values. stringData accepts plain text, which Kubernetes encodes. Secrets are only base64-encoded unless you enable encryption at rest.

apiVersion: v1
kind: Secret
metadata:
  name: db-secret
type: Opaque
stringData:
  password: change-me

Caution: Don't commit real secrets to Git. Use a secrets manager or sealed secrets.

Official Kubernetes manifests documentation

More config and storage commands

All config and storage commands · Kubernetes manifests cheatsheet

Was this page helpful?