简体   繁体   English

docker 服务未启用 - Kube.netes

[英]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.

相关问题 Kube.netes ingress hsts 未启用 - Kubernetes ingress hsts not enabled GCP Kube.netes 不使用服务帐户来拉取 docker 个图像 - GCP Kubernetes not using service account for pulling docker images 如何在启用 MFA 的情况下将 docker 图像从 AWS ECR 拉到 Minikube Kube.netes 集群 - How to pull a docker image from AWS ECR to Minikube Kubernetes cluster with MFA enabled 使用哪些 azure 服务(AKS 或 App 服务)在 azure 上部署多个 docker 容器(启用组合) - Which azure services to use ( AKS or App service) to deploy multiple docker containers (compose enabled) on azure 使用 Docker 图像在 Kube.netes 中部署服务时卡在“使用 pid: 7 启动工作程序”,这里似乎有什么问题? - Stuck on "Booting worker with pid: 7" while deploying a service in Kubernetes using Docker image, What seems to be the problem here? Kube.netes 中的 AWS ALB 服务 - AWS ALB service in Kubernetes Docker 找不到 kubernetes 配置文件 - Docker Can't find kubernetes Config File Hyperledger fabric explorer - Docker Compose to Kube.netes - Hyperledger fabric explorer - Docker Compose to Kubernetes 将角色传递给运行在 kube.netes 上的 docker 容器 - Pass Role to docker container running on kubernetes 无法访问 Kube.netes Service IP 地址的工作负载 - Unable to access workload at the IP address of the Kubernetes Service
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM