
我想建立我的第一個 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 中。
也可以看看這個類似的問題。