In the Using secrets with Docker Swarm recipe, we showed how you can use secrets to store your passwords in a safe way using Docker Swarm. Kubernetes has a similar feature, so let's look at how it works.
Using secrets with Kubernetes
Getting ready
You will need a Kubernetes cluster set up and configured, as described in the previous recipe.
How to do it...
Follow these steps:
- Add your secret to a file on your local machine:
$ echo -n "MyS3cRet123" > ./secret.txt
- Add your secret to Kubernetes:
$ kubectl create secret generic my-secret --from...