-
Notifications
You must be signed in to change notification settings - Fork 253
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
🌱 Enhance Tilt integration with CAPO using a ClusterClass template #1833
🌱 Enhance Tilt integration with CAPO using a ClusterClass template #1833
Conversation
✅ Deploy Preview for kubernetes-sigs-cluster-api-openstack ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Hi @maxrantil. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
Sounds interesting! Could we have a few lines in the documentation on how to use it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright let's see if I understood this.
openstack_env.rc
reads the e2e_conf.yaml and sets environment variables based on thatupdate_tilt-settings.sh
adds substitutions to the tilt settings that would be used to render the template when creating a Cluster from the tilt GUI
Is that correct?
I'm a bit torn on this. On the one hand it is nice to take the settings directly from the e2e config. I could have multiple different configs and easily generate clusters based on them. And we don't have to keep the e2e config in sync with anything else.
On the other hand, this means that the ClusterClass is basically unusable without an e2e config and/or script to render it. That is not so nice. For this reason I would like to put some default values for at least some of the variables. For example, I suggest putting default values for the image, network, DNS servers, failure domain and machine flavors. For the image I think we should also use a ClusterClass variable to set the version as part of the name.
Finally, I think it would be very nice to be able to use a pre-existing secret instead of generating it as part of the template. This is the hardest variable to fill and we cannot really provide a default, so it makes more sense then to expect the user to provide it as a secret already in Kubernetes.
8133f49
to
52ea4a7
Compare
Yes, that is correct.
The script will be unusable without the e2e config but your can always set the variables yourself so the ClusterClass can still be useful if you do that. I now made the script fail if the
Okey I did as you suggested except for for
This part I am now fully understanding. I added some lines in the README.txt file in p.s. I know I will need to trim the README a little after all is done. Question: Is the README the right place for that or should it be in any of the files in |
I expressed myself badly. What I mean is that it would be incredibly inconvenient to use the ClusterClass. Think about the clouds.yaml file that is needed. Who in their right mind has it stored base64 encoded? They would need to encode it and then put it in a variable so that we can then render the template which requires this variable to be present.
Not sure I follow? As long as the secret is part of the template I don't see how I could bring my own? It would get overwritten by the secret in the template, and I would still need to have a value set for that environment variable. I could possibly overwrite it after I apply the template but that doesn't seem nice either.
I think it could fit better in development.md |
Isn't everybody having a clouds.yaml file? To get it encoded you just need to run Thanks for all the clarification about different kinds of secrets. I have been a little confused about that part myself that is also why I have been doing it the same way as the earlier templates. |
Yes everybody should have a clouds.yaml. But not everybody runs linux, not everybody has yq installed, not everybody has CAPO cloned so they can easily source this file. This is not a structure we want to have in all templates IMO. It works well for automated CI but it is not a nice for end users.
|
Okey I get you and I agree fully. I didn't understand that those earlier templates where there for CI usage. I will modify it so there will only be 2-5 variables to set for the user instead of running any scripts for setting variables. |
ba51671
to
35c26ee
Compare
35c26ee
to
2ba2892
Compare
8aacafd
to
2c9c6e6
Compare
This section provides a guide to create a Kubernetes cluster using ClusterClass. It covers the process of setting up environment variables, creating a Kind cluster, configuring a secret, applying ClusterClass and deploying the cluster. | ||
|
||
### Setting Environment Variables | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't know whether we want to do this here as we should have doc guide you in doing setup of those envar?
https://github.com/kubernetes-sigs/cluster-api-provider-openstack/tree/main/docs
or anyghing special for clusterclass?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. The main difference and benefit here is that we are adding a ClusterClass that is geared specifically at development. It has defaults that fit the devstack setup so that as few variables as possible are needed. I think we need to point this out @maxrantil
I'll add a few suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to explain it more clear in the documentation now. See what you think.
This section provides a guide to create a Kubernetes cluster using ClusterClass. It covers the process of setting up environment variables, creating a Kind cluster, configuring a secret, applying ClusterClass and deploying the cluster. | ||
|
||
### Setting Environment Variables | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. The main difference and benefit here is that we are adding a ClusterClass that is geared specifically at development. It has defaults that fit the devstack setup so that as few variables as possible are needed. I think we need to point this out @maxrantil
I'll add a few suggestions
6fd4c39
to
4e7b443
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! I'm happy with this now 🙂
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lentzi90, maxrantil The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test pull-cluster-api-provider-openstack-e2e-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I finally managed to get tilt working, thanks for that nice tutorial !
I find it super useful. I had minor comments, otherwise LGTM.
Thanks again
85e15e6
to
f5c9bb9
Compare
Signed-off-by: Max Rantil <max.rantil@est.tech>
f5c9bb9
to
9a71402
Compare
This is wonderful. If you have time we'll want to have the new templates generated from our existing kustomize or they'll start to drift. I wouldn't want to hold it up for that, though. /lgtm |
@maxrantil I wanted to thank you for your contribution. This really helped me to get into Tilt (and probably changed my life 🤣) ! |
Thank you all for your lovely feedback <3 |
What this PR does / why we need it:
This PR introduces a ClusterClass template to enhance Tilt integration with CAPO, leveraging the existing CAPI setup. It simplifies cluster creation.
Which issue(s) this PR fixes
Fixes #1767
TODOs:
/hold