kubectl create secret generic creds --from-file=creds.json

Category: Kubernetes & Containers

kubectl create secret generic creds --from-file=creds.json

Create a secret from a file

Loads the entire creds.json file into the secret as a key named after the filename. Multiple --from-file flags can pack several files into one secret. Mount the result into pods as files or environment variables.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.