Create a secret from an env file.
Section: ConfigMaps and Secrets
Create secret from env file
bash
bash
kubectl create secret generic app-env --from-env-file=.env.production -n paymentsExplanation
Create a secret from an env file.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing ConfigMaps and Secrets