I am trying to create a docker secret with the following command but, time and again i am getting the same error…
(Command) kubectl create secret docker-registry mydockersecret –[email protected] –docker-username=dev –docker-password=pass12 –docker-server:5000=my-registry.com
error: exactly one NAME is required, got 5
kindly rectify the error.
Thank you,
Deepak
The flags use double dashes: --
. The correct command is:
kubectl create secret docker-registry mydockersecret [email protected] --docker-username=dev --docker-password=pass12 --docker-server==my-registry.com:5000
Thanks a lot Rob sir for your help.
kindly if you can check the follwing command ,particularly the one where it is giving an error.
k create secret docker-registry mydockersecret –[email protected] –-docker-username=admin –-docker-password=pass123 –-docker-server=my-registry.com:5000
error: exactly one NAME is required, got 5
following command i copied from the one you have sent
kubectl create secret docker-registry mydockersecret [email protected] --docker-username=dev --docker-password=pass12 --docker-server==my-registry.cam:5000
secret/mydockersecret created
I think your problem is that your command is garbled; it contains some things that print as dashes, but are not actually the ASCII dash character. Try the following like I did in python:
In [1]: str = "–-d"
In [6]: for chr in str:
...: print(ord(chr), "=", hex(ord(chr)))
8211 = 0x2013
45 = 0x2d
100 = 0x64
Your use of non-ascii dashes is the source of your problem. You’re using en-dashes in code, and that simply does not work as you expect.