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

Update the default CRI server #599

Merged

Conversation

hickeyma
Copy link
Contributor

Currently, the default CRI server is dockershim. This is a deprecated server with cri-tools. Also, does it make sense to even have a default as the user should explicitly define it.

This PR adds containerd and cri-o to the default list and it checks each in order till one works. It also adds some logging that the defaults are being used. This at least provdes better usability to the user if they don't configure the server.

Closes #597

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 30, 2020
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 30, 2020
@hickeyma
Copy link
Contributor Author

/assign @feiskyer

Copy link
Contributor

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

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

see comment

cmd/crictl/main_unix.go Outdated Show resolved Hide resolved
cmd/crictl/main_windows.go Outdated Show resolved Hide resolved
hickeyma added a commit to hickeyma/cri-tools that referenced this pull request May 1, 2020
Feedback from
kubernetes-sigs#599 (review)

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
@hickeyma
Copy link
Contributor Author

hickeyma commented May 1, 2020

Thanks for the review and feedback @mikebrow. Updated and ready for review again.

Copy link
Contributor

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

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

see comment

cmd/crictl/main.go Outdated Show resolved Hide resolved
@feiskyer
Copy link
Member

feiskyer commented May 2, 2020

Currently, the default CRI server is dockershim. This is a deprecated server with cri-tools. Also, does it make sense to even have a default as the user should explicitly define it.

I prefer we still use dockershim as the default CRI server because most Kubernetes users are still using dockershim. To switch to a different runtime, users could provide a config file for crictl.

This PR adds containerd and cri-o to the default list and it checks each in order till one works.

This would introduce a few seconds latency for containerd and crio. @hickeyma @mikebrow do you think this is ok for users?

I have another idea. @hickeyma @mikebrow what do you think if we add a sub-command to generate the config file based on runtime type?

@mikebrow
Copy link
Contributor

mikebrow commented May 2, 2020

Currently, the default CRI server is dockershim. This is a deprecated server with cri-tools. Also, does it make sense to even have a default as the user should explicitly define it.

I prefer we still use dockershim as the default CRI server because most Kubernetes users are still using dockershim. To switch to a different runtime, users could provide a config file for crictl.

This PR adds containerd and cri-o to the default list and it checks each in order till one works.

This would introduce a few seconds latency for containerd and crio. @hickeyma @mikebrow do you think this is ok for users?

I don't think the intention is to change the default, or introduce any additional latency for the default or configured options or cli options. Though it would be good to put out a warning that automatically using docker as the default is being deprecated, please use the config or cli option. We are heading into an era where two or more of these container runtimes will always be running and the customer won't know which he's using. The idea here was to add loud warning messages when there is no config or cli, and further add more warning when the default docker fails but there exists a running sock from another container runtime besides the default docker, then go ahead and use the backup.. but yes the wasted time trying docker.. is just wasted time if crio or containerd is desired by the user/developer thus loud complaining required. If preferred could even "fail" hard with the message you need to put ....sock in the config file.

I have another idea. @hickeyma @mikebrow what do you think if we add a sub-command to generate the config file based on runtime type?

There's a config sub-command that's supposed to have get and set options ala git config pattern... the get works the set isn't there. crictl config - Get and set crictl options

#602

@feiskyer
Copy link
Member

feiskyer commented May 4, 2020

@mikebrow thanks for the clarification.

Currently, the default CRI server is dockershim. This
is a deprecated server with cri-tools. Also, does it make
sense to even have a default as the user should explicitly
define it.

This PR adds `containerd` and `cri-o` to the default list
and it checks each in order till one works. It also
adds some looging that the defaults are being used. This
at least provdes better usability to the user if they don't
configure the server.

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
Feedback from
kubernetes-sigs#599 (review)

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
@hickeyma hickeyma force-pushed the hickeyma/cri-default-server branch from 08b102c to 51ee1da Compare May 5, 2020 11:10
Feedback comment:
kubernetes-sigs#599 (comment)

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
@hickeyma hickeyma requested a review from feiskyer May 5, 2020 13:43
@hickeyma
Copy link
Contributor Author

hickeyma commented May 5, 2020

Thanks for the reviews @feiskyer @mikebrow. Updated and ready for review again.

Copy link
Contributor

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

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

see comments/questions

cmd/crictl/main_unix.go Show resolved Hide resolved
cmd/crictl/main.go Show resolved Hide resolved
Recaftor to remove defaultRuntimeEndpoint as it is no longer
necessary as its is replaced to use array of default endpoints
if endpoints are not set

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
@hickeyma
Copy link
Contributor Author

hickeyma commented May 6, 2020

@mikebrow I did a refactor to tidy up the logic around default eps. Let me know what you think.

@k8s-ci-robot k8s-ci-robot added do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. 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 May 6, 2020
@hickeyma hickeyma force-pushed the hickeyma/cri-default-server branch from 3fe53b1 to 0c5e4a6 Compare May 6, 2020 17:26
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label May 6, 2020
Copy link
Contributor

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

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

couple nits looking good!

docs/crictl.md Outdated Show resolved Hide resolved
docs/crictl.md Outdated Show resolved Hide resolved
cmd/crictl/main.go Outdated Show resolved Hide resolved
@hickeyma hickeyma force-pushed the hickeyma/cri-default-server branch from 0c5e4a6 to 21ef8f0 Compare May 6, 2020 19:11
@hickeyma
Copy link
Contributor Author

hickeyma commented May 6, 2020

Thanks for review @mikebrow. Updated and ready for review again.

Copy link
Contributor

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

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

LGTM(Non-Binding)
Used it in a couple environments, very nice indeed.

@hickeyma
Copy link
Contributor Author

hickeyma commented May 6, 2020

Thanks for the reviews and feedback @mikebrow

@hickeyma hickeyma force-pushed the hickeyma/cri-default-server branch 2 times, most recently from 2f83d2c to b37a0cb Compare May 6, 2020 19:55
Update following review on slack with mikebrow

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
@hickeyma hickeyma force-pushed the hickeyma/cri-default-server branch from b37a0cb to 871ffe3 Compare May 6, 2020 20:15
@hickeyma
Copy link
Contributor Author

hickeyma commented May 7, 2020

@feiskyer This is updated and ready for review again.

Copy link
Member

@feiskyer feiskyer left a comment

Choose a reason for hiding this comment

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

Thanks

/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 May 7, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: feiskyer, hickeyma

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 7, 2020
@mikebrow
Copy link
Contributor

mikebrow commented May 7, 2020

seems github's link to travis state got out of whack again..

@feiskyer
Copy link
Member

feiskyer commented May 7, 2020

yep, let me merge this manually

@feiskyer feiskyer merged commit 0fdfd4b into kubernetes-sigs:master May 7, 2020
@hickeyma hickeyma deleted the hickeyma/cri-default-server branch May 7, 2020 12:32
@hickeyma
Copy link
Contributor Author

hickeyma commented May 7, 2020

Thanks @feiskyer and @mikebrow for sorting this and for the merger @feiskyer

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

Should there be a default for the CRI server endpoint?
4 participants