创建部署问题时,请参考下面模板,你提供的信息越多,越容易及时获得解答。如果未按模板创建问题,管理员有权关闭问题。
确保帖子格式清晰易读,用 markdown code block 语法格式化代码块。
你只花一分钟创建的问题,不能指望别人花上半个小时给你解答。

操作系统信息
阿里云,Ubuntu20.04.3,4C/16G

Kubernetes版本信息
kubectl version 命令执行结果贴在下方

Client Version: version.Info{Major:“1”, Minor:“22”, GitVersion:“v1.22.12”, GitCommit:“b058e1760c79f46a834ba59bd7a3486ecf28237d”, GitTreeState:“clean”, BuildDate:“2022-07-13T14:59:18Z”, GoVersion:“go1.16.15”, Compiler:“gc”, Platform:“linux/amd64”}

Server Version: version.Info{Major:“1”, Minor:“22”, GitVersion:“v1.22.12”, GitCommit:“b058e1760c79f46a834ba59bd7a3486ecf28237d”, GitTreeState:“clean”, BuildDate:“2022-07-13T14:53:39Z”, GoVersion:“go1.16.15”, Compiler:“gc”, Platform:“linux/amd64”}

容器运行时
docker version / crictl version / nerdctl version 结果贴在下方

docker version

Client: Docker Engine - Community
 Version:           20.10.10
 API version:       1.41
 Go version:        go1.16.9
 Git commit:        b485636
 Built:             Mon Oct 25 07:42:59 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true
Server: Docker Engine - Community
 Engine:
  Version:          20.10.10
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.9
  Git commit:       e2f740d
  Built:            Mon Oct 25 07:41:08 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.11
  GitCommit:        5b46e404f6b9f661a205e28d59c982d3634148f8
 runc:
  Version:          1.0.2
  GitCommit:        v1.0.2-0-g52b36a2
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

KubeSphere版本信息
v1.22.12 /v3.3.1。在线安装。使用kk安装。

问题是什么
报错日志是什么,最好有截图。

[bootstrap-token] Creating the "cluster-info" ConfigMap in the "kube-public" namespace
[kubelet-finalize] Updating "/etc/kubernetes/kubelet.conf" to point to a rotatable kubelet client certificate and key
[addons] Applied essential addon: CoreDNS
[addons] Applied essential addon: kube-proxy

Your Kubernetes control-plane has initialized successfully!

To start using your cluster, you need to run the following as a regular user:

  mkdir -p $HOME/.kube
  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  sudo chown $(id -u):$(id -g) $HOME/.kube/config

Alternatively, if you are the root user, you can run:

  export KUBECONFIG=/etc/kubernetes/admin.conf

You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
  https://kubernetes.io/docs/concepts/cluster-administration/addons/

You can now join any number of control-plane nodes by copying certificate authorities
and service account keys on each node and then running the following as root:

  kubeadm join lb.kubesphere.local:6443 --token jxzd3p.h29xyrk9cdqsjgf1 \
        --discovery-token-ca-cert-hash sha256:b27eb2ca3538c3640e595c757e05635069ec92b8d6fd9eb5d7c1fb746cea7770 \
        --control-plane 

Then you can join any number of worker nodes by running the following on each as root:

kubeadm join lb.kubesphere.local:6443 --token jxzd3p.h29xyrk9cdqsjgf1 \
        --discovery-token-ca-cert-hash sha256:b27eb2ca3538c3640e595c757e05635069ec92b8d6fd9eb5d7c1fb746cea7770
21:56:25 CST success: [iZuf6ffajhlqk1sptlrdteZ]
21:56:25 CST [InitKubernetesModule] Copy admin.conf to ~/.kube/config
21:56:25 CST success: [iZuf6ffajhlqk1sptlrdteZ]
21:56:25 CST [InitKubernetesModule] Remove master taint
21:56:25 CST stdout: [iZuf6ffajhlqk1sptlrdteZ]
Error from server (NotFound): nodes "iZuf6ffajhlqk1sptlrdteZ" not found
21:56:25 CST [WARN] Failed to exec command: sudo -E /bin/bash -c "/usr/local/bin/kubectl taint nodes iZuf6ffajhlqk1sptlrdteZ node-role.kubernetes.io/master=:NoSchedule-" 
Error from server (NotFound): nodes "iZuf6ffajhlqk1sptlrdteZ" not found: Process exited with status 1

已经使用 /kk delete cluster 命令尝试重新安装过。并清空~ ./kube 目录,重新安装。报错信息相同。

找不到这个节点iZuf6ffajhlqk1sptlrdteZ 看一下是不是安装配置的问题

或者在/etc/hosts里添加 主机名和对应的IP

    18 天 后

    liuyu000

    公网ip 是 47.100.51.110 正确的hosts 文件配置应该是什么

    修改后,每次执行kk命令会自动帮我重置下面的hosts 文件,然后仍然报同样错误。

    以下是 hosts 文件

    127.0.0.1	localhost
    
    # The following lines are desirable for IPv6 capable hosts
    ::1	ip6-localhost	ip6-loopback
    fe00::0	ip6-localnet
    ff00::0	ip6-mcastprefix
    ff02::1	ip6-allnodes
    ff02::2	ip6-allrouters
    127.0.1.1      iZuf6ffajhlqk1sptlrdteZ
    
    47.100.51.110	iZuf6ffajhlqk1sptlrdteZ
    
    
    # kubekey hosts BEGIN
    172.24.19.154  iZuf6ffajhlqk1sptlrdteZ.cluster.local iZuf6ffajhlqk1sptlrdteZ
    172.24.19.154  dockerhub.kubekey.local
    172.24.19.154  lb.kubesphere.local
    # kubekey hosts END

      zzcit

      把下面两个取消 重新试试

      127.0.1.1 iZuf6ffajhlqk1sptlrdteZ (这个ip其实应该是127.0.0.1)

      47.100.51.110 iZuf6ffajhlqk1sptlrdteZ

        liuyu000

        现在执行kk 限制报hostname 不能有大写字母,我把 hostname 改为 zzcit-ubuntu,hosts全部注释 还是报错

        hosts 改成 127.0.0.1 也是会报错