kpt icon indicating copy to clipboard operation
kpt copied to clipboard

[Question] Migrate kpt 1.0 with execution runtime and network/mount

Open patrickchense opened this issue 4 years ago • 2 comments

Hi,

We have some questions about kpt1.0 while migrating from 0.39 about kpt fn execution runtime. We're using kpt fn run with execution runtime and --network --mount. Function config is like below:

apiVersion: v1
kind: ConfigMap
metadata:
  name: kpt-fn-1
  annotations:
    config.kubernetes.io/local-config: "true"
    config.k8s.io/function: |
      deferFailure: true
      exec:
        path: 
data: {}
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: kpt-fn-1
  annotations:
    config.kubernetes.io/local-config: "true"
    config.k8s.io/function: |
      deferFailure: true
      container:
        image:
        network: true
data: {}

Running the config with

kpt fn run [dir] --network --enable-exec --mount type=bind,src=[dir],dst=/workdir  --result-dir [dir]

I'm glad that kpt1.0 added execution runtime for kpt fn render, but I found out that kpt fn render doesn't support --network and --mount, they are only supported by kpt fn eval.

So my question is, how can we use kpt fn declaratively with execution runtime and network, mount together in 1.0?

patrickchense avatar Feb 08 '22 15:02 patrickchense

@mortent can you help me with this? At least let me know if there is a plan to support network,mount flag in kpt fn render?

patrickchense avatar Feb 18 '22 12:02 patrickchense

@PatrickChenSe sorry for the late response.

One more thing, if one is using exec in fn render, those function binaries will have full access (network/file-system etc.), fn render doesn't sandbox executable in anyways.

We have been hesitant in adding network and mount support in declarative workflows because the rendering of the kpt package will no longer be hermetic and also makes the packages less portable (mounted fs not being same in different machines and system).

Can you share more what do these functions do especially those require network and filesystem access ? I might be able to suggest more idiomatic workflow.

droot avatar May 27 '22 18:05 droot