Skip to content

✨ Implement devmachinepools#13346

Open
Karthik-K-N wants to merge 2 commits intokubernetes-sigs:mainfrom
Karthik-K-N:dev-machinepool
Open

✨ Implement devmachinepools#13346
Karthik-K-N wants to merge 2 commits intokubernetes-sigs:mainfrom
Karthik-K-N:dev-machinepool

Conversation

@Karthik-K-N
Copy link
Contributor

@Karthik-K-N Karthik-K-N commented Feb 17, 2026

What this PR does / why we need it:

Implement DevMachinePool with DevCluster and backed by DevMachines.

[root@karthik-vm-centos cluster-api]# kubectl get cluster
NAME          CLUSTERCLASS      AVAILABLE   CP DESIRED   CP AVAILABLE   CP UP-TO-DATE   W DESIRED   W AVAILABLE   W UP-TO-DATE   PHASE         AGE     VERSION
dev-mp-7608   dev-quick-start   True        1            0              1                                                        Provisioned   9m26s   v1.35.0

[root@karthik-vm-centos cluster-api]# kubectl get machinepool
NAME                     CLUSTER       DESIRED   CURRENT   READY   AVAILABLE   UP-TO-DATE   PHASE       AGE     VERSION
dev-mp-7608-mp-0-pmchk   dev-mp-7608   1         1         0       0           1            ScalingUp   9m30s   v1.35.0

[root@karthik-vm-centos cluster-api]# kubectl get devmachinepool
NAME                     AGE
dev-mp-7608-mp-0-szq42   9m34s

[root@karthik-vm-centos cluster-api]# kubectl get devmachine
NAME                      CLUSTER       FAILURE DOMAIN   PROVISIONED   AGE
dev-mp-7608-zwwdv-vpgtd   dev-mp-7608   fd1              true          9m37s
worker-jysrly             dev-mp-7608                    true          7m18s

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

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 17, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/needs-area PR is missing an area label label Feb 17, 2026
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign chrischdi for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Feb 17, 2026
@Karthik-K-N Karthik-K-N force-pushed the dev-machinepool branch 2 times, most recently from 4ad0aea to 4c249d0 Compare February 17, 2026 12:35
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Feb 17, 2026
@sbueringer sbueringer added the area/provider/infrastructure-docker Issues or PRs related to the docker infrastructure provider label Mar 7, 2026
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/needs-area PR is missing an area label label Mar 7, 2026
@sbueringer
Copy link
Member

/test pull-cluster-api-e2e-main-gke

@k8s-ci-robot
Copy link
Contributor

@Karthik-K-N: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-e2e-main-gke 4c249d0 link true /test pull-cluster-api-e2e-main-gke

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.

Details

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-sigs/prow repository. I understand the commands that are listed here.

Copy link
Member

@sbueringer sbueringer left a comment

Choose a reason for hiding this comment

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

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

Comment on lines +25 to +28
const (
// DevMachinePoolFinalizer allows ReconcileDevMachinePool to clean up resources.
DevMachinePoolFinalizer = "devmachinepool.infrastructure.cluster.x-k8s.io"
)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.
Also I checked the devmachine controller, we always set the dockermachine finalizer even for inmemory backed, Is that expected.

Comment on lines +91 to +93
// Template contains the details used to build a replica machine within the Machine Pool
// +optional
Template DevMachinePoolBackendTemplate `json:"template"`
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// 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)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

type DevMachinePoolBackendTemplate struct {
// docker defines a backend for a DevMachine using docker containers.
// +optional
Docker *DockerMachinePoolMachineTemplate `json:"docker,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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"`
Copy link
Member

Choose a reason for hiding this comment

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

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
Copy link
Member

Choose a reason for hiding this comment

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

Let's please cleanup a bit and delete test/infrastructure/docker/internal/webhooks/dockermachinepool.go (it's not doing anything)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Deleted the dockermachine pool webhook and patch.

- bases/infrastructure.cluster.x-k8s.io_devmachinepooltemplates.yaml
# +kubebuilder:scaffold:crdkustomizeresource

patches:
Copy link
Member

Choose a reason for hiding this comment

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

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:
Copy link
Member

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed, them. Thanks

return err
}

c, err := capicontrollerutil.NewControllerManagedBy(mgr, predicateLog).
Copy link
Member

@sbueringer sbueringer Mar 7, 2026

Choose a reason for hiding this comment

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

Let's rebase onto latest main. The location of this util changed so right now the PR is not compiling anymore

@Karthik-K-N
Copy link
Contributor Author

Addressed first set of review comments. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/provider/infrastructure-docker Issues or PRs related to the docker infrastructure provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants