kpt icon indicating copy to clipboard operation
kpt copied to clipboard

maintain a set of curated kpt functions which can be run without pulling stuff from docker hub

Open ciaranjohnston opened this issue 1 year ago • 3 comments

Describe your problem

From the Sept 2025 meetup

  • Inline curated kpt functions (maintain a set of curated kpt functions which can be run without pulling stuff from docker hub)
    • Let's start to list the functions what we use (starlack, apply-replacement)
    • An option is to use the built in runtime from Porch
    • Gradually we should inline all the KRM functions

ciaranjohnston avatar Oct 29 '25 13:10 ciaranjohnston

Hi @ciaranjohnston thanks for opening this issue — I’d like to start working on it and open a PR.

From the three options mentioned:

Inline curated kpt functions

Use the built-in runtime from Porch

Gradually inline all KRM functions

I propose to start with using the built-in runtime from Porch as the main approach.

I believe this is the best long-term solution because:

It avoids adding and maintaining a new custom runtime inside kpt.

It reuses an existing runtime designed specifically for KRM functions.

It keeps the architecture cleaner and more maintainable over time.

It still allows us to gradually inline or bundle curated functions later if needed.

I will start by working on a PR that integrates the Porch runtime and demonstrates running a small curated set of functions without pulling images from Docker Hub.

Please let me know if this approach sounds good to you.

abdulrahman11a avatar Feb 26 '26 23:02 abdulrahman11a

I think we should investigate using WASM here too. Also, we will need to avoid reintroducing a circular dependency between Porch and kpt which was just recently removed. If we do go with the existing built-in runtime, then we should consider moving it to kpt and allow Porch to consume it.

efiacor avatar Feb 27 '26 00:02 efiacor

I think we should investigate using WASM here too. Also, we will need to avoid reintroducing a circular dependency between Porch and kpt which was just recently removed. If we do go with the existing built-in runtime, then we should consider moving it to kpt and allow Porch to consume it.

@efiacor thanks for your feedback.

From inspecting the krm-functions-catalog, most functions (e.g., set-labels, apply-replacements) are container-based, implemented with Dockerfiles and invoked via --image. This makes a pure WASM approach impractical for now, as it would require rewriting or maintaining parallel execution models.

Using the built-in Porch runtime, refactored to live in kpt, seems the most practical short- to medium-term solution. It avoids Docker dependencies while keeping kpt independent of Porch and maintains a clean architecture.

abdulrahman11a avatar Feb 28 '26 19:02 abdulrahman11a