sealerio / sealer

Build, Share and Run Both Your Kubernetes Cluster and Distributed Applications (Project under CNCF)
http://sealer.cool
Apache License 2.0
2.06k stars 362 forks source link

Can't deploy one -click #1520

Open imdingtalk opened 2 years ago

imdingtalk commented 2 years ago

-->

What happened:

otfs/scripts
2022-06-16 20:27:36 [DEBG] [scp.go:137] local copy files src /var/lib/sealer/data/my-cluster/mount/linux_amd64_/statics to dst /var/lib/sealer/data/my-cluster/rootfs/statics

Error: mount rootfs failed exec init.sh failed failed to execute command(cd /var/lib/sealer/data/my-cluster/rootfs  && chmod +x scripts/* && cd scripts && bash init.sh /var/lib/docker sea.hub 5000) on host(10.1.3.78): error(Process exited with status 127)
Usage:
  sealer apply [flags]

Examples:
sealer apply -f Clusterfile

Flags:
  -f, --Clusterfile string   apply a kubernetes cluster (default "Clusterfile")
      --force                We also can input an --force flag to delete cluster by force
  -h, --help                 help for apply

Global Flags:
      --config string   config file (default is $HOME/.sealer.json)
  -d, --debug           turn on debug mode
      --hide-path       hide the log path
      --hide-time       hide the log time

mount rootfs failed exec init.sh failed failed to execute command(cd /var/lib/sealer/data/my-cluster/rootfs  && chmod +x scripts/* && cd scripts && bash init.sh /var/lib/docker sea.hub 5000) on host(10.1.3.78): error(Process exited with status 127)

What you expected to happen:

Of course it is successful

How to reproduce it (as minimally and precisely as possible):

just run

Anything else we need to know?:

Environment:

imdingtalk commented 2 years ago

try to 👎:

cd /var/lib/sealer/data/my-cluster/rootfs && chmod +x scripts/* && cd scripts && bash init.sh /var/lib/docker sea.hub 5000

output:

+ cp ../bin/conntrack ../bin/containerd-rootless-setuptool.sh ../bin/containerd-rootless.sh ../bin/crictl ../bin/kubeadm ../bin/kubectl ../bin/kubelet ../bin/nerdctl ../bin/seautil /usr/bin

+ chmod a+x containerd.sh
+ /bin/bash containerd.sh sea.hub 5000
+ set -e
++ systemctl status containerd
++ echo 4
+ '[' 4 '!=' 0 ']'
+ tar -xvzf ../cri/containerd.tar.gz -C /
containerd.sh: line 20: tar: command not found

Try to deal with, all nodes install TAR

yum install -y tar

then rerun :

sealer apply -f Clusterfile --debug

still not work:

Error: mount rootfs failed exec init.sh failed failed to execute command(cd /var/lib/sealer/data/my-cluster/rootfs  && chmod +x scripts/* && cd scripts && bash init.sh /var/lib/docker sea.hub 5000) on host(10.1.3.77): error(exit status 1)

try run: cd /var/lib/sealer/data/my-cluster/rootfs && chmod +x scripts/* && cd scripts && bash init.sh /var/lib/docker sea.hub 5000

output:

.....
usr/local/bin/containerd-shim-runc-v1
usr/local/bin/critest
usr/local/bin/containerd-shim-runc-v2
usr/local/bin/containerd-stress
opt/containerd/
opt/containerd/cluster/
opt/containerd/cluster/version
opt/containerd/cluster/gce/
opt/containerd/cluster/gce/cni.template
opt/containerd/cluster/gce/env
opt/containerd/cluster/gce/configure.sh
opt/containerd/cluster/gce/cloud-init/
opt/containerd/cluster/gce/cloud-init/node.yaml
opt/containerd/cluster/gce/cloud-init/master.yaml
+ cp -rf ../lib64/libseccomp.so.2 ../lib64/libseccomp.so.2.5.1 /usr/lib64/
+ systemctl enable containerd.service
Failed to enable unit: Connection timed out
[root@localhost scripts]#

check containerd log,it said:

level=error msg="failed to load cni during init, please check CRI plugin status before setting up network for pods" error="cni config load failed: no network config found in /etc/cni/net.d: cni plugin not initialized: failed to load cni config"

imdingtalk commented 2 years ago

try to enable containerd:

[root@localhost scripts]# systemctl  enable containerd

Failed to enable unit: Failed to activate service 'org.freedesktop.systemd1': timed out (service_start_timeout=25000ms), load average: 0.03 0.07 0.06 2/161 29694

solve this problem: 服务无法正常启动显示“failed to activ

then rerun: sealer apply -f Clusterfile --debug

success!!

...
I0616 22:07:41.413819    6955 round_trippers.go:553] GET https://apiserver.cluster.local:6443/api/v1/nodes/worker-1?timeout=10s 404 Not Found in 3 milliseconds
I0616 22:07:41.912776    6955 round_trippers.go:553] GET https://apiserver.cluster.local:6443/api/v1/nodes/worker-1?timeout=10s 200 OK in 2 milliseconds
I0616 22:07:41.918123    6955 round_trippers.go:553] PATCH https://apiserver.cluster.local:6443/api/v1/nodes/worker-1?timeout=10s 200 OK in 4 milliseconds

This node has joined the cluster:
* Certificate signing request was sent to apiserver and a response was received.
* The Kubelet was informed of the new secure connection details.

Run 'kubectl get nodes' on the control-plane to see this node join the cluster.

2022-06-16 22:07:42 [INFO] [nodes.go:115] Succeeded in joining 10.1.3.78 as worker
2022-06-16 22:07:42 [INFO] [local.go:298] Succeeded in creating a new cluster, enjoy it!
kakaZhou719 commented 2 years ago

@imdingtalk , appreciate your help to debug this. I think there is some misconfiguration on our containerd init scripts. which clusterimage version you used , let me to reproduce this problem.

imdingtalk commented 2 years ago

@imdingtalk , appreciate your help to debug this. I think there is some misconfiguration on our containerd init scripts. which clusterimage version you used , let me to reproduce this problem.

kubernetes:v1.24.1 | d59e930f7212ea048368acb01ef7f8042c2ed8ffb6571baf5e24edf4b0c391d5 | amd64 | | 2022-06-16 20:02:26 | 651.54MB