rancher: Private registries not working on rancher/rancher:v2.0.1
rancher/rancher:v2.0.1 rancher/agent or rancher/rancher-agent:v2.0.1
Infrastructure Stack versions: healthcheck: ipsec: network-services: scheduler: kubernetes (if applicable):
Docker version: (docker version
,docker info
preferred)
Containers: 39
Running: 23
Paused: 0
Stopped: 16
Images: 23
Server Version: 18.06.0-ce-dev
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 773c489c9c1b21a6d78b5c538cd395416ec50f88
runc version: 4fc53a81fb7c994640722ac585fa9ca548971871
init version: fec3683
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 4.15.0-20-generic
Operating System: Ubuntu 18.04 LTS
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 3.78GiB
Name: clrouter
ID: SK5B:IZPJ:DAAY:57VX:Y5NL:CWM7:O27B:IL6H:UF2R:A3XL:TRJ6:HQDD
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
nexus.yzag.office
127.0.0.0/8
Live Restore Enabled: false
Operating system and kernel: (cat /etc/os-release
, uname -r
preferred)
Ubuntu18.04
Type/provider of hosts: (VirtualBox/Bare-metal/AWS/GCE/DO)
Setup details: (single node rancher vs. HA rancher, internal DB vs. external DB) single node rancher internal DB
Added a new private registry. The private registry is a nexus 3 registry. When I tried to create workload the system doesn’t pull the image from the registry. My credentials work with docker pull command in the server, but for some reason is not working in the workload creation.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 27 (1 by maintainers)
Tested with master. Created a private registry in docker with credentials. Pushed an image. The image was pulled correctly from the private registry in rancher and the pods started successfully. The workload YAML had the registry name in
imagePullSecrets
@soumyalj @deniseschannon In which version is/was this fixed? Mean was the fix already released? I’m currently on
v2.0.6
and there this problem still persist. There is actually noimagePullSecrets
in my workload YAML.UPDATE: The problem was that I added the private registry to Rancher
after
creating theDeploy Workload
. I deleted the Workload again and ad recreated it and it was working then.Hi
The Rancher 2.0 system doesn’t appear to sync secrets so well. You can try to create one in the UI, you do so by;
Now you’ll need to use that secret in the YML file you are deploying with. Here’s a sample:
spec: imagePullSecrets: - name: test-sec
Some info on secrets : https://kubernetes-v1-4.github.io/docs/user-guide/kubectl/kubectl_create_secret_docker-registry/
A tip from me: I also had the same problem and decided to learn kubernetes and kubectl - which helped immensely (I used the Pluralsight beginners Kubernetes course).
Hope this helps.
John Clayton CTO E: johnc@filewave.com A: St. Gallerstr 1, 9500 Wil, St Gallen https://maps.google.com/?q=St. Gallestr 1%2C 9500 Wil%2C St Gallen W: https://www.filewave.com
On 4 June 2018 at 19:28, Sean Reifschneider notifications@github.com wrote:
For me the update from @phlegx worked. I deleted the workload and recreated it after adding my docker repository and it worked.
I retested this morning with v2.0.2 version. This is my current conclusion :
To conlude, for the moment, I prefer the first solution because the integration with Kubernetes is better. The best solution will be as with Rancher 1.6 : defining repository in the Rancher UI for all namespace and using it with specify imagePullSecrets.
I was in the same boat, but I’ve finally figured it out with the help of #13339 and some experimenting. Here is what I did:
I had gone into Resources->Registries and done “Add Registry”. I selected “Available to all namespaces”, “Custom”, entered “dockerregistry.example.com:443” and then put in the username and password. This creted the registry with a name of “dc-zgjgt” in my example because I didn’t put anything in the name.
Then I created the workload and in the “Docker Image” field I put “dockerregistry.example.com:443/example/springtest:latest”.
After creating that workload I went into the Workloads page and clicked on that workload name, which brought up the “Workload: springtest” page. Then I clicked the 3 dots on the right and did “View/Edit YAML”. After the spec->template->spec->containers section I added the lines: “imagePullSecrets:” and “- name: dc-zgjgt” and saved. The end result was something like:
Once I did that, the pod deployed and my service is running.
@jotolo Have a look at this example: https://github.com/kubernetes/website/blob/master/content/en/docs/tasks/configure-pod-container/private-reg-pod.yaml