Unable to pull images from private registry

I am new to Docker, Rancher and Kubernetes. I am using RancherOS and have installed Rancher server on it. When i try to connect a node having RancherOS, it connect fine but when the Kubernetes tries to start services, most of the services fail with errors similar to the following:

Error (Image [index.docker.io/rancher/net:v0.11.5] failed to pull: Pulling repository docker.io/rancher/net)

Pulling repository docker.io/rancher/kubectld
Error (Image [index.docker.io/rancher/kubectld:v0.8.2] failed to pull: Pulling repository docker.io/rancher/kubectld)

Docker version on Rancher server: 17.03.1-ce, build c6d412e
Docker version on Rancher agent: 1.12.6, build 78d1802

I created private registry which points to Artifactory. In the Kubernetes template, i specified the registry and that’s the only change i did in the template.

If I manually run the following commands, it works:
docker login docker.artifactory.abc.net -u svc-ranch-art_d
docker pull docker.artifactory.abc.net/rancher/net:v0.11.5

I can also see in the Artifactory that the above version (0.11.5) gets cached. I am not sure when Rancher tries starting services, why it goes to docker.io. Struggling since yesterday but couldn’t find the reason.

Any help will really be appreciated.

Error message while pulling images:

Did you add the private registry as a default registry?

http://rancher.com/docs/rancher/v1.6/en/environments/registries/#changing-the-default-registry

This is where the default registry for the infrastructure stacks (anything from the catalog) pull their images.

Note: You’ll need to also re-create the environment after updating this value.

Thanks Denise. I actually got it working two days ago but forgot to update this thread. Anyways, you pointed out the right link. :slight_smile:

There was this global setting registry.default which had to be changed from its default to the private registry that i created. After that, the environment had to be recreated. I did change the registry.default value but did not re-create the environment. That was the issue.

Thanks for your reply.