imagePullSecret field reference
Field reference for Create an imagePullSecret with kubectl.
kubectl create secret docker-registry flags
| Flag | Default | Description |
|---|---|---|
NAME | — | Name of the Secret. Lowercase only, containing only - and .. |
--docker-server | https://index.docker.io/v1/ | Registry address. |
--docker-username | empty | Login username. |
--docker-password | empty | Password or token. |
--docker-email | empty | Only used by older registries — can be omitted. |
--from-file | — | Path to a config.json, used instead of the three flags above. |
--namespace | default | Namespace 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 name | Correct value |
|---|---|
registry.fptcloud.com/my-project/api:v1 | registry.fptcloud.com |
10.0.0.5:5000/api:v1 | 10.0.0.5:5000 |
nginx:1.25 | https://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.
| Valid | Invalid |
|---|---|
regcred | RegCred (uppercase) |
fke-registry-cred | reg_cred (underscore) |
See also
- Create an imagePullSecret with kubectl
- kubectl create secret docker-registry — upstream Kubernetes reference.