✨ Implement devmachinepools#13346
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
4ad0aea to
4c249d0
Compare
|
/test pull-cluster-api-e2e-main-gke |
|
@Karthik-K-N: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions 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-sigs/prow repository. I understand the commands that are listed here. |
sbueringer
left a comment
There was a problem hiding this comment.
Thank you very much!
First round of review. I skipped over some of the controller implementation for now as the changes to the API will ripple through
| const ( | ||
| // DevMachinePoolFinalizer allows ReconcileDevMachinePool to clean up resources. | ||
| DevMachinePoolFinalizer = "devmachinepool.infrastructure.cluster.x-k8s.io" | ||
| ) |
There was a problem hiding this comment.
| const ( | |
| // DevMachinePoolFinalizer allows ReconcileDevMachinePool to clean up resources. | |
| DevMachinePoolFinalizer = "devmachinepool.infrastructure.cluster.x-k8s.io" | |
| ) |
I think let's follow the pattern we have in other types and not introduce a new finalizer (this constant is also unused atm)
There was a problem hiding this comment.
Removed.
Also I checked the devmachine controller, we always set the dockermachine finalizer even for inmemory backed, Is that expected.
| // Template contains the details used to build a replica machine within the Machine Pool | ||
| // +optional | ||
| Template DevMachinePoolBackendTemplate `json:"template"` |
There was a problem hiding this comment.
| // Template contains the details used to build a replica machine within the Machine Pool | |
| // +optional | |
| Template DevMachinePoolBackendTemplate `json:"template"` | |
| // backend contains the details used to build a replica machine within the Machine Pool | |
| // +optional | |
| Backend DevMachinePoolBackendSpec `json:"backend"` |
Let's rename the field/type to be more consistent with other dev types (I'm comparing against DevMachine)
| type DevMachinePoolBackendTemplate struct { | ||
| // docker defines a backend for a DevMachine using docker containers. | ||
| // +optional | ||
| Docker *DockerMachinePoolMachineTemplate `json:"docker,omitempty"` |
There was a problem hiding this comment.
| Docker *DockerMachinePoolMachineTemplate `json:"docker,omitempty"` | |
| Docker *DockerMachinePoolBackendSpec `json:"docker,omitempty"` |
Let's create a copy of DockerMachinePoolMachineTemplate named DockerMachinePoolBackendSpec here in this file
(please add it above DevMachinePoolSpec, to make it easy to diff with dockermachinepool_types.go)
|
|
||
| // Instances contains the status for each instance in the pool | ||
| // +optional | ||
| Instances []DevMachinePoolBackendInstanceStatus `json:"instances,omitempty"` |
There was a problem hiding this comment.
We have to keep this the same way as it is in DockerMachinePool
This entire field is covered by the contract (https://cluster-api.sigs.k8s.io/developer/providers/contracts/infra-machinepool#inframachinepool-instances)
Accordingly the field has to be exactly like documented and we can't introduce sub-levels (but that's fine)
So the delta to DockerMachinePool in status should be just that we use a copy of DockerMachinePoolInstanceStatus called DevMachinePoolInstanceStatus
(and it's correct that we don't have the deprecated field in DevMachinePool)
| - bases/infrastructure.cluster.x-k8s.io_devmachinetemplates.yaml | ||
| - bases/infrastructure.cluster.x-k8s.io_devmachinepools.yaml | ||
| - bases/infrastructure.cluster.x-k8s.io_devmachinepooltemplates.yaml | ||
| # +kubebuilder:scaffold:crdkustomizeresource |
There was a problem hiding this comment.
Let's please cleanup a bit and delete test/infrastructure/docker/internal/webhooks/dockermachinepool.go (it's not doing anything)
There was a problem hiding this comment.
Deleted the dockermachine pool webhook and patch.
| - bases/infrastructure.cluster.x-k8s.io_devmachinepooltemplates.yaml | ||
| # +kubebuilder:scaffold:crdkustomizeresource | ||
|
|
||
| patches: |
There was a problem hiding this comment.
Let's add patches below for devmachinepool and devmachinepooltemplate.
I know they don't need conversion at the moment because they only exist in v1beta2, but it doesn't hurt to have it already configured so we don't miss it in the future
| @@ -0,0 +1,23 @@ | |||
| apiVersion: cluster.x-k8s.io/v1beta2 | |||
| kind: Cluster | |||
| metadata: | |||
There was a problem hiding this comment.
This entire folder is published as release manifests. I would prefer not publishing this for now (same for the ClusterClass)
I would suggest to just use these files for your local tests for now and not check them in.
I've added a follow-up sub task to the umbrella issue that we move all existing templates over to Dev* resources
There was a problem hiding this comment.
Removed, them. Thanks
| return err | ||
| } | ||
|
|
||
| c, err := capicontrollerutil.NewControllerManagedBy(mgr, predicateLog). |
There was a problem hiding this comment.
Let's rebase onto latest main. The location of this util changed so right now the PR is not compiling anymore
4c249d0 to
50a357b
Compare
|
Addressed first set of review comments. Thanks. |
What this PR does / why we need it:
Implement DevMachinePool with DevCluster and backed by DevMachines.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Part of #13270