CertGrid CertGrid
Hands-on Lab·Certified Kubernetes Application Developer

Secrets: Creation, Consumption and Encoding

A Secret is a ConfigMap with a different name, a type field, and one genuine difference: mounted Secrets land on tmpfs rather than disk. It is not encrypted, it is base64-encoded, and one command turns that back into plaintext. Knowing exactly what protection you do and do not get is the whole of this guide, along with the two consumption styles and their different leak profiles.

Configuration and Security Guide 25 of 44 Beginner

Written against the versions above. Base64 is an encoding for binary-safe transport, not a security measure. Secrets can be encrypted at rest with an EncryptionConfiguration on the API server - a cluster-admin task, and CKA/CKS material rather than CKAD. What CKAD expects you to know is that without it, anyone with `get secret` in the namespace has the plaintext.

Two short-lived Pods and two Secrets in one namespace.
Server NameIP AddressOSRolesCPURAMHDD
CKA1001192.168.0.175Ubuntu 26.04 LTSControl Plane Node2 Core4 GB50 GB
CKA1001-NODE01192.168.0.176Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA1001-NODE02192.168.0.177Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA1001-NODE03192.168.0.178Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB

Before you start

  1. Create one, and read it straight back

  2. Two ways into a container

  3. The env var spreads further than you think

  4. The typed Secrets

Official sources