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

⚠️ MachinePool API Controller Implementation #1952

Merged

Conversation

juan-lee
Copy link
Contributor

What this PR does / why we need it:
Adds MachinePool controller implementation described in the MachinePool API proposal.

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 20, 2019
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Dec 20, 2019
@juan-lee
Copy link
Contributor Author

FYI - I'll add tests before removing the [WIP] flag.

@ncdc
Copy link
Contributor

ncdc commented Jan 9, 2020

@juan-lee is this ready for an initial round of reviews?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 9, 2020
@juan-lee juan-lee force-pushed the machinepool-controller branch from 6cfbdce to cab374c Compare January 10, 2020 15:02
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 10, 2020
@juan-lee
Copy link
Contributor Author

@juan-lee is this ready for an initial round of reviews?

Yes, please. @ncdc

@juan-lee juan-lee force-pushed the machinepool-controller branch from cab374c to 988b198 Compare January 10, 2020 15:10
@juan-lee juan-lee changed the title [WIP] ⚠️ MachinePool API Controller Implementation ⚠️ MachinePool API Controller Implementation Jan 13, 2020
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 13, 2020
@ncdc ncdc added this to the v0.3.0 milestone Jan 16, 2020
Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

First pass, looking good so far!

controllers/machinepool_controller.go Outdated Show resolved Hide resolved
controllers/machinepool_controller.go Outdated Show resolved Hide resolved
controllers/machinepool_controller.go Outdated Show resolved Hide resolved
controllers/machinepool_controller_phases.go Outdated Show resolved Hide resolved
controllers/machinepool_controller_phases.go Outdated Show resolved Hide resolved
controllers/machinepool_controller_phases.go Outdated Show resolved Hide resolved
@juan-lee juan-lee force-pushed the machinepool-controller branch from 988b198 to be50ed6 Compare January 27, 2020 15:14
Copy link
Contributor

@ncdc ncdc left a comment

Choose a reason for hiding this comment

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

Soooo sorry for the delay in reviewing this!

bootstrap/kubeadm/controllers/kubeadmconfig_controller.go Outdated Show resolved Hide resolved
controllers/machinepool_controller.go Outdated Show resolved Hide resolved
controllers/machinepool_controller.go Outdated Show resolved Hide resolved
controllers/machinepool_controller.go Outdated Show resolved Hide resolved
controllers/machinepool_controller.go Outdated Show resolved Hide resolved
controllers/machinepool_controller_phases.go Outdated Show resolved Hide resolved
controllers/machinepool_controller_noderef.go Outdated Show resolved Hide resolved
controllers/machinepool_controller_phases.go Show resolved Hide resolved
controllers/machinepool_controller_phases.go Outdated Show resolved Hide resolved
controllers/machinepool_controller_phases.go Outdated Show resolved Hide resolved
@ncdc
Copy link
Contributor

ncdc commented Jan 27, 2020

@juan-lee @CecileRobertMichon will you all have time over the next week or so to work on review comments & unit tests? Anything else we can do to help?

@juan-lee juan-lee force-pushed the machinepool-controller branch from be50ed6 to ce2bab2 Compare January 28, 2020 15:38
@juan-lee
Copy link
Contributor Author

@juan-lee @CecileRobertMichon will you all have time over the next week or so to work on review comments & unit tests? Anything else we can do to help?

@ncdc I just addressed the comments sans validation and unit tests. I should have cycles today or tomorrow to get those wrapped up. Thanks for the review @ncdc @vincepri @CecileRobertMichon @JoelSpeed

Copy link
Contributor

@ncdc ncdc left a comment

Choose a reason for hiding this comment

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

@juan-lee it looks like there's still a decent amount of outstanding comments from my earlier review.

controllers/machinepool_controller.go Outdated Show resolved Hide resolved
controllers/machinepool_controller.go Outdated Show resolved Hide resolved
@@ -57,13 +76,181 @@ func (r *MachinePoolReconciler) SetupWithManager(mgr ctrl.Manager, options contr
r.controller = c
r.recorder = mgr.GetEventRecorderFor("machinepool-controller")
r.config = mgr.GetConfig()

r.scheme = mgr.GetScheme()
return nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Pending resolution of https://github.com/kubernetes-sigs/cluster-api/pull/2101/files#r371995294, may need to add a watch map function from Cluster -> MachinePool

Copy link
Member

Choose a reason for hiding this comment

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

We should likely also port over the immutability check on ClusterName as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The immutability check is part of a validation webhook @detiber? Would it be okay to enable the validation webhooks and immutability check in a follow-up PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure I fully understand what's required here. @vincepri @detiber could either of you clarify?

Copy link
Member

Choose a reason for hiding this comment

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

I'm not totally sure (the link to the discussion is not working), but do we need to receive reconcile requests here when an Cluster object is updated?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have not encountered the need for triggering when cluster is updated during my testing, but I might not be exercising the scenario ya'll have in mind. @vincepri @detiber @ncdc Could I get some clarification or can we address this in a subsequent PR?

controllers/machinepool_controller.go Outdated Show resolved Hide resolved
@juan-lee juan-lee force-pushed the machinepool-controller branch from ce2bab2 to 5dd9d65 Compare January 29, 2020 15:26
@juan-lee juan-lee force-pushed the machinepool-controller branch from 5dd9d65 to b8faf17 Compare January 30, 2020 04:00
@juan-lee juan-lee force-pushed the machinepool-controller branch 4 times, most recently from b3cb727 to efd7f2b Compare February 8, 2020 23:52
@juan-lee
Copy link
Contributor Author

juan-lee commented Feb 9, 2020

@ncdc @vincepri @detiber All comments have been addressed (pending clarification on one) and validation/unit tests are done. Would love a final pass over the PR.

@vincepri
Copy link
Member

Taking a look today

bootstrap/kubeadm/controllers/kubeadmconfig_controller.go Outdated Show resolved Hide resolved
@@ -57,13 +76,181 @@ func (r *MachinePoolReconciler) SetupWithManager(mgr ctrl.Manager, options contr
r.controller = c
r.recorder = mgr.GetEventRecorderFor("machinepool-controller")
r.config = mgr.GetConfig()

r.scheme = mgr.GetScheme()
return nil
Copy link
Member

Choose a reason for hiding this comment

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

I'm not totally sure (the link to the discussion is not working), but do we need to receive reconcile requests here when an Cluster object is updated?

controllers/machinepool_controller.go Outdated Show resolved Hide resolved
controllers/machinepool_controller.go Outdated Show resolved Hide resolved
controllers/machinepool_controller_noderef.go Outdated Show resolved Hide resolved
controllers/machinepool_controller_noderef.go Outdated Show resolved Hide resolved
controllers/machinepool_controller_noderef.go Outdated Show resolved Hide resolved
controllers/machinepool_controller_noderef.go Outdated Show resolved Hide resolved
controllers/machinepool_controller_noderef.go Outdated Show resolved Hide resolved
controllers/machinepool_controller_noderef.go Outdated Show resolved Hide resolved
@juan-lee juan-lee force-pushed the machinepool-controller branch from efd7f2b to e236dfc Compare February 15, 2020 23:20
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 15, 2020
@juan-lee juan-lee force-pushed the machinepool-controller branch 2 times, most recently from 7b54bff to d0754e1 Compare February 16, 2020 02:36
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 16, 2020
@juan-lee juan-lee force-pushed the machinepool-controller branch from d0754e1 to fd38a74 Compare February 16, 2020 02:39
@juan-lee juan-lee force-pushed the machinepool-controller branch from fd38a74 to d3dcb27 Compare February 16, 2020 15:41
@juan-lee
Copy link
Contributor Author

/test pull-cluster-api-capd-e2e

@vincepri
Copy link
Member

/milestone v0.3.0-rc.1

@k8s-ci-robot k8s-ci-robot modified the milestones: v0.3.0, v0.3.0-rc.1 Feb 16, 2020
Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: juan-lee, vincepri

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 16, 2020
@juan-lee
Copy link
Contributor Author

/assign @davidewatson

@juan-lee
Copy link
Contributor Author

/retest

Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

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

lgtm

@vincepri
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 18, 2020
@k8s-ci-robot k8s-ci-robot merged commit 4ff9ae5 into kubernetes-sigs:master Feb 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

8 participants