From a directory

Creating a Secret from a directory is similar to creating from a file, using the same command, but with directory. Kubernetes will iterate all the files inside that directory and create a Secret for you:

// show directory structure
# tree
.
├── 2-7-1_access-token-dir
│ └── 2-7-1_access-token

// create Secrets from a directory
# kubectl create secret generic access-token --from-file 2-7-1_access-token-dir/
secret "access-token" created

You can check the Secret with the kubectl get secret access-token -o yaml command again and see if they're identical to the ones from the file.

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

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