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

Use cri-dockerd instead of dockershim where needed #12102

Merged
merged 11 commits into from
Jan 11, 2022

Conversation

afbjorklund
Copy link
Collaborator

@afbjorklund afbjorklund commented Aug 3, 2021

Starting with Kubernetes version 1.24, the CRI socket
for Docker is handled externally instead of internally.

See https://www.mirantis.com/blog/the-future-of-dockershim-is-cri-dockerd/

I added a feature to start the socket/service, transparently to the casual user...

For the power user giving their own CRI socket, they get to maintain it as well.

Closes #12099


Note: needs cri-dockerd installed, for testing (see #12103).

Also tweak the version check, when to not use dockershim:

KubernetesVersion.GTE(semver.Version{Major: 1, Minor: 24})

i.e. If you want to try it out, before Kubernetes 1.24 is available.

EDIT: The dockershim removal was delayed again, from 1.23 to 1.24

Starting with Kubernetes version 1.23, the CRI socket
for Docker is handled externally instead of internally.
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 3, 2021
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 3, 2021
The socket-activated service for cri-dockerd will start on demand,
similar to how the docker service works (for /var/run/docker.sock)
It is cri-docker.sock, even for cri-dockerd deb
That is, reverse order from when starting up.
@medyagh
Copy link
Member

medyagh commented Aug 5, 2021

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Aug 5, 2021
@medyagh
Copy link
Member

medyagh commented Aug 6, 2021

I am excited about this PR

@minikube-pr-bot

This comment has been minimized.

@minikube-pr-bot

This comment has been minimized.

@afbjorklund afbjorklund changed the title Use cri-dockerd instead of dockershim where needed WIP: Use cri-dockerd instead of dockershim where needed Aug 6, 2021
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 6, 2021
@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Aug 6, 2021

I tested with the alpha, and it doesn't work because minikube passes "0.0.0" for the kubernetes version.

        r, err := cruntime.New(cruntime.Config{Type: cfg.KubernetesConfig.ContainerRuntime, Runner: k.c})

But it still starts, because apparently Kubernetes v1.23.0-alpha.0 "forgot" to remove the dockershim...

Also found dockershim hard-coded in a lot of other places, but using the kubernetes constant instead...

@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 Aug 6, 2021
@minikube-pr-bot

This comment has been minimized.

@minikube-pr-bot

This comment has been minimized.

@afbjorklund

This comment has been minimized.

@afbjorklund afbjorklund changed the title WIP: Use cri-dockerd instead of dockershim where needed Use cri-dockerd instead of dockershim where needed Dec 4, 2021
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 4, 2021
@minikube-pr-bot

This comment has been minimized.

@minikube-pr-bot

This comment has been minimized.

@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Jan 5, 2022

Need to change the k8s version (1.24.0-alpha.1), and need to change the cri socket path (cri-dockerd.sock).

/hold

@afbjorklund afbjorklund added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 5, 2022
@afbjorklund
Copy link
Collaborator Author

@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 12102) |
+----------------+----------+---------------------+
| minikube start | 46.6s    | 46.1s               |
| enable ingress | 30.4s    | 30.4s               |
+----------------+----------+---------------------+

Times for minikube start: 49.8s 45.8s 45.0s 46.1s 46.5s
Times for minikube (PR 12102) start: 45.1s 47.7s 45.9s 46.2s 45.6s

Times for minikube ingress: 30.2s 29.7s 30.8s 30.2s 31.3s
Times for minikube (PR 12102) ingress: 30.2s 31.2s 30.3s 30.3s 29.8s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 12102) |
+----------------+----------+---------------------+
| minikube start | 22.1s    | 22.5s               |
| enable ingress | 27.6s    | 27.7s               |
+----------------+----------+---------------------+

Times for minikube start: 21.7s 21.6s 21.8s 23.0s 22.4s
Times for minikube (PR 12102) start: 21.6s 22.9s 21.5s 22.8s 23.4s

Times for minikube ingress: 32.9s 26.4s 25.9s 25.9s 26.9s
Times for minikube (PR 12102) ingress: 28.5s 26.4s 26.4s 30.4s 26.9s

docker driver with containerd runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 12102) |
+----------------+----------+---------------------+
| minikube start | 41.3s    | 41.7s               |
| enable ingress | 22.5s    | 32.5s               |
+----------------+----------+---------------------+

Times for minikube (PR 12102) start: 41.9s 41.8s 42.8s 42.0s 40.3s
Times for minikube start: 43.3s 42.6s 37.0s 41.9s 41.7s

Times for minikube ingress: 28.4s 18.4s 24.3s 18.9s 22.4s
Times for minikube (PR 12102) ingress: 53.4s 22.4s 32.4s 32.4s 21.9s

@minikube-pr-bot
Copy link

These are the flake rates of all failed tests.

Environment Failed Tests Flake Rate (%)
Hyper-V_Windows TestNetworkPlugins/group/calico/Start (gopogh) 2.76 (chart)
Hyper-V_Windows TestNetworkPlugins/group/custom-weave/Start (gopogh) 2.76 (chart)
Docker_macOS TestJSONOutput/pause/Command (gopogh) 4.73 (chart)
Docker_Windows TestForceSystemdEnv (gopogh) 9.76 (chart)
KVM_Linux TestNetworkPlugins/group/flannel/Start (gopogh) 10.24 (chart)
Docker_macOS TestNetworkPlugins/group/kubenet/DNS (gopogh) 39.02 (chart)
Docker_Windows TestStartStop/group/embed-certs/serial/Pause (gopogh) 48.36 (chart)
Docker_macOS TestNetworkPlugins/group/calico/Start (gopogh) 61.11 (chart)
Hyper-V_Windows TestNoKubernetes/serial/StartWithK8s (gopogh) 61.38 (chart)
Docker_macOS TestNetworkPlugins/group/kindnet/Start (gopogh) 66.67 (chart)
Docker_Windows TestNoKubernetes/serial/StartWithStopK8s (gopogh) 74.80 (chart)
Docker_macOS TestNetworkPlugins/group/bridge/DNS (gopogh) 75.25 (chart)
Docker_macOS TestNetworkPlugins/group/enable-default-cni/DNS (gopogh) 79.51 (chart)
Docker_Cloud_Shell TestFunctional/parallel/TunnelCmd/serial/AccessDirect (gopogh) 100.00 (chart)
Docker_Cloud_Shell TestFunctional/parallel/TunnelCmd/serial/WaitService/IngressIP (gopogh) 100.00 (chart)
Docker_macOS TestDownloadOnly/v1.16.0/preload-exists (gopogh) 100.00 (chart)
Docker_Windows TestFunctional/parallel/DryRun (gopogh) 100.00 (chart)
Docker_Windows TestFunctional/parallel/InternationalLanguage (gopogh) 100.00 (chart)
Docker_Windows TestFunctional/parallel/TunnelCmd/serial/WaitService/IngressIP (gopogh) 100.00 (chart)
Docker_Windows TestNetworkPlugins/group/cilium/Start (gopogh) 100.00 (chart)
Hyperkit_macOS TestAddons/Setup (gopogh) 100.00 (chart)
Hyperkit_macOS TestErrorSpam/setup (gopogh) 100.00 (chart)
Hyperkit_macOS TestFunctional/serial/AuditLog (gopogh) 100.00 (chart)
Hyperkit_macOS TestFunctional/serial/StartWithProxy (gopogh) 100.00 (chart)
Hyperkit_macOS TestIngressAddonLegacy/serial/ValidateIngressAddonActivation (gopogh) 100.00 (chart)
Hyperkit_macOS TestIngressAddonLegacy/serial/ValidateIngressAddons (gopogh) 100.00 (chart)
Hyperkit_macOS TestIngressAddonLegacy/StartLegacyK8sCluster (gopogh) 100.00 (chart)
Hyperkit_macOS TestJSONOutput/pause/Audit (gopogh) 100.00 (chart)
Hyperkit_macOS TestJSONOutput/pause/Command (gopogh) 100.00 (chart)
Hyperkit_macOS TestJSONOutput/start/Audit (gopogh) 100.00 (chart)
More tests... Continued...

Too many tests failed - See test logs for more details.

To see the flake rates of all tests by environment, click here.

@afbjorklund afbjorklund removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 7, 2022
@medyagh
Copy link
Member

medyagh commented Jan 11, 2022

thank you for this PR :)

@medyagh medyagh merged commit 254af36 into kubernetes:master Jan 11, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: afbjorklund, medyagh

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:
  • OWNERS [afbjorklund,medyagh]

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

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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

Start cri-docker service automatically, if using docker and kubernetes version >= 1.24
4 participants