Creating generic secrets using literals

The third method of creating secrets is by using the literal method. To do this, run the following command:

kubectl create secret generic my-api-secret-literal --from-literal=url=https://my-secret-url-location.topsecret.com --from-literal=token='/x~Lhx
Az!,;.Vk%[#n+";9p%jGF6['

We can verify that the secret was created by running the following command.

kubectl get secrets

This will give us the following output:

NAME                     TYPE                DATA   AGE
...
my-api-secret-literal Opaque 2 45s
myapi-url-token Opaque 2 3h
mysecret Opaque 2 39m

Thus we have created secrets using literal values in addition to the preceding two methods.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset