I am trying to create a docker-registry secrete for GCR, but am getting a really cryptic error message. This is the kubectl cmd that I am running:
kubectl create secret docker-registry gcrsecret --docker-username=_json_key --docker-password=”$(cat wk-test-1-b3c9659d9a07.json)” --docker-server=https://gcr.io --docker-email=rynslmns@gmail.com
But it is erroring out with the following error message:
error: exactly one NAME is required, got 26
Any thoughts? I am not seeing anything obvious in the documentation.
My issue was that I copied and pasted the command from a browser to a terminal. Typing the code directly into the terminal solved the issue.
It seems that you are using ”
(Unicode RIGHT DOUBLE QUOTATION MARK) instead of "
(ASCII 0x22), which is confusing your shell.
Future readers. Watch out for any spaces.
Bad:
kubectl create configmap special-config --from-literal=special.how=very --from-literal= special.type='charm'
error: exactly one NAME is required, got 2
Works:
kubectl create configmap special-config --from-literal=special.how=very --from-literal=special.type='charm'
configmap "special-config" created
Note the space before "special.type" in the bad example.
If you're on windows use '
rather than "