Reputation: 154
I'm attempting to deploy a Docker container to a minikube instance running locally, and getting this error when it attempts to pull(?) the image. The image exists in a self-hosted Docker registry. The image I'm testing with is built with the following Dockerfile:
FROM alpine:latest
ENTRYPOINT ["echo"]
I'm using the fabric8io kubernetes-client
library to create a deployment like so:
// 'kube' is an instance of io.fabric8.kubernetes.client.KubernetesClient
final Deployment deployment = kube.extensions().deployments()
.createOrReplaceWithNew()
.withNewMetadata()
.withName(name)
.withNamespace("staging")
.endMetadata()
.withNewSpec()
.withReplicas(1)
.withNewTemplate()
.withNewMetadata()
.addToLabels("app", name)
.endMetadata()
.withNewSpec()
.addNewImagePullSecret()
// "regsecret" is the kubectl-created docker secret
.withName("regsecret")
.endImagePullSecret()
.addNewContainer()
.withName(name)
.withImage(imageName + ":latest")
.endContainer()
.endSpec()
.endTemplate()
.endSpec()
.done();
This is all running on Arch Linux, kernel Linux 4.10.9-1-ARCH x86_64 GNU/Linux
. Using minikube 0.18.0-1
and kubectl-bin 1.6.1-1
from the AUR, docker 1:17.04.0-1
from the community repositories, and the docker registry
container at latest
(2.6.1
as of writing this). fabric8io kubernetes-client
is at version 2.2.13
.
I have checked:
docker pull
and docker run
on both the host and inside the minikube VM work exactly as expectedI have not:
When checking minikube dashboard
, the sections for Deployments, Replica Sets, and Pods all have the same error:
Failed to inspect image "registry_domain/XXX/YYY:latest": Id or size of image "registry_domain/XXX/YYY:latest" is not set
Error syncing pod, skipping: failed to "StartContainer" for "YYY" with ImageInspectError: "Failed to inspect image \"registry_domain/XXX/YYY:latest\": Id or size of image \"registry_domain/XXX/YYY:latest\" is not set"
and the pod logs are permanently stuck at
container "YYY" in pod "YYY" is waiting to start: ImageInspectError
Looking up the error message provided leads me to https://github.com/kubernetes/minikube/issues/947, but this is not the same issue, as kube-dns
is working as expected. This is the only relevant search result, as the other results that come up are
I'm honestly not sure where to go from here. Any advice would be appreciated.
Upvotes: 1
Views: 6933
Reputation: 674
Before removing anything, you can try minikube delete
(if nothing important in there, or stuff backed up) and minikube start
so that you delete you previous cluster alltogether, and try yo pull your image again. It did it for me.
Upvotes: 0
Reputation: 412
Kubernetes 1.6 may not compatible with latest Docker version(17.xx.xx), could you lower down your Docker version and retry this.
The recommend version of Docker in Kubernetes(v1.6) is 1.12, if you not sure how to find that version. Use this in ubuntu or debain:
apt-get update && apt-get install -y apt-transport-https
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
EOF
apt-get update
apt-get install -y docker.io
For centos, ref
remove you current Docker install before trying this
Upvotes: 1