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

openrc: kubeadm is starting kubelet before complete config is writte to disk #1986

Closed
neolit123 opened this issue Dec 23, 2019 · 6 comments · Fixed by kubernetes/kubernetes#90892
Labels
area/ecosystem kind/bug Categorizes issue or PR as related to a bug. kind/design Categorizes issue or PR as related to design. priority/backlog Higher priority than priority/awaiting-more-evidence.
Milestone

Comments

@neolit123
Copy link
Member

reported by @kvaster here:
kubernetes/kubernetes#86538

What happened:
kubeadm is timing out during cluster initialization on openrc systems.
Kubelet is failing to start cause there is no complete configuration on the disk.

What you expected to happen:
It is expected to have complete config already written to disk before attempt to start kubelet.

How to reproduce it (as minimally and precisely as possible):
Bug is reproducable with no configuration just by running kubeadm init

Anything else we need to know?:
Bug is not reproducable on systemd cause kubelet is constantly restarting until it can read all configuration files. And on openrc by default kubelet is not restarted once it fails with config. My proposition is to change order of configuration and launching:

diff --git a/cmd/kubeadm/app/cmd/init.go b/cmd/kubeadm/app/cmd/init.go
index 57e87d6603e..942b2057909 100644
--- a/cmd/kubeadm/app/cmd/init.go
+++ b/cmd/kubeadm/app/cmd/init.go
@@ -172,9 +172,9 @@ func NewCmdInit(out io.Writer, initOptions *initOptions) *cobra.Command {

        // initialize the workflow runner with the list of phases
        initRunner.AppendPhase(phases.NewPreflightPhase())
-       initRunner.AppendPhase(phases.NewKubeletStartPhase())
        initRunner.AppendPhase(phases.NewCertsPhase())
        initRunner.AppendPhase(phases.NewKubeConfigPhase())
+       initRunner.AppendPhase(phases.NewKubeletStartPhase())
        initRunner.AppendPhase(phases.NewControlPlanePhase())
        initRunner.AppendPhase(phases.NewEtcdPhase())
        initRunner.AppendPhase(phases.NewWaitControlPlanePhase())

Environment:
kubeadm version: &version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"archive", BuildDate:"2019-12-18T09:14:17Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/amd64"}

@neolit123 neolit123 added kind/bug Categorizes issue or PR as related to a bug. area/ecosystem kind/design Categorizes issue or PR as related to design. labels Dec 23, 2019
@neolit123 neolit123 added this to the v1.18 milestone Dec 23, 2019
@neolit123
Copy link
Member Author

neolit123 commented Dec 23, 2019

@kvaster

My proposition is to change order of configuration and launching:

this is something that we discussed at some point, but the problem is that at this point it could be a breaking change to all the users that separated the init process into phases.

before applying this change we need an estimate of the implications.

And on openrc by default kubelet is not restarted once it fails with config. My proposition is to change order of configuration and launching:

is there a way to tell an openrc service to loop-restart (crash loop) the same way as systemd is doing?

/kind design
/area ecosystem

@kvaster
Copy link

kvaster commented Dec 24, 2019

is there a way to tell an openrc service to loop-restart (crash loop) the same way as systemd is doing?

There is no 'default' way, but there are several different ways. Using supervised for example.
I think it might make sense to add one more phase which will check and restart kubelet if it's not running.

@neolit123
Copy link
Member Author

neolit123 commented Dec 24, 2019 via email

@kvaster
Copy link

kvaster commented Dec 24, 2019

I will try to propose some non-disruptive proposition.

@neolit123
Copy link
Member Author

neolit123 commented Dec 24, 2019 via email

@neolit123
Copy link
Member Author

xref #1295

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ecosystem kind/bug Categorizes issue or PR as related to a bug. kind/design Categorizes issue or PR as related to design. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants