Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
d68eea58
Unverified
Commit
d68eea58
authored
Jun 18, 2018
by
Lucas Käldström
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kubeadm: Fix a bug where skipping all preflight checks wouldn't activate the kubelet
parent
6d3f5b75
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
12 deletions
+6
-12
init.go
cmd/kubeadm/app/cmd/init.go
+2
-2
join.go
cmd/kubeadm/app/cmd/join.go
+2
-2
checks.go
cmd/kubeadm/app/preflight/checks.go
+2
-8
No files found.
cmd/kubeadm/app/cmd/init.go
View file @
d68eea58
...
...
@@ -297,7 +297,7 @@ func (i *Init) Run(out io.Writer) error {
// Try to stop the kubelet service so no race conditions occur when configuring it
if
!
i
.
dryRun
{
glog
.
V
(
1
)
.
Infof
(
"Stopping the kubelet"
)
preflight
.
TryStopKubelet
(
i
.
ignorePreflightErrors
)
preflight
.
TryStopKubelet
()
}
// Write env file with flags for the kubelet to use. We do not need to write the --register-with-taints for the master,
...
...
@@ -315,7 +315,7 @@ func (i *Init) Run(out io.Writer) error {
if
!
i
.
dryRun
{
// Try to start the kubelet service in case it's inactive
glog
.
V
(
1
)
.
Infof
(
"Starting the kubelet"
)
preflight
.
TryStartKubelet
(
i
.
ignorePreflightErrors
)
preflight
.
TryStartKubelet
()
}
// certsDirToWriteTo is gonna equal cfg.CertificatesDir in the normal case, but gonna be a temp directory if dryrunning
...
...
cmd/kubeadm/app/cmd/join.go
View file @
d68eea58
...
...
@@ -281,7 +281,7 @@ func (j *Join) Run(out io.Writer) error {
// Configure the kubelet. In this short timeframe, kubeadm is trying to stop/restart the kubelet
// Try to stop the kubelet service so no race conditions occur when configuring it
glog
.
V
(
1
)
.
Infof
(
"Stopping the kubelet"
)
preflight
.
TryStopKubelet
(
j
.
ignorePreflightErrors
)
preflight
.
TryStopKubelet
()
// Write the configuration for the kubelet (using the bootstrap token credentials) to disk so the kubelet can start
if
err
:=
kubeletphase
.
DownloadConfig
(
bootstrapClient
,
kubeletVersion
,
kubeadmconstants
.
KubeletRunDirectory
);
err
!=
nil
{
...
...
@@ -295,7 +295,7 @@ func (j *Join) Run(out io.Writer) error {
// Try to start the kubelet service in case it's inactive
glog
.
V
(
1
)
.
Infof
(
"Starting the kubelet"
)
preflight
.
TryStartKubelet
(
j
.
ignorePreflightErrors
)
preflight
.
TryStartKubelet
()
// Now the kubelet will perform the TLS Bootstrap, transforming /etc/kubernetes/bootstrap-kubelet.conf to /etc/kubernetes/kubelet.conf
// Wait for the kubelet to create the /etc/kubernetes/kubelet.conf KubeConfig file. If this process
...
...
cmd/kubeadm/app/preflight/checks.go
View file @
d68eea58
...
...
@@ -1053,10 +1053,7 @@ func RunChecks(checks []Checker, ww io.Writer, ignorePreflightErrors sets.String
// TryStartKubelet attempts to bring up kubelet service
// TODO: Move these kubelet start/stop functions to some other place, e.g. phases/kubelet
func
TryStartKubelet
(
ignorePreflightErrors
sets
.
String
)
{
if
setHasItemOrAll
(
ignorePreflightErrors
,
"StartKubelet"
)
{
return
}
func
TryStartKubelet
()
{
// If we notice that the kubelet service is inactive, try to start it
initSystem
,
err
:=
initsystem
.
GetInitSystem
()
if
err
!=
nil
{
...
...
@@ -1077,10 +1074,7 @@ func TryStartKubelet(ignorePreflightErrors sets.String) {
}
// TryStopKubelet attempts to bring down the kubelet service momentarily
func
TryStopKubelet
(
ignorePreflightErrors
sets
.
String
)
{
if
setHasItemOrAll
(
ignorePreflightErrors
,
"StopKubelet"
)
{
return
}
func
TryStopKubelet
()
{
// If we notice that the kubelet service is inactive, try to start it
initSystem
,
err
:=
initsystem
.
GetInitSystem
()
if
err
!=
nil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment