Issue pulling ubuntu:latest image for sidecar container – unexpected EOF error

I am facing an issue while working on a Kubernetes task involving a Pod with a main container and a sidecar container, and I would appreciate some guidance.

Task Details

  • Pod name: webserver
  • Primary container:
    • Name: nginx-container
    • Image: nginx:latest
  • Sidecar container:
    • Name: sidecar-container
    • Image: ubuntu:latest

Initially, the primary container image had a typo (nginx:latests). After correcting it to nginx:latest, the primary container started running successfully.

However, the issue persists with the sidecar container.

Issue Observed

The sidecar container using the image ubuntu:latest fails to start with the following error:

Warning  Failed  kubelet  
Failed to pull image "ubuntu:latest": rpc error: code = Unknown desc = failed to pull and unpack image "docker.io/library/ubuntu:latest": 
failed to read expected number of bytes: unexpected EOF

Because of this, the Pod does not reach a healthy running state.


Troubleshooting Done

  • Verified that the image name ubuntu:latest is correct.
  • Confirmed that the Pod YAML syntax is valid.
  • Retried Pod recreation multiple times.
  • When I changed the sidecar image from ubuntu:latest to ubuntu:22.04, the sidecar container and the Pod started running successfully.

Concern / Question

The task specifically requires using the image ubuntu:latest, but it consistently fails to pull with the unexpected EOF error in my environment.

  • Is this a known issue related to image pulling in the lab environment?
  • Is it acceptable to use a pinned version like ubuntu:22.04 as a workaround for this task?
  • Or is there a recommended way to resolve this issue while still using ubuntu:latest?

This is also happening for other people including me across different labs of different courses. here is the other thread : Getting ErrImagePull even after created with correct image - KodeKloud Engineer - KodeKloud - DevOps Learning Community

1 Like