-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kaniko gets OOMKilled while building vast images #1680
Comments
I've the exact same issue. Using 1.3 image works fine, 1.6 gets OOMKilled. |
This seems to be also related to: #909 After creating a huge layer, Kaniko is killed when trying to create the layer snapshot. When using the When I am monitoring the Kaniko pod during its execution using |
I had a similar problem. In my case, the image is built with a large set of files being copied into it. I tried
So if any of you still have problems with 1.3.0, check if you have large files being copied/unpacked and if you can split their individual size (e.g. by unpacking tar.gz before build). Doesn't work on 1.6.0 though. |
My problem is similar. Building with latest image is failed, but with v1.3.0 was succeeded. In my case, build debug-b04399e with commit b04399e is succeeded, but the next build debug-1ad4295 with commit 1ad4295 (#1527) is failed. |
We are experiencing the same. We're building a fairly large image, and I can see the kaniko container using 24 GB of memory. With a limit of 20 GB, it still gets OOM killed some of the time. We're on 1.5.0. Does anyone know of a workaround besides rolling back to 1.3.0? |
Happens to me too. Additional args I used:
Resources:
|
I have just digging into the code of this MR a bit. The WithCompressedCaching [1] flag seems to trigger Memoization of the function call thus storing a gzip layer in memory. This is probably a performance improvement when enough memory is available to store the layer. However, this will use all available memory if the layer is too big and therefore leading to the kaniko pod being killed. An easy fix would probably be removing this option which would lead to a performance decrease for all those images which are now build correctly (as they are small enough). [1] https://pkg.go.dev/github.com/google/go-containerregistry/pkg/v1/tarball#WithCompressedCaching |
@Phylu Thank you for your digging and reporting! Ref. https://zenn.dev/koron/articles/b96cccfa82c0c1 (Japanese) |
I just made an example build on the latest 1.6.0 release where I removed the
Perhaps, @dlorenc @priyawadhwa @sharifelgamal can give some guidance here. :) |
Fixes GoogleContainerTools#1680 Large images cannot be build as the kaniko container will be killed due to an OOM error Removing the tarball compression drastically reduces the memory required to push large image layers
Large images cannot be build as the kaniko container will be killed due to an OOM error. Removing the tarball compression drastically reduces the memory required to push large image layers. Fixes GoogleContainerTools#1680 This change may increase the build time for smaller images. Therefore a command line option to trigger the compression or a more intelligent behaviour may be useful.
I just improved my PR by adding a command line flag. Now it is possible to set --compressed-caching=false to disable the compression, which lets the build work even with those large images. I tested this with my own breaking image and reliably it works with the flag set while it breaks otherwise. The standard behaviour stays with using the compression. |
Hey guys |
Large images cannot be build as the kaniko container will be killed due to an OOM error. Removing the tarball compression drastically reduces the memory required to push large image layers. Fixes GoogleContainerTools#1680 This change may increase the build time for smaller images. Therefore a command line option to trigger the compression or a more intelligent behaviour may be useful.
…#1722) * Remove tarball.WithCompressedCaching flag to resolve OOM Killed error Large images cannot be build as the kaniko container will be killed due to an OOM error. Removing the tarball compression drastically reduces the memory required to push large image layers. Fixes #1680 This change may increase the build time for smaller images. Therefore a command line option to trigger the compression or a more intelligent behaviour may be useful. * Add new command line flag to toggle compressed caching * Add unittest for build with --compressed-caching command line flag set to false
I am building vast images, and I had the same issue. My Kaniko version is v1.15.0. |
Actual behavior
While building and pushing quite a large docker image (say, 8+ gigs), Kaniko's pod gets OOM killed (resource limit is 10GB RAM).
This behavior is weird, since no build steps use this amount of RAM.
Expected behavior
Build success.
To Reproduce
Steps to reproduce the behavior:
Additional Information
I was testing it on different versions of Kaniko:
Triage Notes for the Maintainers
--cache
flagThe text was updated successfully, but these errors were encountered: