What is a Secret?

last updated May 10, 2019

A secret is a file, set of keys and values, or blob of data which can be provided to particular pods as environment variables, or mounted as files.

A simple Opaque type secret:

Apply
---
apiVersion: v1
kind: Secret
metadata:
name: mysql-pass
type: Opaque
stringData:
password: SECRET_PASSWORD_GOES_HERE
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
.apiVersionKube resource version to use
.kindWhat kind of resource is this yaml doc defining
.metadata.nameName of your resource

Secrets can also be encrypted at rest and managed by other tools like Vault.

Resources

Back