-
Notifications
You must be signed in to change notification settings - Fork 39.7k
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
Refactor to simplify the hard-traveled path of the KubeletConfiguration object #29216
Conversation
cc @aaronlevy @derekparker @pbx0 |
This is part of #27980. |
118c815
to
0ad2914
Compare
We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm. |
GCE e2e build/test passed for commit 652024f1912559b207abcb6997edbc2e25162ae4. |
@k8s-bot unit test this please |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit 652024f1912559b207abcb6997edbc2e25162ae4. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit 652024f1912559b207abcb6997edbc2e25162ae4. |
@mtaufen PR needs rebase |
This refactor removes the legacy KubeletConfig object and adds a new KubeletDeps object, which contains injected runtime objects and separates them from static config. It also reduces NewMainKubelet to two arguments: a KubeletConfiguration and a KubeletDeps. Some mesos and kubemark code was affected by this change, and has been modified accordingly. And a few final notes: KubeletDeps: KubeletDeps will be a temporary bin for things we might consider "injected dependencies", until we have a better dependency injection story for the Kubelet. We will have to discuss this eventually. RunOnce: We will likely not pull new KubeletConfiguration from the API server when in runonce mode, so it doesn't make sense to make this something that can be configured centrally. We will leave it as a flag-only option for now. Additionally, it is increasingly looking like nobody actually uses the Kubelet's runonce mode anymore, so it may be a candidate for deprecation and removal.
It has been deprecated for two releases (1.2 and 1.3).
652024f
to
7ae1458
Compare
@vishh Bumping priority due to frequent rebases. |
Ack. There are PRs that are waiting to be rebased on top of this. So bumping priority makes sense. |
GCE e2e build/test passed for commit 7ae1458. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit 7ae1458. |
Automatic merge from submit-queue |
Finally!!! On Thu, Aug 25, 2016 at 1:18 PM, Kubernetes Bot [email protected]
|
These are long gone, removed in 2016: * AuthPath removal: kubernetes#29216 * Flag removal: kubernetes#40048 This removes the remnants from clientcmd, mostly in the commends describing how the configuration is loaded. Since getServerIdentificationPartialConfig can no longer fail (it copies fields from one struct to another), this drops the error return, along with the error handling in the caller. Signed-off-by: Stephen Kitt <[email protected]>
These are long gone, removed in 2016: * AuthPath removal: kubernetes#29216 * Flag removal: kubernetes#40048 This removes the remnants from clientcmd, mostly in the comments describing how the configuration is loaded. Since getServerIdentificationPartialConfig can no longer fail (it copies fields from one struct to another), this drops the error return, along with the error handling in the caller. Signed-off-by: Stephen Kitt <[email protected]>
These are long gone, removed in 2016: * AuthPath removal: kubernetes#29216 * Flag removal: kubernetes#40048 This removes the remnants from clientcmd, mostly in the comments describing how the configuration is loaded. Since getServerIdentificationPartialConfig can no longer fail (it copies fields from one struct to another), this drops the error return, along with the error handling in the caller. Signed-off-by: Stephen Kitt <[email protected]>
These are long gone, removed in 2016: * AuthPath removal: kubernetes/kubernetes#29216 * Flag removal: kubernetes/kubernetes#40048 This removes the remnants from clientcmd, mostly in the comments describing how the configuration is loaded. Since getServerIdentificationPartialConfig can no longer fail (it copies fields from one struct to another), this drops the error return, along with the error handling in the caller. Signed-off-by: Stephen Kitt <[email protected]> Kubernetes-commit: 8a8238ba7f850241de9c5cc4b22fa1a6b6a19480
There are two main goals of this PR:
NewMainKubelet
takeKubeletConfiguration
andKubeletDeps
as its only arguments.KubeletConfig
type.Why am I doing this?
Long story short, I started adding an endpoint to the Kubelet to display the current config that the Kubelet was running with, and I realized a few things:
KubeletConfiguration
would be the correct values to report by the time someone used the endpoint to check on them.KubeletConfiguration
object from a mix of theKubelet
object and the legacyKubeletConfig
object would just add to the mess (not to mention maintenance burden), and it would be much easier if we passed theKubeletConfiguration
all the way down to where we construct theKubelet
object, and then just store a reference to theKubeletConfiguration
object on theKubelet
for later retrieval.NewMainKubelet
), we can have a much clearer understanding of what happens to the config before it makes it to theKubelet
object, and also a better ability to report up-to-date information on the status of the Kubelet.So I started cleaning things up :-).
Discussion points
It was relatively simple to get
NewMainKubelet
to just take the legacyKubeletConfig
as its only argument, because most of its arguments were just passing throughKubeletConfig
fields or passing information that was generated solely fromKubeletConfig
fields.Completely eliminating the legacy
KubeletConfig
type has been more difficult, because the fields of theKubeletConfiguration
do not have a one-to-one relationship with the fields of theKubeletConfig
. While I was able to eliminate many of theKubeletConfig
fields, I'm starting to get into the nontrivial stuff and I'd like to get a discussion started on what should happen with the remaining fields (pending cherry-picking notwithstanding).On my
kconf-refactor
branch, the legacyKubeletConfig
object is down to the following 27 fields (from the initial 93). I'd really appreciate any guidance people have on what should happen with these fields.The patterns I've seen so far with respect to eliminating
KubeletConfig
fields may be of some help:KubeletConfiguration
or just a typecast away from being the same.KubeletConfiguration
just ended up in substructures ofKubeletConfig
; it was easy to just remove those substructure fields fromKubeletConfig
and construct them using local vars inNewMainKubelet
instead.Runonce
, were able to move into theKubeletConfiguration
.P.S. Part of the way I'm making the transition is by adding an extra
KubeletConfiguration
argument to functions that originally took aKubeletConfig
, and field-by-field, switching those functions over to using information from theKubeletConfiguration
. Once theKubeletConfig
is gone, I'll remove theKubeletConfig
argument, and the transition will be complete.Final note:
Please try to keep in mind that this is not a general Kubelet cleanup effort, it is just me cleaning things up that are directly in the path of what I'm trying to do. Let's keep this focused on cleanup related to the path that config takes on it's way to the Kubelet.
Release note:
This change is