FahamLah

Commands

kubectl create secret generic

kubectl create secret generic <name> --from-literal=KEY=value

Risk: Careful

What it does

Puts a password or token in a Secret. It is only base64, not locked.

When to use it

Pods need a password. Limit who can read Secrets.

Example

$ kubectl create secret generic till --from-literal=PASSWORD=practice-only

A Secret called till with one key, PASSWORD.

$ kubectl get secret till -o jsonpath={.data.PASSWORD}

Show the base64 text. Anyone who can read it can decode it.