kubernetes 为什么kubeadm失败,容器运行时没有运行?

ubof19bj  于 2023-06-21  发布在  Kubernetes
关注(0)|答案(1)|浏览(414)

我想在ubuntu 18.04上安装kubernetes,因为我已经安装了cri-ocri-o-runckubeletkubeadm
当我运行kubeadm init时,它告诉containerruntime没有运行。但是systemctl status crio告诉我crio正在运行。
我还尝试使用containerd而不是crio。错误消息不同,但CRI v1 image API is not implemented for endpoint也会失败
我该怎么做才能让kubeadm init识别crio或containerd?
以下是kubeadm init输出:

I0605 12:09:32.629899   13442 version.go:256] remote version is much newer: v1.27.2; falling back to: stable-1.25
[init] Using Kubernetes version: v1.25.10
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
        [ERROR CRI]: container runtime is not running: output: time="2023-06-05T12:09:32+02:00" level=fatal msg="validate service connection: CRI v1 runtime API is not implemented for endpoint \"unix:///var/run/crio/crio.sock\": rpc error: code = Unimplemented desc = unknown service runtime.v1.RuntimeService"
, error: exit status 1
[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
root@bloxberg:~# kubeadm init
I0605 12:33:36.342491   14574 version.go:256] remote version is much newer: v1.27.2; falling back to: stable-1.25
[init] Using Kubernetes version: v1.25.10
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
        [ERROR CRI]: container runtime is not running: output: time="2023-06-05T12:33:36+02:00" level=fatal msg="validate service connection: CRI v1 runtime API is not implemented for endpoint \"unix:///var/run/crio/crio.sock\": rpc error: code = Unimplemented desc = unknown service runtime.v1.RuntimeService"
, error: exit status 1
[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

这是systemctl status crio

● crio.service - Container Runtime Interface for OCI (CRI-O)
   Loaded: loaded (/usr/lib/systemd/system/crio.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2023-06-05 12:05:24 CEST; 28min ago
     Docs: https://github.com/cri-o/cri-o
 Main PID: 12878 (crio)
    Tasks: 17
   CGroup: /system.slice/crio.service
           └─12878 /usr/bin/crio

Jun 05 12:05:24 bloxberg crio[12878]: time="2023-06-05 12:05:24.658549130+02:00" level=info msg="Node configuration value for pid cgroup is true"
Jun 05 12:05:24 bloxberg crio[12878]: time="2023-06-05 12:05:24.658630000+02:00" level=error msg="Node configuration validation for memoryswap cgroup failed: node not configured with memory swap"
Jun 05 12:05:24 bloxberg crio[12878]: time="2023-06-05 12:05:24.658640411+02:00" level=info msg="Node configuration value for memoryswap cgroup is false"
Jun 05 12:05:24 bloxberg crio[12878]: time="2023-06-05 12:05:24.665327338+02:00" level=info msg="Node configuration value for systemd CollectMode is true"
Jun 05 12:05:24 bloxberg crio[12878]: time="2023-06-05 12:05:24.670990831+02:00" level=info msg="Using default capabilities: CAP_CHOWN, CAP_DAC_OVERRIDE, CAP_FSETID, CAP_FOWNER, CAP_SETGID, CAP_SETUID, CAP_SETPCA
Jun 05 12:05:24 bloxberg crio[12878]: time="2023-06-05 12:05:24.674111206+02:00" level=info msg="Conmon does support the --sync option"
Jun 05 12:05:24 bloxberg crio[12878]: time="2023-06-05 12:05:24.674182727+02:00" level=info msg="No seccomp profile specified, using the internal default"
Jun 05 12:05:24 bloxberg crio[12878]: time="2023-06-05 12:05:24.674193157+02:00" level=info msg="AppArmor is disabled by the system or at CRI-O build-time"
Jun 05 12:05:24 bloxberg crio[12878]: time="2023-06-05 12:05:24.674863067+02:00" level=info msg="Update default CNI network name to "
Jun 05 12:05:24 bloxberg systemd[1]: Started Container Runtime Interface for OCI (CRI-O).

kubeadm init --crio-socket "unix:///var/run/containerd/containerd.sock"

I0605 12:44:32.883372   16242 version.go:256] remote version is much newer: v1.27.2; falling back to: stable-1.25
[init] Using Kubernetes version: v1.25.10
[preflight] Running pre-flight checks
[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: [preflight] Some fatal errors occurred:
        [ERROR ImagePull]: failed to pull image registry.k8s.io/kube-apiserver:v1.25.10: output: time="2023-06-05T12:44:33+02:00" level=fatal msg="validate service connection: CRI v1 image API is not implemented for endpoint \"unix:///var/run/crio/crio.sock\": rpc error: code = Unimplemented desc = unknown service runtime.v1.ImageService"
, error: exit status 1
        [ERROR ImagePull]: failed to pull image registry.k8s.io/kube-controller-manager:v1.25.10: output: time="2023-06-05T12:44:33+02:00" level=fatal msg="validate service connection: CRI v1 image API is not implemented for endpoint \"unix:///var/run/crio/crio.sock\": rpc error: code = Unimplemented desc = unknown service runtime.v1.ImageService"
, error: exit status 1
        [ERROR ImagePull]: failed to pull image registry.k8s.io/kube-scheduler:v1.25.10: output: time="2023-06-05T12:44:33+02:00" level=fatal msg="validate service connection: CRI v1 image API is not implemented for endpoint \"unix:///var/run/crio/crio.sock\": rpc error: code = Unimplemented desc = unknown service runtime.v1.ImageService"
, error: exit status 1
        [ERROR ImagePull]: failed to pull image registry.k8s.io/kube-proxy:v1.25.10: output: time="2023-06-05T12:44:34+02:00" level=fatal msg="validate service connection: CRI v1 image API is not implemented for endpoint \"unix:///var/run/crio/crio.sock\": rpc error: code = Unimplemented desc = unknown service runtime.v1.ImageService"
, error: exit status 1
        [ERROR ImagePull]: failed to pull image registry.k8s.io/pause:3.8: output: time="2023-06-05T12:44:34+02:00" level=fatal msg="validate service connection: CRI v1 image API is not implemented for endpoint \"unix:///var/run/crio/crio.sock\": rpc error: code = Unimplemented desc = unknown service runtime.v1.ImageService"
, error: exit status 1
        [ERROR ImagePull]: failed to pull image registry.k8s.io/etcd:3.5.6-0: output: time="2023-06-05T12:44:34+02:00" level=fatal msg="validate service connection: CRI v1 image API is not implemented for endpoint \"unix:///var/run/crio/crio.sock\": rpc error: code = Unimplemented desc = unknown service runtime.v1.ImageService"
, error: exit status 1
        [ERROR ImagePull]: failed to pull image registry.k8s.io/coredns/coredns:v1.9.3: output: time="2023-06-05T12:44:34+02:00" level=fatal msg="validate service connection: CRI v1 image API is not implemented for endpoint \"unix:///var/run/crio/crio.sock\": rpc error: code = Unimplemented desc = unknown service runtime.v1.ImageService"
, error: exit status 1
[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
nukf8bse

nukf8bse1#

https://github.com/containerd/containerd/blob/main/RELEASES.md#kubernetes-support
由于您使用的是kubeadm v1.25,因此应该使用支持CRI v1的containerd 1.6+。

相关问题