what should be the max allowed image size for micro services on kubernetes

11/28/2018

Some times I observe Imagepullbackoff or Imagepullerror in kubernets deployment. Is there any restriction for docker image size on kubernets for pulling image.

Thanks

-- Khumar
docker
kubernetes

1 Answer

11/28/2018

It's straightforward to get a ~1 GB image (anything that apt-get install build-essential will clock in in the hundreds of megabytes easily), and the Kubernetes clusters I use day-to-day handle that just fine.

In the past I've had trouble with Docker with single layers in the 1 GB+ range, and whole images in the 5 GB+ range. These have generally manifested as problems with docker push and docker pull being unreliable, and those in turn could correspond to the Kubernetes errors you're seeing.

As a general rule, if you're building containers by taking a language runtime and adding your application on top of it, and you're not trying to bundle any especially large data set into your container, you're probably fine, even if you're being inefficient about how you build it.

(Alpine isn't a silver bullet here: you might save ~150 MB over an Ubuntu base image, but if you're still installing a full C toolchain and adding a big dataset into the image proper, you'll easily get up into the problematic range. A ~200-300 MB Ubuntu-based container will work just fine and won't cause any operational problems beyond the time and space required to pull it.)

-- David Maze
Source: StackOverflow