如果docker-ce和containerd安装在Ubuntu20.04,K8s使用什么CRI?
If docker-ce and containerd are installed on Ubuntu 20.04, what CRI does K8s use?
在安装 kubeadm 的官方 Kubernetes 文档中发现 here, it states that "If both Docker and containerd are detected, Docker takes precedence" and if on my Ubuntu 20.04 host I have installed docker-ce docker-ce-cli containerd.io
as suggested by the docker install documentation,K8s 是直接与 containerd 组件对话还是它仍然使用(即将在树 K8s 中弃用)dockershim层?
如果是后者,我如何让 K8s 直接与 containerd 对话,同时让 docker cli 工具集在主机上仍然可用?
这是一个基于评论中的解决方案的社区 Wiki 答案,为了提高可见性而发布。随意扩展它。
正如@mmking 已经提到的:如果您不指定运行时,将选择 Docker。如果你想像 Initializing your control-plane node docs:
中描述的那样手动更改它,你可以使用 --cri-socket
和 kubeadm init
(Optional) Since version 1.14, kubeadm tries to detect the container
runtime on Linux by using a list of well known domain socket paths. To
use different container runtime or if there are more than one
installed on the provisioned node, specify the --cri-socket
argument
to kubeadm init.
在安装 kubeadm 的官方 Kubernetes 文档中发现 here, it states that "If both Docker and containerd are detected, Docker takes precedence" and if on my Ubuntu 20.04 host I have installed docker-ce docker-ce-cli containerd.io
as suggested by the docker install documentation,K8s 是直接与 containerd 组件对话还是它仍然使用(即将在树 K8s 中弃用)dockershim层?
如果是后者,我如何让 K8s 直接与 containerd 对话,同时让 docker cli 工具集在主机上仍然可用?
这是一个基于评论中的解决方案的社区 Wiki 答案,为了提高可见性而发布。随意扩展它。
正如@mmking 已经提到的:如果您不指定运行时,将选择 Docker。如果你想像 Initializing your control-plane node docs:
中描述的那样手动更改它,你可以使用--cri-socket
和 kubeadm init
(Optional) Since version 1.14, kubeadm tries to detect the container runtime on Linux by using a list of well known domain socket paths. To use different container runtime or if there are more than one installed on the provisioned node, specify the
--cri-socket
argument to kubeadm init.