https://pulumi.com logo
Title
m

most-lighter-95902

09/15/2022, 3:33 PM
Is there a way to use the
--from-file
flag in kubectl for secret creation via Pulumi?
b

billowy-army-68599

09/15/2022, 3:40 PM
brew install pulumi/tap/kube2pulumi # install kube2pulumi for your OS
kubectl create secret generic my-secret --from-file="./username.txt" --dry-run=client -o yaml | tee /tmp/secret.yaml
kube2pulumi python -f /tmp/secret.yaml
m

most-lighter-95902

09/15/2022, 3:41 PM
Oh interesting - thank you!
One quick note for the future - I copied and pasted this command and it wiped out my index.ts šŸ˜ž
Is there a way to create this in another file name?
b

billowy-army-68599

09/15/2022, 4:26 PM
-o, --outputFile string   The name of the output file to write to
m

most-lighter-95902

09/15/2022, 4:27 PM
Got it thanks!
b

billowy-army-68599

09/15/2022, 4:28 PM
iā€™d generally not recommend running commands without looking at the
--help
before running them
šŸ‘ 1