vmware-archive / buildkit-cli-for-kubectl

BuildKit CLI for kubectl is a tool for building container images with your Kubernetes cluster
Other
501 stars 40 forks source link

kubectl run ends with ErrImagePull in Azure Kubernetes Cluster (AKS) #99

Open Shaked opened 3 years ago

Shaked commented 3 years ago

What steps did you take and what happened

I have ran the following commands:

/usr/local/bin/kubectl buildkit -n agents create citests-daemon --custom-config buildkitd-cm
/usr/local/bin/kubectl build -t service-bus-reporter:test-24633 ./service-bus-reporter/ -f service-bus-reporter/Dockerfile --builder citests-daemon
/usr/local/bin/kubectl run -n agents --restart=Never --rm -i --image service-bus-reporter:test-24633 ci-publish-24633 

Sometimes it might work but most of the times it ends with:

ci-publish-24633                  0/1     ErrImagePull        0          2s   
ci-publish-24633                  0/1     ImagePullBackOff    0          15s  
ci-publish-24633                  0/1     ErrImagePull        0          30s  
ci-publish-24633                  0/1     ImagePullBackOff    0          41s  
ci-publish-24633                  0/1     ErrImagePull        0          55s  
ci-publish-24633                  0/1     Terminating         0          60s  

What did you expect to happen

I expect the newly built image to be in AKS and run.

Environment Details:

Server: Version: 1.4.4+azure Revision: 05f951a3781f4f2c1911b05e61c160e9c30eaa8e UUID: 5c6ac07c-7cd8-4b02-84e9-402d66fec664


docker version Client: Version: 19.03.14+azure API version: 1.40 Go version: go1.13.15 Git commit: fd3371eb7df1adeceff5935cf3ade0576a0f48d5 Built: Sat Oct 24 07:44:17 2020 OS/Arch: linux/amd64 Experimental: false

Server: Engine: Version: 19.03.14+azure API version: 1.40 (minimum version 1.12) Go version: go1.13.15 Git commit: 7d75c1d40d88ddef08653dbd611f41df42bdf087 Built: Mon Mar 12 00:00:00 2018 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.4.4+azure GitCommit: 05f951a3781f4f2c1911b05e61c160e9c30eaa8e runc: Version: 1.0.0-rc92 GitCommit: ff819c7e9184c13b7c2607fe6c30ae19403a7aff docker-init: Version: 0.18.0 GitCommit:



**Builder Logs**
[If applicable, an excerpt from `kubectl logs -l app=buildkit` from around the time you hit the failure may be very helpful]

**Dockerfile**
[If applicable, please include your Dockerfile or excerpts related to the failure]

**Vote on this request**

This is an invitation to the community to vote on issues.  Use the "smiley face" up to the right of this comment to vote.

- :+1: "I would like to see this bug fixed as soon as possible"
- :-1: "There are more important bugs to focus on right now"
dhiltgen commented 3 years ago

This feels like it might be a duplicate of #79 perhaps. Try using fully qualified registry names on both your build tag and run tag and see if that solves this.

If not, can you see what kubectl describe pod XXX looks like on these failing pods, and perhaps copy the tail-end of the build output - perhaps there's something there that will help shed light on what's going wrong.

Another thing to check is the image pull policy on the pods to make sure it's not getting set to always pull.

madclement commented 2 years ago

@Shaked The problem could be is that the Image might be getting built on one node and the pod is being deployed on another node which doesn't contain the Image. I am also currently facing in same Issue in Amazon EKS. Some times it work but most of the time it it failing.