docker / compose-on-kubernetes

Deploy applications described in Compose onto Kubernetes clusters
Apache License 2.0
1.42k stars 159 forks source link

Not able to pull development images from docker hub registry #77

Closed waveywaves closed 5 years ago

waveywaves commented 5 years ago

While installing compose-on-kubernetes on Openshift, docker is not able to pull the images. I had a sucessful installation before this a few days ago and upon trying to install again got the following errors in the events log.

$ oc get events

25s         33s          3         compose-6f86bfd5df-kb9p2.15872989417a6a81       Pod                                     Normal    SandboxChanged      kubelet, shiftnode1     Pod sandbox changed, it will be killed and re-created.
22s         1m           2         compose-6f86bfd5df-kb9p2.1587297fa20fd69c       Pod          spec.containers{compose}   Normal    Pulling             kubelet, shiftnode1     pulling image "docker/kube-compose-dev-controller:v0.4.18"
12s         55s          2         compose-api-7d54c4c88b-5dsv4.1587298436dad512   Pod          spec.containers{compose}   Warning   Failed              kubelet, shiftnode1     Failed to pull image "docker/kube-compose-dev-api-server:v0.4.18": rpc error: code = Unknown desc = repository docker.io/docker/kube-compose-dev-api-server not found: does not exist or no pull access
12s         55s          2         compose-api-7d54c4c88b-5dsv4.1587298436db5795   Pod          spec.containers{compose}   Warning   Failed              kubelet, shiftnode1     Error: ErrImagePull
11s         51s          3         compose-api-7d54c4c88b-5dsv4.15872985211b345f   Pod          spec.containers{compose}   Normal    BackOff             kubelet, shiftnode1     Back-off pulling image "docker/kube-compose-dev-api-server:v0.4.18"
11s         51s          3         compose-api-7d54c4c88b-5dsv4.15872985211bae48   Pod          spec.containers{compose}   Warning   Failed              kubelet, shiftnode1     Error: ImagePullBackOff

I was able to pull the docker/kube-compose-controller and docker/kube-compose-api-server images but not the developer ones.

docker images | grep compose
docker/kube-compose-controller                                       latest              634012027887        4 weeks ago         30.8MB
docker/kube-compose-api-server                                       latest              3a4f4d2514c0        4 weeks ago         48.4MB
$ docker version
Client:
 Version:           18.09.2
 API version:       1.39
 Go version:        go1.10.6
 Git commit:        6247962
 Built:             Sun Feb 10 04:13:56 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.2
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.6
  Git commit:       6247962
  Built:            Sun Feb 10 03:47:25 2019
  OS/Arch:          linux/amd64
  Experimental:     false
$ docker info
Containers: 19
 Running: 0
 Paused: 0
 Stopped: 19
Images: 21
Server Version: 18.09.2
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 local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9754871865f7fe2f4e74d43e2fc7ccd237edcbce
runc version: 09c8266bf2fcf9519a651b04ae54c967b9ab86ec
init version: fec3683
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.18.10-200.fc28.x86_64
Operating System: Fedora 28 (Workstation Edition)
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 19.31GiB
Name: localhost.localdomain
ID: 6DYY:6P6W:LHQN:S7HN:MQHN:3W3T:SCWZ:WLWT:GWXS:4RQM:OLCD:DEBO
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:
 127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
simonferquel commented 5 years ago

Dev images are only built using your local daemon and are never pushed to the registry. The development workflow is currently tailored for developers using Docker Desktop (which provides a single-node local kubernetes). This works on Docker Desktop, because the daemon used for building images is the same as the one using to run Kubernetes workloads (so when you do a docker build, the built image is available for Kubernetes workloads without having to push to a registry).

For developing on an external cluster, you can play with the IMAGE_REPO_PREFIX env variable and push the images in your own repository.

waveywaves commented 5 years ago

Was able to change the image, using the IMAGE_REPO_PREFIX, so that a workable image could be pulled from dockerHub without giving an ErrImagePull error.

 # export IMAGE_REPO_PREFIX="docker/kube-compose-"