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

kpack & Shipwright compatible k3d cluster setup #557

Merged
merged 3 commits into from
Jan 8, 2025

Conversation

sgaist
Copy link
Collaborator

@sgaist sgaist commented Nov 29, 2024

Describe your changes

This PR adds a script that allows to setup a k3d cluster in such a way that kpack and Shipwright can use it.

A k3d registry is created externally so it can be re-used if the cluster must be re-created without incurring the time required to populate it.

kpack and Shipwright can be optionally (and independently) deployed.

In the context of kpack, the image required for the builder is copied to the registry using a Kubernetes job.

@sgaist sgaist requested a review from a team as a code owner November 29, 2024 16:25
@sgaist sgaist force-pushed the sgaist/kpack-resources branch from 22c11c0 to 40da545 Compare November 29, 2024 16:31
@Panaetius Panaetius force-pushed the sgaist/kpack-resources branch from 40da545 to 6f2a1ba Compare December 2, 2024 07:27
@Panaetius Panaetius force-pushed the kpack-resources branch 2 times, most recently from 4a1af72 to 8234729 Compare December 2, 2024 08:32
@Panaetius Panaetius force-pushed the sgaist/kpack-resources branch 2 times, most recently from ca32bfa to 3d31917 Compare December 2, 2024 08:37
@Panaetius Panaetius force-pushed the sgaist/kpack-resources branch from 3d31917 to a2376a9 Compare December 2, 2024 08:40
@Panaetius Panaetius force-pushed the kpack-resources branch 2 times, most recently from 46ebfeb to 41b31b9 Compare December 2, 2024 08:51
@Panaetius Panaetius force-pushed the sgaist/kpack-resources branch 2 times, most recently from 7634433 to 980c77a Compare December 2, 2024 09:01
@Panaetius Panaetius force-pushed the sgaist/kpack-resources branch from 980c77a to 428d073 Compare December 2, 2024 09:22
Copy link
Member

@olevski olevski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this be a bit easier to maintain if the setup-k3d-cluster.sh script was instead just a python script we invoke with the dev environment?

@sgaist
Copy link
Collaborator Author

sgaist commented Dec 6, 2024

@olevski sorry for the late reply, I missed the notification.

I initially wrote it as a bash script to simplify the Makefile with regard to the waiting phases and customization.

I don't mind rewriting it in python but I am not sure to follow the "we invoke with the dev environment". What do you have in mind ?

@olevski
Copy link
Member

olevski commented Dec 9, 2024

I don't mind rewriting it in python but I am not sure to follow the "we invoke with the dev environment". What do you have in mind ?

I meant the poetry environment that is used every time you do poetry run ...

@sgaist
Copy link
Collaborator Author

sgaist commented Dec 10, 2024

I was rather seeing it as a mean to setup your cluster once so you can then use it for development in the same way that is done currently.

@olevski
Copy link
Member

olevski commented Dec 10, 2024

I was rather seeing it as a mean to setup your cluster once so you can then use it for development in the same way that is done currently.

That is how I understood it. And I meant this as a non-blocking question/suggestion. Which I should have clarified earlier. So its not a big deal either way.

@Panaetius
Copy link
Member

since we're leaning more and more towards shipwright instead of kpack, only the registry setup in this PR seems really relevant. But setting up shipwright in a devenv would be nice.

@sgaist
Copy link
Collaborator Author

sgaist commented Dec 10, 2024

@Panaetius would you like me to refactor this PR and port it to Shipwright or rather make a new one ?

@Panaetius
Copy link
Member

Panaetius commented Dec 10, 2024

I'm fine with either, whichever is easier for you

The setup creates an independent k3d registry that can be
reused and configures the k3d cluster to be able to access
it.

The registry thus survives cluster deletion and this will
speed up cluster recreation.

kpack can access it through http.
@Panaetius Panaetius force-pushed the sgaist/kpack-resources branch from 7a5a79c to 1d49642 Compare December 10, 2024 13:09
The script can now install either shipwright or kpack depending
on what should be tested.

The Makefile now install shipwright be default
@sgaist sgaist changed the title kpack compatible k3d cluster setup kpack & shipwright compatible k3d cluster setup Dec 13, 2024
@sgaist sgaist changed the title kpack & shipwright compatible k3d cluster setup kpack & Shipwright compatible k3d cluster setup Dec 13, 2024
@sgaist sgaist merged commit 4904e9f into kpack-resources Jan 8, 2025
15 checks passed
@sgaist sgaist deleted the sgaist/kpack-resources branch January 8, 2025 09:21
m-alisafaee pushed a commit that referenced this pull request Jan 30, 2025
* refactor: implement k3d cluster creation working with kpack and Shipwright

The setup creates an independent k3d registry that can be
reused and configures the k3d cluster to be able to access
it.

The registry thus survives cluster deletion and this will
speed up cluster recreation.

kpack and Shipwrite can access it through http.

The script can install either or both solutions.

The Makefile installs Shipwright be default
m-alisafaee pushed a commit that referenced this pull request Jan 30, 2025
* refactor: implement k3d cluster creation working with kpack and Shipwright

The setup creates an independent k3d registry that can be
reused and configures the k3d cluster to be able to access
it.

The registry thus survives cluster deletion and this will
speed up cluster recreation.

kpack and Shipwrite can access it through http.

The script can install either or both solutions.

The Makefile installs Shipwright be default
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.

3 participants