April 2018
Intermediate to advanced
468 pages
14h 34m
English
Secrets must be created before you try to create a pod that requires them. The secret must exist; otherwise, the pod creation will fail.
You can create secrets with the following command:
kubectl create secret.
Here, I create a generic secret named hush-hash, which contains two keys—username and password:
> kubectl create secret generic hush-hush --from-literal=username=tobias --from-literal=password=cutoffs
The resulting secret is Opaque:
> kubectl describe secrets/hush-hush
Name: hush-hush
Namespace: default
Labels: <none>
Annotations: <none>
Type: Opaque
Data
====
password: 7 bytes
username: 6 bytes
You can create secrets from files using --from-file instead of --from-literal, and you can also create secrets manually ...
Read now
Unlock full access