April 2018
Beginner
398 pages
10h 11m
English
A much safer way to define secrets is to use kubectl . First, we create files containing the base64-encoded secret values similar to what we did in the preceding section, but this time we store the values in temporary files:
$ echo "sue-hunter" | base64 > username.txt$ echo "123abc456def" | base64 > password.txt
Now we can use kubectl to create a secret from those files as follows:
$ kubectl create secret generic pets-secret-prod \ --from-file=./username.txt \ --from-file=./password.txtsecret "pets-secret-prod" created
The secret can then be used the same way as the manually-created secret.
Why is this method more secure than the other one you might ask? Well, first of all, there is no YAML that defines a secret ...
Read now
Unlock full access