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: use the CRI for preflights checks #55055
Conversation
/assign @luxas |
ad0ae0d
to
c805cce
Compare
/retest |
c805cce
to
8d583f7
Compare
8d583f7
to
1be7053
Compare
/test pull-kubernetes-unit |
1 similar comment
/test pull-kubernetes-unit |
@luxas PTAL, I've modified the code to not touch the config apis |
98b2b1a
to
a1e1cc0
Compare
/retest |
a1e1cc0
to
95c528a
Compare
/retest |
a9863c7
to
2eec36e
Compare
|
2eec36e
to
ae9c43a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, only some small-ish comments/clarifications
build/root/BUILD.root
Outdated
@@ -64,6 +64,12 @@ filegroup( | |||
"//docs:all-srcs", | |||
"//examples:all-srcs", | |||
"//hack:all-srcs", | |||
"//kubernetes/cluster:all-srcs", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems unrelated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just run hack/update-bazel.sh
😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should omit it, something was wrong with the autogeneration then:
W1108 17:14:07.326] ERROR: /workspace/k8s.io/kubernetes/BUILD.bazel:56:1: no such package 'kubernetes/docs': BUILD file not found on package path and referenced by '//:all-srcs'.
W1108 17:14:07.502] ERROR: /workspace/k8s.io/kubernetes/BUILD.bazel:56:1: no such package 'kubernetes/examples': BUILD file not found on package path and referenced by '//:all-srcs'.
W1108 17:14:07.503] ERROR: /workspace/k8s.io/kubernetes/BUILD.bazel:56:1: no such package 'kubernetes/federation/cluster': BUILD file not found on package path and referenced by '//:all-srcs'.
W1108 17:14:07.504] ERROR: /workspace/k8s.io/kubernetes/BUILD.bazel:56:1: no such package 'kubernetes/third_party/htpasswd': BUILD file not found on package path and referenced by '//:all-srcs'.
W1108 17:14:07.504] ERROR: /workspace/k8s.io/kubernetes/BUILD.bazel:56:1: no such package 'kubernetes/cluster': BUILD file not found on package path and referenced by '//:all-srcs'.
W1108 17:14:07.505] ERROR: /workspace/k8s.io/kubernetes/BUILD.bazel:56:1: no such package 'kubernetes/hack/lib': BUILD file not found on package path and referenced by '//:all-srcs'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure what's happening here though, I just run hack/update-bazel.sh
and these lines are added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed then
cmd/kubeadm/app/preflight/checks.go
Outdated
|
||
// run the docker validator only with dockershim | ||
if sysver.CRISocket == "/var/run/dockershim.sock" { | ||
// TODO(runcom): move the DockerValidator to actually use the CRI.Version endpoint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you create an issue to follow this up please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
created kubernetes/kubeadm#533
cmd/kubeadm/app/preflight/checks.go
Outdated
InPathCheck{executable: "tc", mandatory: false, exec: execer}, | ||
InPathCheck{executable: "touch", mandatory: false, exec: execer}) | ||
} | ||
checks = append(checks, criCtlChecker) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it expected to always look for crictl
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say yes, read here #55055 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please move this up directly in the list where checks
is defined instead of appending it later to the list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
cmd/kubeadm/app/preflight/checks.go
Outdated
} else { | ||
// assume docker | ||
checks = append(checks, | ||
ServiceCheck{Service: "docker", CheckIfActive: true}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any specific reason you didn't put all of this on a single line like the CRICheck above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
InPathCheck{executable: "socat", mandatory: false, exec: execer}, | ||
InPathCheck{executable: "tc", mandatory: false, exec: execer}, | ||
InPathCheck{executable: "touch", mandatory: false, exec: execer}, | ||
criCtlChecker, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it expected to always look for crictl
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, if we want to encourage people to install it and do the check via the CRI, yes. And btw, it's not mandatory :)
cmd/kubeadm/app/preflight/checks.go
Outdated
} else { | ||
// assume docker | ||
checks = append(checks, | ||
ServiceCheck{Service: "docker", CheckIfActive: true}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any specific reason you didn't put all of this on a single line like the CRICheck above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nah, I can change it if you want
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
/test all |
ae9c43a
to
6e34723
Compare
b6af7f7
to
93f5001
Compare
/retest |
@runcom: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
cmd/kubeadm/app/preflight/checks.go
Outdated
InPathCheck{executable: "socat", mandatory: false, exec: execer}, | ||
InPathCheck{executable: "tc", mandatory: false, exec: execer}, | ||
InPathCheck{executable: "touch", mandatory: false, exec: execer}), | ||
criCtlChecker |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this results in an compilation error. (no ,
in the end)
Shouldn't CRI be used in Windows though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
omg right
93f5001
to
c280a7a
Compare
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
c280a7a
to
46683b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: luxas, runcom Associated issue: 285 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Automatic merge from submit-queue (batch tested with PRs 55380, 55399, 55377, 55055). If you want to cherry-pick this change to another branch, please follow the instructions here. |
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. kubeadm init: skip checking cri socket in preflight checks **What this PR does / why we need it**: `kubeadm init` does not need to require `dockershim.sock` to be present. Remove the check for `dockershim.sock`. xref #55055 **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes kubernetes/kubeadm#657 **Special notes for your reviewer**: /area kubeadm /kind bug /assign @luxas /cc @kubernetes/sig-cluster-lifecycle-pr-reviews **Release note**: ```release-note kubeadm init: skip checking cri socket in preflight checks ```
Signed-off-by: Antonio Murdaca runcom@redhat.com
What this PR does / why we need it:
Add preflights checks to be performed using
crictl
and the kubernetes CRI instead of relying on docker.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes kubernetes/kubeadm#285
Special notes for your reviewer:
Release note:
@luxas PTAL