kubernetes kubeadm init命令输出[ERROR ImagePull]

x4shl7ld  于 2023-06-28  发布在  Kubernetes
关注(0)|答案(1)|浏览(258)

Kubernetes正在尝试初始化,但是,当命令:kubeadm init --kubernetes-version v1.27.0正在运行kubernetes所需的镜像在拉取时失败。

[ERROR ImagePull]: failed to pull image registry.k8s.io/kube-apiserver:v1.27.3: output: E0626 19:20:40.073178    5572 remote_image.go:171] "PullImage from image service failed" err="rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/kube-apiserver:v1.27.3\": failed to extract layer sha256:6fbdf253bbc2490dcfede5bdb58ca0db63ee8aff565f6ea9f918f3bce9e2d5aa: failed to mount /var/lib/containerd/tmpmounts/containerd-mount2405338980: invalid argument: unknown" image="registry.k8s.io/kube-apiserver:v1.27.3"
time="2023-06-26T19:20:40Z" level=fatal msg="pulling image: rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/kube-apiserver:v1.27.3\": failed to extract layer sha256:6fbdf253bbc2490dcfede5bdb58ca0db63ee8aff565f6ea9f918f3bce9e2d5aa: failed to mount /var/lib/containerd/tmpmounts/containerd-mount2405338980: invalid argument: unknown"
, error: exit status 1
        [ERROR ImagePull]: failed to pull image registry.k8s.io/kube-controller-manager:v1.27.3: output: E0626 19:20:45.804768    5616 remote_image.go:171] "PullImage from image service failed" err="rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/kube-controller-manager:v1.27.3\": failed to extract layer sha256:6fbdf253bbc2490dcfede5bdb58ca0db63ee8aff565f6ea9f918f3bce9e2d5aa: failed to mount /var/lib/containerd/tmpmounts/containerd-mount3638612445: invalid argument: unknown" image="registry.k8s.io/kube-controller-manager:v1.27.3"
time="2023-06-26T19:20:45Z" level=fatal msg="pulling image: rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/kube-controller-manager:v1.27.3\": failed to extract layer sha256:6fbdf253bbc2490dcfede5bdb58ca0db63ee8aff565f6ea9f918f3bce9e2d5aa: failed to mount /var/lib/containerd/tmpmounts/containerd-mount3638612445: invalid argument: unknown"
, error: exit status 1
        [ERROR ImagePull]: failed to pull image registry.k8s.io/kube-scheduler:v1.27.3: output: E0626 19:20:51.578594    5652 remote_image.go:171] "PullImage from image service failed" err="rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/kube-scheduler:v1.27.3\": failed to extract layer sha256:6fbdf253bbc2490dcfede5bdb58ca0db63ee8aff565f6ea9f918f3bce9e2d5aa: failed to mount /var/lib/containerd/tmpmounts/containerd-mount663924286: invalid argument: unknown" image="registry.k8s.io/kube-scheduler:v1.27.3"
time="2023-06-26T19:20:51Z" level=fatal msg="pulling image: rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/kube-scheduler:v1.27.3\": failed to extract layer sha256:6fbdf253bbc2490dcfede5bdb58ca0db63ee8aff565f6ea9f918f3bce9e2d5aa: failed to mount /var/lib/containerd/tmpmounts/containerd-mount663924286: invalid argument: unknown"
, error: exit status 1
        [ERROR ImagePull]: failed to pull image registry.k8s.io/kube-proxy:v1.27.3: output: E0626 19:21:11.128818    5705 remote_image.go:171] "PullImage from image service failed" err="rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/kube-proxy:v1.27.3\": failed to extract layer sha256:8bca7f3ac0cfc4478a1900385b5706d8d32be32d7718409e0ae46b4dec73806c: failed to mount /var/lib/containerd/tmpmounts/containerd-mount3026513410: invalid argument: unknown" image="registry.k8s.io/kube-proxy:v1.27.3"
time="2023-06-26T19:21:11Z" level=fatal msg="pulling image: rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/kube-proxy:v1.27.3\": failed to extract layer sha256:8bca7f3ac0cfc4478a1900385b5706d8d32be32d7718409e0ae46b4dec73806c: failed to mount /var/lib/containerd/tmpmounts/containerd-mount3026513410: invalid argument: unknown"
, error: exit status 1
        [ERROR ImagePull]: failed to pull image registry.k8s.io/etcd:3.5.7-0: output: E0626 19:21:22.338111    5761 remote_image.go:171] "PullImage from image service failed" err="rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/etcd:3.5.7-0\": failed to extract layer sha256:6b808fb73d6dd79b278378a0d3baba820f08d66ea469470ea012130d9debbcc4: failed to mount /var/lib/containerd/tmpmounts/containerd-mount1820373480: invalid argument: unknown" image="registry.k8s.io/etcd:3.5.7-0"
time="2023-06-26T19:21:22Z" level=fatal msg="pulling image: rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/etcd:3.5.7-0\": failed to extract layer sha256:6b808fb73d6dd79b278378a0d3baba820f08d66ea469470ea012130d9debbcc4: failed to mount /var/lib/containerd/tmpmounts/containerd-mount1820373480: invalid argument: unknown"
, error: exit status 1
        [ERROR ImagePull]: failed to pull image registry.k8s.io/coredns/coredns:v1.10.1: output: E0626 19:21:38.430207    5812 remote_image.go:171] "PullImage from image service failed" err="rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/coredns/coredns:v1.10.1\": failed to extract layer sha256:398c9baff0cedc8a35520742c35f0c216f9fd7f300f5f1e5e469504a93dc03bf: failed to mount /var/lib/containerd/tmpmounts/containerd-mount238473341: invalid argument: unknown" image="registry.k8s.io/coredns/coredns:v1.10.1"
time="2023-06-26T19:21:38Z" level=fatal msg="pulling image: rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/coredns/coredns:v1.10.1\": failed to extract layer sha256:398c9baff0cedc8a35520742c35f0c216f9fd7f300f5f1e5e469504a93dc03bf: failed to mount /var/lib/containerd/tmpmounts/containerd-mount238473341: invalid argument: unknown"
, error: exit status 1

它是在debian 10 buster lxc环境下运行的。以下是重现问题的所有命令。

swapoff -a

cat <<EOF | tee /etc/modules-load.d/k8s.conf
overlay
br_netfilter
EOF

modprobe overlay
modprobe br_netfilter

cat <<EOF | tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-iptables  = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.ipv4.ip_forward                 = 1
EOF

sysctl --system

mkdir /etc/apt/keyrings

curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg

echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
  $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
  
apt-get update 

apt-get install -y containerd.io

mkdir -p /etc/containerd
containerd config default | tee /etc/containerd/config.toml

sed -i 's/            SystemdCgroup = false/            SystemdCgroup = true/' /etc/containerd/config.toml

systemctl restart containerd

curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -

echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | tee /etc/apt/sources.list.d/kubernetes.list

apt-get update

VERSION=1.27.0-00

apt-get install -y kubelet=$VERSION kubeadm=$VERSION kubectl=$VERSION 

apt-mark hold kubelet kubeadm kubectl containerd

systemctl enable kubelet.service

systemctl enable containerd.service

wget https://raw.githubusercontent.com/projectcalico/calico/master/manifests/calico.yaml

kubeadm init --kubernetes-version v1.27.0
9q78igpj

9q78igpj1#

我不是kubernetesMaven,但我创建了一个没有默认命名空间服务器的容器,它提取了图像。但是,kubelet无法启动的另一个问题是错误消息:

[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp 127.0.0.1:10248: connect: connection refused.

相关问题