Skip to content
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

Allow to avoid the --mount option #902

Open
mgoltzsche opened this issue Aug 3, 2020 · 4 comments
Open

Allow to avoid the --mount option #902

mgoltzsche opened this issue Aug 3, 2020 · 4 comments
Labels
area/hydrate enhancement New feature or request p2 triaged Issue has been triaged by adding an `area/` label

Comments

@mgoltzsche
Copy link

mgoltzsche commented Aug 3, 2020

Currently when a function needs to access the project's file system the --mount option must be provided to kpt fn run.
This is very project-specific and seems unnecessary. It would be great if kpt could be used in a project-agnostic way (at least in most common cases).

I imagine two ways of supporting that:
a) Always mount the project directory at a fixed path into the function container - actually the directory in which the function is specified should be mounted to be independent from the current project/working directory.
b) Wrap all non-yaml files in resources with a special kind (without applying them) and provide them to the function via stdin so that the function container can e.g. write them to its file system (I did that with kustomizr).

@mgoltzsche mgoltzsche changed the title Avoid --mount option Allow to avoid the --mount option Aug 3, 2020
@prachirp
Copy link
Contributor

prachirp commented Aug 5, 2020

cc @monopole feature request for kpt fn run

@prachirp prachirp added area/hydrate triaged Issue has been triaged by adding an `area/` label labels Aug 5, 2020
@mgoltzsche
Copy link
Author

mgoltzsche commented Sep 15, 2020

I was also asking myself how to run kpt in a build pipeline within k8s. There the usual problem occurs that docker is required (while in most cases functions may not be run inside k8s but on a developer's machine I imagine they need to be run in a pull request pipeline just to verify that everything has been generated consistently).

Besides solving this with podman (I didn't try it yet but it should do) it would be great to have a simple, k8s-native solution to run functions without the need to mount the docker.sock or run a privileged container.

I figure one could translate docker run calls to kubectl run but this would only be a simple solution if there are no volume mounts involved.

@wstrange
Copy link

wstrange commented Sep 15, 2020

I was also asking myself how to run kpt in a build pipeline within k8s. There the usual problem occurs that docker is required.

I have the same question. We use Tekton and Kaniko today to build images in k8s without requiring access to the docker socket.

kpt functions feel like they are tricky to integrate with "K8S native"

@droot droot added this to the v1.0 milestone Jan 5, 2021
@droot droot added the enhancement New feature or request label Jan 5, 2021
@mikebz mikebz removed this from the v1.0 alpha milestone Mar 2, 2021
@mgoltzsche
Copy link
Author

mgoltzsche commented Mar 7, 2021

Potentially this could be solved with #1151.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hydrate enhancement New feature or request p2 triaged Issue has been triaged by adding an `area/` label
Projects
None yet
Development

No branches or pull requests

5 participants