- Passwords
- API keys or tokens
- Database connection strings
- Usernames or short configuration strings (it can even be a simple
hello worldstring)

- Default type:
Opaque. - Storage: Secret data is stored in the API as base64-encoded values. Base64 is an encoding, not encryption.
- Persistence: Secret objects are stored in etcd.
- Access: Anyone with direct etcd access or API access with sufficient RBAC privileges can read them unless you enable encryption or restrict access.

Treat Kubernetes Secrets as sensitive. By default they are base64-encoded only. For production, enable encryption at rest and/or use an external secrets manager (Vault, AWS Secrets Manager, Azure Key Vault, etc.).
- Create a Secret from literals (CLI)
- Create a Secret from files (CLI)
- Secret manifest (YAML)
- Inspecting and decoding secrets
- Environment variables (individual keys)
- Environment variables (all keys from a secret)
- Mounted as files (volume)
/etc/secret/<key> containing the decoded value.
Security considerations and best practices
- Do not store secrets in container images, Git repositories, or plain-text manifests checked into source control.
- Restrict access to Secrets via RBAC and audit access to the API server and etcd.
- Prefer
type: kubernetes.io/tlsfor TLS artifacts andtype: dockerconfigjsonfor image pull secrets—use specific types when applicable. - Use encryption at rest for secrets in etcd: https://kubernetes.io/docs/tasks/administer-cluster/encrypt-data/
- Consider external secret management (Vault, AWS Secrets Manager, Azure Key Vault) for centralized lifecycle, rotation, and fine-grained access control.
Secrets are only base64-encoded in the API by default—not encrypted. Without encryption at rest or an external secrets manager, Secrets stored in etcd can be read by anyone with sufficient privileges. Do not treat default Secrets as fully secure.