Skip to content

✨ Add support for OCI image volumes instead of init containers (KEP-4639)#375

Open
andersonshatch wants to merge 12 commits intomasterfrom
oci-image-volumes-support
Open

✨ Add support for OCI image volumes instead of init containers (KEP-4639)#375
andersonshatch wants to merge 12 commits intomasterfrom
oci-image-volumes-support

Conversation

@andersonshatch
Copy link
Contributor

KEP-4639 introduced OCI image volume support, allowing you to mount a container as a volume.
This is essentially what the operator does, but the init container first has to copy its contents to a volume mounted on to the application container.
With Kubernetes 1.35, this feature got GA'd, and adding this support means we no longer need to have an init container.
This helps for the larger images we mount, as the copy is no longer necessary.

(Unscientific) Testing locally, this cuts out the following time where the init container runs to copy

Language Run 1 Run 2 Run 3 Run 4 Run 5
.NET Core 5s 1s 1s 1s 1s
Flex 15s 9s 16s 12s 10s
Java 0s 0s 1s 0s 0s
Node.js 6s 7s 5s 5s 7s
PHP 0s 1s 0s 1s 1s
Python 2s 0s 3s 0s 1s

It's opt-in since we must maintain backwards compatibility.

In testing, it seems no k8s runtime version currently supports the sub path option, so we have to mount the full image as a volume, rather than just the /contrast directory.

We may want to mark this as experimental, as it's new, and maybe we find out we want to maintain init containers for some other reason down the line?
Maybe we also want to collect telemetry?

@andersonshatch andersonshatch requested a review from a team as a code owner March 11, 2026 11:16
@andersonshatch
Copy link
Contributor Author

Added some Claude/Copilot written tests, new territory for me. Not sure if these are any good.
I suppose 1.35 should also be added to the manifest/integration testing matrix.

@andersonshatch andersonshatch force-pushed the oci-image-volumes-support branch from 3e32254 to 3a4cdfa Compare March 11, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants