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

kubeadm: turn api into a real apigroup #34147

Merged
merged 1 commit into from
Oct 10, 2016

Conversation

mikedanese
Copy link
Member

@mikedanese mikedanese commented Oct 5, 2016

@kubernetes/sig-cluster-lifecycle


This change is Reviewable

@k8s-github-robot k8s-github-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. release-note-label-needed labels Oct 5, 2016
@k8s-ci-robot
Copy link
Contributor

Jenkins verification failed for commit 2052a01. Full PR test history.

The magic incantation to run this job again is @k8s-bot verify test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@justinsb
Copy link
Member

justinsb commented Oct 6, 2016

+1 on the idea @mikedanese (sadly I don't know enough to review the code). And thanks for providing an example on how to use the k8s api machinery. (Did you find a nice doc on how to do this BTW?)

Copy link
Contributor

@krousey krousey left a comment

Choose a reason for hiding this comment

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

I'm fine with the code change, but are we sure we want to use the API machinery for what is essentially a versioned config file? cc @kubernetes/sig-api-machinery
Things I usually associate with an API group that don't apply here:

  • Swagger definitions
  • API discovery
  • Storage interfaces
  • Client
  • REST endpoints
  • alternate encodings

If we do use the API, would this work without ugorji codec?

func ValidateNodeConfiguration(o *MasterConfiguration) error {
return nil
}
// +groupName=kubeadm.k8s.io
Copy link
Contributor

Choose a reason for hiding this comment

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

Does our machinery require that this line come right before the package statement? Comments, even annotations like this, right before package statements show up as documentation on godoc.org.

Copy link
Contributor

Choose a reason for hiding this comment

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

It does. We need to fix it

@@ -0,0 +1,38 @@
/*
Copy link
Member

Choose a reason for hiding this comment

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

please make the path to this file (and other api machinery files) be .../apis/<your group name>/..., not /api

Copy link
Member Author

Choose a reason for hiding this comment

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

What does registering an API group provide? I only need versioning, defaulting and documentation.

announced.VersionToSchemeFunc{
v1alpha1.SchemeGroupVersion.Version: v1alpha1.AddToScheme,
},
).Announce().RegisterAndEnable(); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Do you actually need to register this group?

@errordeveloper
Copy link
Member

I'm fine with the code change, but are we sure we want to use the API machinery for what is essentially a versioned config file?

Yes, good question, I wonder about this also.

@errordeveloper
Copy link
Member

@mikedanese thanks a lot for doing this! As far as I understand, this is not in use yet, so are you planning to make use of it in a follow-up PR or you will add it here?

@mikedanese
Copy link
Member Author

are you planning to make use of it in a follow-up PR or you will add it here?

End goal is to make this deserialize the internal config representation from a file passed in from the command line for the "configurable mode" experience. With this we can hopefully avoid diluting the streamlined command line experience.

@mikedanese
Copy link
Member Author

I'm fine with the code change, but are we sure we want to use the API machinery for what is essentially a versioned config file?

I feel like this ship flew with componentconfig. Aren't these requirements (versioning, defaulting and documentation) the some of the core use cases for API groups?

@lavalamp
Copy link
Member

lavalamp commented Oct 7, 2016

It will make it an option in the --runtime-config flag, which I guess
doesn't matter if you are working in a separate binary.

On Thu, Oct 6, 2016 at 11:48 PM, Mike Danese notifications@github.com
wrote:

@mikedanese commented on this pull request.

In cmd/kubeadm/app/api/install/install.go
#34147:

@@ -0,0 +1,38 @@
+/*

What does registering an API group provide? I only need versioning,
defaulting and documentation.


You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub
#34147, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAngloDe6QTsTFxBpc3-Hq8c36ik01h9ks5qxeszgaJpZM4KPXKR
.

@k8s-github-robot k8s-github-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Oct 7, 2016
@mikedanese
Copy link
Member Author

Ok unregistered the group.

@mikedanese
Copy link
Member Author

What about roundtrip testing?

@dgoodwin
Copy link
Contributor

dgoodwin commented Oct 7, 2016

I think previous commit 56ea178 may have broken something, the controller manager is unable to start up with a plain "kubeadm init master" now:

(root@centos1 ~) $ docker logs 589b79ef9fd9
E1007 18:44:49.091488       1 event.go:258] Could not construct reference to: '&api.Endpoints{TypeMeta:unversioned.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:api.ObjectMeta{Name:"kube-controller-manager", GenerateName:"", Namespace:"kube-system", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:unversioned.Time{Time:time.Time{sec:0, nsec:0, loc:(*time.Location)(nil)}}, DeletionTimestamp:(*unversioned.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]api.OwnerReference(nil), Finalizers:[]string(nil), ClusterName:""}, Subsets:[]api.EndpointSubset(nil)}' due to: 'selfLink was empty, can't make reference'. Will not report event: 'Normal' '%v became leader' 'centos1.aos.example.com'
I1007 18:44:49.092504       1 leaderelection.go:214] sucessfully acquired lease kube-system/kube-controller-manager
I1007 18:44:49.098480       1 plugins.go:71] No cloud provider specified.
W1007 18:44:49.098495       1 controllermanager.go:232] Unsuccessful parsing of cluster CIDR : invalid CIDR address: 
W1007 18:44:49.098503       1 controllermanager.go:236] Unsuccessful parsing of service CIDR : invalid CIDR address: 
I1007 18:44:49.099198       1 replication_controller.go:220] Starting RC Manager
I1007 18:44:49.099747       1 nodecontroller.go:194] Sending events to api server.
F1007 18:44:49.099815       1 nodecontroller.go:206] NodeController: Must specify clusterCIDR if allocateNodeCIDRs == true.

@mikedanese
Copy link
Member Author

@dgoodwin before in kubeadm init master --pod-network-cidr was --pod-network-cidr a required flag? Should it be required? I remember @errordeveloper saying it shouldn't be. If it shouldn't be then #34352 might fix your issue.

@errordeveloper
Copy link
Member

@mikedanese @dgoodwin --pod-network-cidr should be optional.

@mikedanese
Copy link
Member Author

@krousey is that an lgtm? :)

@mikedanese mikedanese added release-note-none Denotes a PR that doesn't merit a release note. and removed release-note-label-needed labels Oct 10, 2016
@luxas
Copy link
Member

luxas commented Oct 10, 2016

@errordeveloper Yes, that was probably a rebase conflict or something from some previous refactoring PR (after our "stable" v1.4 release)

@mikedanese I think that's a LGTM, yes

@errordeveloper Any comments on this one?

@errordeveloper
Copy link
Member

errordeveloper commented Oct 10, 2016

@mikedanese:

End goal is to make this deserialize the internal config representation from a file passed in from the command line for the "configurable mode" experience. With this we can hopefully avoid diluting the streamlined command line experience.

Yes, I'm familiar with the goal already 👍 :)

I am just wondering how far does this change set get us, I cannot see any flags being added here explicitly, I'd expect there to be at least one more change set to plumb it through, yet I am not aware if there is any magic that would infer any automatic flags for passing a componentconfig file in...

@krousey
Copy link
Contributor

krousey commented Oct 10, 2016

Yes

On Oct 10, 2016 08:28, "Mike Danese" notifications@github.com wrote:

@krousey https://github.com/krousey is that an lgtm? :)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#34147 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAJlm5XRGebcHtcSPLENtNM7d0qBHuTZks5qylmOgaJpZM4KPXKR
.

@mikedanese mikedanese added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 10, 2016
@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 851705e into kubernetes:master Oct 10, 2016
@mikedanese mikedanese deleted the kubeadm-api branch October 10, 2016 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.