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

Failed to deploy k8s cluster on WSL2 #1666

Open xiaozitwo opened 2 years ago

xiaozitwo commented 2 years ago

What happen?

[root@remote sealer]# ./sealer apply -f ./Clusterfile.yaml Usage: sealer apply [flags]

Examples: sealer apply -f Clusterfile

Flags: -f, --Clusterfile string Clusterfile path to apply a Kubernetes cluster (default "Clusterfile") --force force to delete the specified cluster if set true -h, --help help for apply

Global Flags: --color string set the log color mode, the possible values can be [never always] (default "always") --config string config file of sealer tool (default is $HOME/.sealer.json) -d, --debug turn on debug mode --hide-path hide the log path --hide-time hide the log time --log-to-file write log message to disk -q, --quiet silence the usage when fail --remote-logger-url string remote logger url, if not empty, will send log to this url --task-name string task name which will embedded in the remote logger header, only valid when --remote-logger-url is set

2022-08-25 14:02:11 [ERROR] [root.go:70] sealer-v0.8.6: Get "https://lb.kubesphere.local:6443/version?timeout=32s": dial tcp: lookup lb.kubesphere.local: no such host

so install prcess break off。

Relevant log output?

No response

What you expected to happen?

No response

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

step1:
      wget sealos 0.8.6 on wsl2,i want to deploy k8s cluster on my 3 vms.(192.168.176.20~22) 
step2:
      make ClusterFile.yaml
apiVersion: sealer.cloud/v2
kind: Cluster
metadata:
  name: kubernetes-cluster
spec:
  image: kubernetes:v1.21.5
  ssh:
    passwd: 123456
  hosts:
    - ips: [ 192.168.176.20 ]
      roles: [ master ]
    - ips: [ 192.168.176.21,192.168.176.22 ]
      roles: [ node ]
step3:
   run command on swl2
    # sealer apply -f ./Clusterfile.yaml

Anything else we need to know?

workspace is WSL2 sealer on wsl2 3 vms are 192.168.176.20~22

What is the version of Sealer you using?

{"gitVersion":"v0.8.6","gitCommit":"884513e","buildDate":"2022-07-12 02:58:54","goVersion":"go1.16.15","compiler":"gc","platform":"linux/amd64"}

What is your OS environment?

No response

What is the Kernel version?

No response

Other environment you want to tell us?

wsl --list --verbose
NAME STATE VERSION * CentOS7 Running 2

starComingup commented 2 years ago

If you WSL remained the file kubeadm.yml, could you show it to us? @xiaozitwo

cat /var/lib/sealer/data/my-cluster/rootfs/etc/kubeadm.yml
xiaozitwo commented 2 years ago

[root@remote sealer]# cat /var/lib/sealer/data/my-cluster/rootfs/etc/kubeadm.yml cat: /var/lib/sealer/data/my-cluster/rootfs/etc/kubeadm.yml: No such file or directory WSL don`t have this file no my-cluster directory image

kakaZhou719 commented 2 years ago

pls run sealer apply -f clusterfile -d show us more logs. And why we lookup kubesphere domain, Is there something wrong configuration with your local OS? "sealer-v0.8.6: Get "https://lb.kubesphere.local:6443/version?timeout=32s": dial tcp: lookup lb.kubesphere.local: no such host"

xiaozitwo commented 2 years ago

[root@DESKTOP-UDFH9EO sealer]# ./sealer apply -f ./Clusterfile.yaml -d Usage: sealer apply [flags]

Examples: sealer apply -f Clusterfile

Flags: -f, --Clusterfile string Clusterfile path to apply a Kubernetes cluster (default "Clusterfile") --force force to delete the specified cluster if set true -h, --help help for apply

Global Flags: --color string set the log color mode, the possible values can be [never always] (default "always") --config string config file of sealer tool (default is $HOME/.sealer.json) -d, --debug turn on debug mode --hide-path hide the log path --hide-time hide the log time --log-to-file write log message to disk -q, --quiet silence the usage when fail --remote-logger-url string remote logger url, if not empty, will send log to this url --task-name string task name which will embedded in the remote logger header, only valid when --remote-logger-url is set

2022-09-04 23:11:50 [ERROR] [root.go:70] sealer-v0.8.6: Get "https://lb.kubesphere.local:6443/version?timeout=32s": dial tcp: lookup lb.kubesphere.local: no such host

just the same error

imdingtalk commented 2 years ago

The log has errors related to kubesphere, try to use a clean environment