-
Notifications
You must be signed in to change notification settings - Fork 4
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
✨ Add preparation of clusterclass #141
✨ Add preparation of clusterclass #141
Conversation
Check out this example from Cluster API You seem to be missing a couple of things, e.g. Have you been able to create different cluster with different configurations from your ClusterClass template? If yes can you maybe provide some docs on how you did it? I've checked out your branch, because I have never used ClusterClass before and wanted to test it. I couldn't really figure out how to do it, therefore I dived a bit into the documentation. If I'm not wrong here, you are mixing up multiple things. We need to work with JSON patches. jsonPatches:
- op: add
path: /spec/template....
valueFrom:
variable: xxxx Therefore, you cannot have environment variables in the clusterclass template Instead of: kind: IonosCloudMachineTemplate
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
metadata:
name: "${CLUSTER_CLASS_NAME}-template"
namespace: '${NAMESPACE}'
spec:
template:
spec:
numCores: ${IONOSCLOUD_MACHINE_NUM_CORES}
memoryMB: ${IONOSCLOUD_MACHINE_MEMORY_MB}
disk:
image:
id: ${IONOSCLOUD_MACHINE_IMAGE_ID} You would then need a patch for that. Something like kind: IonosCloudMachineTemplate
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
metadata:
name: "${CLUSTER_CLASS_NAME}-template"
namespace: '${NAMESPACE}'
spec:
template: {}
...
patches:
- name: workerMachineType
definitions:
- selector:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: IonosCloudMachineTemplate
matchResources:
machineDeploymentClass:
names:
- XXXX
jsonPatches:
- op: add
path: /spec/template/spec/numCores
valueFrom:
variable: numCPUs
- op: add
path: /spec/template/spec/memoryMB
valueFrom:
variable: memoryMB
- op: add
path: /spec/template/spec/disk/image/id
valueFrom:
variable: imageID
... |
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.
Hi there, nice work.
I haven't tested this, only read it, and all my comments amount to nitpicking, so from my side this is okay, but it's not my place to greenlight this. My only qualification here is also having written a clusterclass.
I've added a fixed some values and added a bash script for basic testing. Followup PRs can add:
|
@lubedacht Everything should be fixed. |
Signed-off-by: Jan Jansen <[email protected]>
59c4735
to
5143199
Compare
5143199
to
ecf23e2
Compare
Quality Gate passedIssues Measures |
**What is the purpose of this pull request/Why do we need it?** **Issue #, if available:** **Description of changes:** **Special notes for your reviewer:** **Checklist:** - [x] Documentation updated - [ ] Unit Tests added - [ ] E2E Tests added - [x] Includes [emojis](https://github.com/kubernetes-sigs/kubebuilder-release-tools?tab=readme-ov-file#kubebuilder-project-versioning) --------- Signed-off-by: Jan Jansen <[email protected]>
**What is the purpose of this pull request/Why do we need it?** **Issue #, if available:** **Description of changes:** **Special notes for your reviewer:** **Checklist:** - [x] Documentation updated - [ ] Unit Tests added - [ ] E2E Tests added - [x] Includes [emojis](https://github.com/kubernetes-sigs/kubebuilder-release-tools?tab=readme-ov-file#kubebuilder-project-versioning) --------- Signed-off-by: Jan Jansen <[email protected]>
What is the purpose of this pull request/Why do we need it?
Issue #, if available:
Description of changes:
Special notes for your reviewer:
Checklist: