Skip to main content

imagePullSecret field reference

Field reference for Create an imagePullSecret with kubectl.

kubectl create secret docker-registry flags​

FlagDefaultDescription
NAME—Name of the Secret. Lowercase only, containing only - and ..
--docker-serverhttps://index.docker.io/v1/Registry address.
--docker-usernameemptyLogin username.
--docker-passwordemptyPassword or token.
--docker-emailemptyOnly used by older registries — can be omitted.
--from-file—Path to a config.json, used instead of the three flags above.
--namespacedefaultNamespace the Secret is created in.
--dry-run=client—Prints the YAML instead of creating the Secret.

--docker-server matching rule​

The value must match exactly the host part at the start of the image name:

Image nameCorrect value
registry.fptcloud.com/my-project/api:v1registry.fptcloud.com
10.0.0.5:5000/api:v110.0.0.5:5000
nginx:1.25https://index.docker.io/v1/

Secret naming rules​

A Secret name follows the DNS subdomain format: lowercase letters, numbers, -, and ., starting and ending with a letter or number.

ValidInvalid
regcredRegCred (uppercase)
fke-registry-credreg_cred (underscore)

See also​