[英]docker service is not enabled - Kubernetes
I'm trying to install Kube.netes on an EC2 instance running Ubuntu 20.04.我正在尝试在运行 Ubuntu 20.04 的 EC2 实例上安装 Kube.netes。
I ran the following commands to install Kubeadm and Docker.我运行了以下命令来安装 Kubeadm 和 Docker。
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl
sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update
sudo apt-get install -y kubelet kubeadm kubectl
sudo snap install docker
sudo kubeadm init
When I try to run Kubeadm init in order to initialize my Kube.netes control node, I get the following error:当我尝试运行 Kubeadm init 以初始化我的 Kube.netes 控制节点时,出现以下错误:
[init] Using Kubernetes version: v1.23.4
[preflight] Running pre-flight checks
[WARNING Service-Docker]: docker service is not enabled, please run 'systemctl enable docker.service'
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR Service-Docker]: docker service is not active, please run 'systemctl start docker.service'
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
To see the stack trace of this error execute with --v=5 or higher
I subsequently checked to see if Docker was properly installed and pulled an Ubuntu 20.04 docker image and successfully ran it in interactive mode.随后,我检查了 Docker 是否安装正确,并拉取了 Ubuntu 20.04 docker 图像,并在交互模式下成功运行了它。 So, I'm sure that Docker is running.所以,我确定 Docker 正在运行。
Does anyone have an idea as to what might be the issue?有谁知道可能是什么问题?
My Kubeadm version is:我的 Kubeadm 版本是:
kubeadm version: &version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.4", GitCommit:"e6c093d87ea4cbb530a7b2ae91e54c0842d8308a", GitTreeState:"clean", BuildDate:"2022-02-16T12:36:57Z", GoVersion:"go1.17.7", Compiler:"gc", Platform:"linux/amd64"}
My Docker version is:我的 Docker 版本是:
Docker version 20.10.7, build 20.10.7-0ubuntu5~20.04.2
The issue was that I installed docker using snap.问题是我使用 snap 安装了 docker。
This creates a service name that seems to cause issues with Kube.netes.这会创建一个服务名称,似乎会导致 Kube.netes 出现问题。
Install docker for Ubuntu 20.04 using directions on the official Docker website with apt-get.使用 apt-get在官方 Docker 网站上使用说明安装 docker for Ubuntu 20.04。 This seems to work.这似乎有效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.