Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 1.17 KB

Use_image_pull_secrets.md

File metadata and controls

29 lines (24 loc) · 1.17 KB

How to configure username and password for an image repository/registry

1. Create imagePullSecrets

This solution can be used in both Dockerhub or other private/public image repositories/registries. The following example takes Dockerhub as an example,

DOCKER_REGISTRY_SERVER=<URL of Dockerhub>
DOCKER_USER=<username of registry>
DOCKER_EMAIL=<email of registry>
DOCKER_PASSWORD=<password of registry>

kubectl create secret docker-registry myregistrykey \
  --docker-server=$DOCKER_REGISTRY_SERVER \
  --docker-username=$DOCKER_USER \
  --docker-password=$DOCKER_PASSWORD \
  --docker-email=$DOCKER_EMAIL
  -n <namespace>

Note that the secret will only take effect when the namespace is the same with the corresponding production resources.

Note: The URL of Dockerhub is:https://index.docker.io/v1/

2. Add the created secret to KubeFATE config

Make sure the secrete is created in the same namespace going to deploy FATE, add it in the imagePullSecrets of cluster.yaml as following:

imagePullSecrets: 
- name: myregistrykey

Adding account information to registry can solve the problem of traffic limitation by Dockerhub