-
Notifications
You must be signed in to change notification settings - Fork 39.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Support reading secrets from terminal in kubectl #54200
Comments
Because in Unix terminal is represented as file $ kubectl create secret generic foo --from-file=test=/dev/stdin
tada <-- this was manually typed in a terminal
secret "foo" created
$ kubectl get secret foo -o yaml | grep ^data: -A1
data:
test: dGFkYQo=
$ echo -n dGFkYQo= | base64 -d
tada |
Thanks @php-coder ! I guess this works in linux / mc. Windows users will be out of luck. |
@php-coder , I just tried this in Ubuntu 16.04. How to I end the read process? I tried pressing |
Yes, I forgot to mention that you should use |
:) It worked after ctrl + D. I even tried with multiple keys. I think one issue still remains in that I don't know in what order the keys are read by kubectl. A common scenario is creating AWS credentials. If kubectl can prompt back the secret, that will make things bit nicer. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
I use this handy method
|
kubectl create secret
command supports--from-literal
and--from-file
options. But neither options are convenient when creating secrets manually from terminal.I would like to see a flag like
--from-keys=k1,k2,k3
. Given this flag is present, kubectl will ask user for input for each key and create a secret using that info. It can use something like https://github.com/howeyc/gopass to read the value without echo./kind feature
/sig cli
The text was updated successfully, but these errors were encountered: