使用 podman 设置 k8s 集群

使用 podman 设置 k8s 集群

我想建立我的第一个 kubernetes 集群用于学习目的。

我有 3 个正在运行的 lxc 容器AlmaLiunx 8.4,其中一个应该成为控制器,剩下的 2 个将成为工作节点。

作为指南,我使用本教程。但是我想使用 podman 作为容器运行时,并且已经在工作节点上安装了它。在kubeadm init控制器上执行命令时,我收到一条错误消息,提示 docker 是必需的。

# kubeadm init
[init] Using Kubernetes version: v1.22.1
[preflight] Running pre-flight checks
[preflight] WARNING: Couldn't create the interface used for talking to the container runtime: docker is required for container runtime: exec: "docker": executable file not found in $PATH
    [WARNING FileExisting-tc]: tc not found in system path
[preflight] Pulling images required for setting up a Kubernetes cluster
[preflight] This might take a minute or two, depending on the speed of your internet connection
[preflight] You can also perform this action in beforehand using 'kubeadm config images pull'
error execution phase preflight: docker is required for container runtime: exec: "docker": executable file not found in $PATH
To see the stack trace of this error execute with --v=5 or higher

我试图通过添加来欺骗我alias docker-'podman',但没有达到预期的效果(我测试了别名。它有效)。

我想知道您是否必须先使用 docker 设置集群,然后在工作节点上用 podman 替换它,或者您是否必须在设置过程中添加任何秘密的 podman-sauce?

答案1

看起来,主要问题在这里:

WARNING: Couldn't create the interface used for talking to the container runtime: docker is required for container runtime: exec: "docker": executable file not found in $PATH

这意味着您根本没有安装 docker,或者它的可执行文件不在 PATH 中。您需要检查 docker 是否已安装(如果需要,请安装它)。然后确保 docker 可执行文件位于您的 PATH 中。

也可以看看这个类似的问题

相关内容