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

Support for kpack service bindings #5

Open
devhuber opened this issue Aug 12, 2022 · 11 comments
Open

Support for kpack service bindings #5

devhuber opened this issue Aug 12, 2022 · 11 comments
Labels
enhancement New feature or request

Comments

@devhuber
Copy link

devhuber commented Aug 12, 2022

It would be great if the tool could support creating the service bindings for kpack.
Would it also be a volume mount to the builder?
Sofar I don't know how one would add the bindings of this sort via kpack.
Or could it look something like this, where "..." is the URI to the file (might also be an https URL)?

apiVersion: v1
kind: Secret
metadata:
  name: dependencies
type: service.binding/dependency-mapping
stringData:
  type: dependency-mapping
  0d82ad4821b55d276d25486132f708f4cc747e242a9ce256fdf1c7f21979a94c : ...
  2bda48088925a5cead341ff9ae8b12c4075937f444827946a268ba773cf0339b : ...
  4f07a1c52b47c77b4e6a50623055de584d347002954ffa0029aedc915c035a17 : ...
  583d7da65e1b3f4b470e595c21d55dd3eb176789c7dea7d15cbec42b74877b50 : ...
  73c602ff0790a4ab325db06cae45f488f7e3613d781d688a204efa6325cebdd0 : ...
  74de76313848ef719d066854fe94dcec53fdcd111c630921b6b24e1b2e6897e7 : ...
  7d1056af3efbc998ac62c31197e18f32f7e58ac086d4636e559cc57d5edfb23d : ...
  883a25a15a6aa9d74ae35b23efdb6dced85e52b9519fc590313cec6c2626af79 : ...
  b389036c7ba1eca72c784c73c02d9397e81ced07a713f289430d7089376aac7f : ...
  c0feff461fb48d6b5745638fa6ac3901238b5fcbf09a2fcc5e771c55a743f0df : ...
  cf23e85f5a6b4e22007ce2572d38182f535ad22fcf937def8f781181fbb86b65 : ...
  d9e9ba6e872c2d7073e69407196be29db27d4fcd22de6ca7dde40840b934c286 : ...
@dmikusa dmikusa added the enhancement New feature or request label Dec 29, 2022
@doddisam
Copy link

@dmikusa - We are looking for similar feature, so is there any plan to get this in near future ?

@dmikusa
Copy link
Owner

dmikusa commented Mar 28, 2024

Please check out paketo-buildpacks/rfcs#302. I think this is going to be the path forward for most users with respect to dependency mapping. Please let me know though.

To move this one forward, i think I'd need to get some examples of what we need the tool to generate. I don't have kpack deployed, so I can't easily make them. If you give me some templates, it's pretty easy to make the tool generate them.

@doddisam
Copy link

If my understanding is right ,currently pack users should use the --volume flag to mount a binding directory into the build or app containers. Users of the kpack platform should store key value pairs in a Kubernetes Secret and provide that secret and associated metadata to an Image as described in the kpack documentation(opens in a new tab).

Is binding tool going to supports creation of secrets in future ?

@doddisam
Copy link

doddisam commented Apr 3, 2024

Basically i am looking for the tool to create binding for all the dependencies in the form of secrets like below. If the bt tool can provide secret file as an output it will very easy for kpack user to just create secret and build image.

image

@doddisam
Copy link

@dmikusa - Can above format be possible from the bt tool ?

@dmikusa
Copy link
Owner

dmikusa commented Apr 15, 2024

Yes, the tool could definitely generate secrets.

What is your thought on how to tell the CLI you want it to generate the secrets file? I could add a flag to bt dm, like bt dm --k8s-secrets that when set would also write the secrets file.

Also, what is your thought on running the command multiple times? I suspect that we'd need to read the secrets file, locate the particular dependency mapping and then update it (if modified) or add new mappings to the list of mappings. Does that sound reasonable?

@doddisam
Copy link

Yes, Something like bt dm --k8s-secrets should work.

I think we can just add new mappings to the list when command is run multiple times.

@doddisam
Copy link

@dmikusa Just checking if the above capability is added to the tool?

@dmikusa
Copy link
Owner

dmikusa commented May 26, 2024

Sorry @doddisam I went to look at this again, and I'm not sure I follow in terms of what the value of the secret should be. In the example you provided, it's pointing to artifactory, which isn't really consistent with what the tool does now. It's purpose is to fetch from remote URLs and to generate a local folder structure that could be used as place from which to fetch the dependencies. Given that, the value would probably be file://... but I'm not sure what makes the most sense there in terms of K8s. What were you thinking?

I would also refer you back to #5 (comment) because if you're just trying to point your buildpacks to an artifactory cache that you have already set up, you can do that with the dependency mirror RFC, which has been implemented for all of the Java-based buildpacks.

See https://paketo.io/docs/howto/configuration/#dependency-mirrors for docs on using that.

@doddisam
Copy link

doddisam commented Jun 21, 2024

@dmikusa will dependency mirrors work for dotnet build pack also ?

@dmikusa
Copy link
Owner

dmikusa commented Jun 21, 2024

I believe that it should. It looks like packit implemented the RFC a few months back, see paketo-buildpacks/packit#563.

So long as that set of buildpack has updated packit to at least https://github.com/paketo-buildpacks/packit/releases/tag/v2.13.0.

I don't think there should be anything else that's needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants