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: use the CRI for preflights checks #55055

Merged
merged 1 commit into from Nov 9, 2017

Conversation

runcom
Copy link
Contributor

@runcom runcom commented Nov 3, 2017

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:

kubeadm: use the CRI for preflights checks

@luxas PTAL

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 3, 2017
@runcom
Copy link
Contributor Author

runcom commented Nov 3, 2017

/assign @luxas

@runcom
Copy link
Contributor Author

runcom commented Nov 3, 2017

/retest

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 6, 2017
@runcom
Copy link
Contributor Author

runcom commented Nov 6, 2017

/test pull-kubernetes-unit

1 similar comment
@runcom
Copy link
Contributor Author

runcom commented Nov 7, 2017

/test pull-kubernetes-unit

@runcom
Copy link
Contributor Author

runcom commented Nov 7, 2017

@luxas PTAL, I've modified the code to not touch the config apis

@runcom runcom force-pushed the check-with-crictl branch 5 times, most recently from 98b2b1a to a1e1cc0 Compare November 7, 2017 14:27
@runcom
Copy link
Contributor Author

runcom commented Nov 7, 2017

/retest

@runcom
Copy link
Contributor Author

runcom commented Nov 7, 2017

/retest

@runcom runcom force-pushed the check-with-crictl branch 3 times, most recently from a9863c7 to 2eec36e Compare November 7, 2017 16:35
@runcom
Copy link
Contributor Author

runcom commented Nov 8, 2017

does anybody know why some tests are failing? I ran hack/update-bazel.sh just fine also seems like it passed now 😕

Copy link
Member

@luxas luxas left a 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

@@ -64,6 +64,12 @@ filegroup(
"//docs:all-srcs",
"//examples:all-srcs",
"//hack:all-srcs",
"//kubernetes/cluster:all-srcs",
Copy link
Member

Choose a reason for hiding this comment

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

this seems unrelated?

Copy link
Contributor Author

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 😕

Copy link
Member

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'.

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed then


// 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
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

InPathCheck{executable: "tc", mandatory: false, exec: execer},
InPathCheck{executable: "touch", mandatory: false, exec: execer})
}
checks = append(checks, criCtlChecker)
Copy link
Member

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?

Copy link
Contributor Author

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)

Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

} else {
// assume docker
checks = append(checks,
ServiceCheck{Service: "docker", CheckIfActive: true},
Copy link
Member

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?

Copy link
Contributor Author

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,
Copy link
Member

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?

Copy link
Contributor Author

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 :)

} else {
// assume docker
checks = append(checks,
ServiceCheck{Service: "docker", CheckIfActive: true},
Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Member

Choose a reason for hiding this comment

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

please do

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@luxas
Copy link
Member

luxas commented Nov 8, 2017

/test all

@runcom
Copy link
Contributor Author

runcom commented Nov 9, 2017

/retest

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Nov 9, 2017

@runcom: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-cross b6af7f7601bf4bdcbf74c43f85a2836a416137b5 link /test pull-kubernetes-cross

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.

InPathCheck{executable: "socat", mandatory: false, exec: execer},
InPathCheck{executable: "tc", mandatory: false, exec: execer},
InPathCheck{executable: "touch", mandatory: false, exec: execer}),
criCtlChecker
Copy link
Member

@luxas luxas Nov 9, 2017

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

omg right

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Copy link
Member

@luxas luxas left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 9, 2017
@k8s-github-robot
Copy link

[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 /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 9, 2017
@k8s-github-robot
Copy link

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.

@k8s-github-robot k8s-github-robot merged commit d215d4b into kubernetes:master Nov 9, 2017
@runcom runcom deleted the check-with-crictl branch November 9, 2017 15:40
k8s-github-robot pushed a commit that referenced this pull request Feb 2, 2018
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
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

kubeadm assumes docker in its pre-flight checks
6 participants