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

Machine api #645

Closed
wants to merge 3 commits into from
Closed

Machine api #645

wants to merge 3 commits into from

Conversation

enxebre
Copy link
Member

@enxebre enxebre commented Dec 18, 2018

What this PR does / why we need it:
Decouple the machine API from the Cluster API group so they can be promoted at separate cadence.

This will help to solidify boundaries between "cluster" and "machines" so one API is not necessarily holding back the other one, hence this will favour adoption for use cases where a consumer wants to leverage solely one of the APIs. The most common use case is where a user wants to leverage the machine API over a bespoke "cluster" deployment

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Related to:
#490
#497
#639
#644

Special notes for your reviewer:

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

Release note:


@k8s-ci-robot k8s-ci-robot added 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. labels Dec 18, 2018
@k8s-ci-robot
Copy link
Contributor

Hi @enxebre. Thanks for your PR.

I'm waiting for a kubernetes-sigs or kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 18, 2018
@enxebre
Copy link
Member Author

enxebre commented Dec 18, 2018

Copy link

@frobware frobware left a comment

Choose a reason for hiding this comment

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

Overall LGTM and really nice to see this being split up.

Not sure that machine/common as a package makes sense anymore.

Isn't everything in machine/common only related to machines? If so, can this not be moved up into machine?

'common' as a package name doesn't really convey much.

@@ -42,16 +45,16 @@ func newClusterStatus(errorReason common.ClusterStatusError, errorMessage string
}
}

func newMachineStatus(nodeRef *v1.ObjectReference, errorReason *common.MachineStatusError, errorMessage *string) v1alpha1.MachineStatus {
return v1alpha1.MachineStatus{
func newMachineStatus(nodeRef *v1.ObjectReference, errorReason *machinecommon.MachineStatusError, errorMessage *string) machinev1alpha1.MachineStatus {

Choose a reason for hiding this comment

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

No strictly related to your overall change but machinecommon seems an oxymoron. It's not actually common if it is related to machines. And 'common' generally doesn't convey much.


package apis

//import (

Choose a reason for hiding this comment

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

Why are we committing commented out code?

limitations under the License.
*/

package common

Choose a reason for hiding this comment

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

So now I'm wondering why this is common. Can this not all move to ../machines? It would convey so much more as it is directly nested under machines.

pkg/util/util.go Outdated
@@ -177,33 +178,33 @@ func GetNamespaceOrDefault(namespace string) string {
return namespace
}

func ParseClusterYaml(file string) (*clusterv1.Cluster, error) {
func ParseClusterYaml(file string) (*cluster.Cluster, error) {

Choose a reason for hiding this comment

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

[For consistency] Why is this no longer clusterv1?

@enxebre enxebre force-pushed the machine-api branch 2 times, most recently from 58e44eb to 2e1a263 Compare December 18, 2018 10:56
@alvaroaleman
Copy link
Member

I am very much not in favor of this. Was there a situation already in which one part of the API held back the other one?

The cluster-api repo is in my opinion about two things:

  • Types that are common among different implementations and are used by different implementers in order to ensure compatibility
  • A set of controller which an implementer may or may not use, depending on their needs

I think the actual critique here is not so much about the the types themselves being coupled strongly but about the machine actuator enforcing the usage of a cluster cr even when one does not want to manage the whole cluster with it.

That however is a shortcoming of the implementation that is in this repository. There are other implementations that work differently out there.

The fix for this issue should be one of:

  • Changing the implementation
  • Adding another implementation
  • Advising downstream consumers to build their own implementation if the machine actuator does not suit their needs

But not changing anything on this API itself.

@enxebre
Copy link
Member Author

enxebre commented Dec 19, 2018

The cluster-api repo is in my opinion about two things:

Types that are common among different implementations and are used by different implementers in order to ensure compatibility
A set of controller which an implementer may or may not use, depending on their needs

@alvaroaleman thanks for feedback. I agree, upstream solution still should be valid and useful for many use cases, and provide the "right common" for guiding and therefore favouring adoption. As the cluster api overall project we'll still need to solve problems related to ha/cluster/control-plane/infra/bootstrapping which imho should evolve an API orthogonally to the "machine" API where the scope is more limited by nature. This is to provide balance between flexibility and having a manageable contained scope for the different layers of the project by giving clear boundaries and separation of responsibilities regardless the controllers implementation upstream/downstream

@smarterclayton
Copy link

Dropping in because this came up at KubeCon - historically, a Kube API group is intended to roughly encompass a lifecycle. That lifecycle has sometimes been SIG defined (autoscaling) but has also been related to orthogonal features (batch and v2beta1 being created for cronjob specifically, or the split between the various parts of what sig-auth controls). When boundaries can exist between lifecycles, we strongly recommend those be created. Federation v1 is a cautionary tale around coupling too closely between "high level API" (the workloads) and the low level api (the workload APIs on each cluster) - we erred a bit too far on putting everything all together, while federation v2 has focused on a much lower level primitive succeeding.

In this case, machine API is absolutely valuable regardless of the state of the cluster API. It is a building block, while the larger cluster API is a more opinionated and potentially differently-lifecycled API.

I would strongly encourage the SIG to consider having well factored building block APIs be at a different lifecycle, and potentially move into different groups. While there is a unifying philosophy (as there is for all Kubernetes objects), the practical realities of shipping APIs favors patterns where each API that can stand on its own can do so and evolve.

@roberthbailey
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 11, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: enxebre
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: justinsb

If they are not already assigned, you can assign the PR to them by writing /assign @justinsb in a comment when ready.

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

@enxebre enxebre force-pushed the machine-api branch 2 times, most recently from b0ac693 to a863b27 Compare January 15, 2019 09:32
@enxebre
Copy link
Member Author

enxebre commented Jan 16, 2019

/test pull-cluster-api-test

@derekwaynecarr
Copy link
Contributor

I agree with @smarterclayton and @enxebre

@roberthbailey
Copy link
Contributor

This came up during the subproject meeting today.

@vincepri and I are starting a doc about how/why we should split up api groups and we would love input there (both for and against).

@enxebre - do you want to hold this PR open in the mean time?

@enxebre
Copy link
Member Author

enxebre commented Jan 25, 2019

@roberthbailey sounds good, I'll share my input in the doc

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 29, 2019
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels May 29, 2019
@detiber
Copy link
Member

detiber commented Jun 19, 2019

Closing this since we discussed waiting until the types stabilize more before potentially breaking out into different api groups.

/close

@k8s-ci-robot
Copy link
Contributor

@detiber: Closed this PR.

In response to this:

Closing this since we discussed waiting until the types stabilize more before potentially breaking out into different api groups.

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

9 participants