-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在centos8.4安装v0.8.0版本失败 #39
Comments
上面的ssh報錯已經很明顯了,這是因為你的服務器ssh免密通道創建失敗。 每個公司的安全合規要求與安全設置不一樣,所以我們的“-exec sshcontrol”可以供你參攷。 如果你遇到一些系統安全配寘導致服務器ssh免密通道創建失敗,可以嘗試自己手工進行打通。 解決方法:你可以手工創建k8snode04到192.168.50.54、192.168.50.55、192.168.50.56、192.168.50.57、192.168.50.58的ssh免密通道即可。 |
手工創建SSH免密通道的方法舉例: 目的:hostA主機可以免密ssh hostB 操作: 1.執行ssh-keygen -t rsa /root/. ssh/下有id_ rsa、id_ rsd. pub 2.執行cp /root/. ssh/id_ rsd/pub /root/.ssh/authorized_ keys 創建認證檔案成功 3.執行ssh-copy-id root@hostB 執行成功,hostB存在/root/. ssh/authorized_ key檔案 4.執行ssh hostB,連結成功。 手工創建ssh免密通道的方法很簡單,互聯網上也有很多方法可以蒐索參攷。 |
待你的ssh免密通道創建成功之後,就可以使用kube-install的圖形介面或命令列進行正常安裝了。 |
你好:
我重新配置了下网络IP地址,使用图形界面的打通目标主机ssh通道后,执行安装集群时:
[cid:f7ad86ff-0c53-4db7-a482-e577647afcfb]
…________________________________
发件人: house ***@***.***>
发送时间: 2022年10月12日 13:51
收件人: cloudnativer/kube-install ***@***.***>
抄送: xy2019devl ***@***.***>; Author ***@***.***>
主题: Re: [cloudnativer/kube-install] 在centos8.4安装v0.8.0版本失败 (Issue #39)
上面的ssh�箦e已�很明@了,@是因�槟愕姆�掌ssh免密通道��建失� 每��公司的安全合要求c安全O置不一�樱晕��的“-exec sshcontrol”只是供你��。 如果你遇到一些系y安全配���е路�掌ssh免密通道��建失�。梢�L�自己手工M行打通。
解�Q方法:你可以手工��建k8snode04到192.168.50.54192.168.50.55192.168.50.56192.168.50.57192.168.50.58的ssh免密通道即可。
________________________________
待你的ssh免密通道��建成功之後,就可以使用kube-install的�D形介面或命令列M行正常安b了。
―
Reply to this email directly, view it on GitHub<#39 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AMTSUSR7KLJN22SAV72FTNTWCZGULANCNFSM6AAAAAARB5CJBQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
***@***.*** ~]# ssh 192.168.3.161 date
Wed Oct 12 18:19:09 CST 2022
***@***.*** ~]# ssh 192.168.3.162 date
Wed Oct 12 18:18:59 CST 2022
***@***.*** ~]# ssh 192.168.3.163 date
Wed Oct 12 18:19:04 CST 2022
***@***.*** ~]# ssh 192.168.3.164 date
Wed Oct 12 18:19:09 CST 2022
***@***.*** ~]# ssh 192.168.3.165 date
Wed Oct 12 18:19:14 CST 2022
***@***.*** ~]#
ssh 到目标的主机已经开通了
…________________________________
发件人: house ***@***.***>
发送时间: 2022年10月12日 13:51
收件人: cloudnativer/kube-install ***@***.***>
抄送: xy2019devl ***@***.***>; Author ***@***.***>
主题: Re: [cloudnativer/kube-install] 在centos8.4安装v0.8.0版本失败 (Issue #39)
上面的ssh�箦e已�很明@了,@是因�槟愕姆�掌ssh免密通道��建失� 每��公司的安全合要求c安全O置不一�樱晕��的“-exec sshcontrol”只是供你��。 如果你遇到一些系y安全配���е路�掌ssh免密通道��建失�。梢�L�自己手工M行打通。
解�Q方法:你可以手工��建k8snode04到192.168.50.54192.168.50.55192.168.50.56192.168.50.57192.168.50.58的ssh免密通道即可。
________________________________
待你的ssh免密通道��建成功之後,就可以使用kube-install的�D形介面或命令列M行正常安b了。
―
Reply to this email directly, view it on GitHub<#39 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AMTSUSR7KLJN22SAV72FTNTWCZGULANCNFSM6AAAAAARB5CJBQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
安装的报错日志信息: PLAY [master1] ***************************************************************** TASK [/root/kube-install/data/output/k8s_prod/sys/0x00000000addons : 0.Create addons directory] *** TASK [/root/kube-install/data/output/k8s_prod/sys/0x00000000addons : 1.1 Create coredns.yaml file] *** TASK [/root/kube-install/data/output/k8s_prod/sys/0x00000000addons : 1.2 Deploy coredns] *** PLAY RECAP ********************************************************************* [Error] 2022-10-12 14:52:55.945082336 +0800 CST m=+7285.287588335 Kubernetes install failed! There is an error in the process! |
PLAY [etcd] ******************************************************************** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x0000000storage : 1.Cleaning up garbage files left in history] *** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x0000000storage : 2.Decompress etcd software package] *** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x0000000storage : 3.Create /opt/kube-install/k8s/etcd data directory] *** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x0000000storage : 4.Create etcd cert directory] *** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x0000000storage : 5.Distribution etcd cert file] *** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x0000000storage : 6.Check and replace etcd member status] *** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x0000000storage : shell] *** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x0000000storage : 7.Create etcd service file] *** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x0000000storage : 8.Start etcd service] *** PLAY [master,node] ************************************************************* TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x00000000master/kubectl : 1.Create /root/.kube directory] *** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x00000000master/kubectl : 2.Create local.kubeconfig file] *** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x00000000master/kubectl : 3.Generate kubectl program file] *** PLAY [master] ****************************************************************** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x00000000master/apiserver : 1.Distribution kube-apiserver cert] *** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x00000000master/apiserver : 2.Create kube-apiserver service startup file] *** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x00000000master/apiserver : 3.Create /opt/kube-install/k8s/kubernetes/kube-apiserver directory] *** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x00000000master/apiserver : 4.Start kube-apiserver service] *** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x00000000master/apiserver : 5.Set IPVS rules] *** PLAY [master1] ***************************************************************** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x00000000master/api-rbac : 1.Wait 30s] *** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x00000000master/api-rbac : 2.Create clusterrolebinding] *** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x00000000master/api-rbac : shell] *** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x00000000master/api-rbac : 3.Get kubelet-api-admin role info] *** PLAY [master] ****************************************************************** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x00000000master/controller-manager : 1.Create kube-controller-manager service startup file] *** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x00000000master/controller-manager : 2.Create /opt/kube-install/k8s/kubernetes/kube-controller-manager directory] *** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x00000000master/controller-manager : 3.Start kube-controller-manager service] *** PLAY [master] ****************************************************************** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x00000000master/scheduler : 1.Create kube-scheduler service startup file] *** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x00000000master/scheduler : 2.Create /opt/kube-install/k8s/kubernetes/kube-scheduler directory] *** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x00000000master/scheduler : 3.Start kube-scheduler service] *** PLAY [master1] ***************************************************************** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x0000000network/flannel : 1.Create cniplugin directory] *** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x0000000network/flannel : 2.Create flannel.yaml file] *** TASK [/root/kube-install/data/output/jzyz-k8s-prod/sys/0x0000000network/flannel : 3.Deploy flannel] *** fatal: [192.168.3.161]: FAILED! => {"changed": true, "cmd": "/usr/sbin/kubectl --kubeconfig=/etc/kubernetes/ssl/kube-install.kubeconfig apply -f /opt/kube-install/k8s/cniplugin/flannel/flannel.yaml", "delta": "0:00:28.986573", "end": "2022-10-12 23:25:03.083417", "msg": "non-zero return code", "rc": 1, "start": "2022-10-12 23:24:34.096844", "stderr": "resource mapping not found for name: "psp.flannel.unprivileged" namespace: "" from "/opt/kube-install/k8s/cniplugin/flannel/flannel.yaml": no matches for kind "PodSecurityPolicy" in version "policy/v1beta1"\nensure CRDs are installed first\nresource mapping not found for name: "flannel" namespace: "" from "/opt/kube-install/k8s/cniplugin/flannel/flannel.yaml": no matches for kind "ClusterRole" in version "rbac.authorization.k8s.io/v1"\nensure CRDs are installed first\nresource mapping not found for name: "flannel" namespace: "" from "/opt/kube-install/k8s/cniplugin/flannel/flannel.yaml": no matches for kind "ClusterRoleBinding" in version "rbac.authorization.k8s.io/v1"\nensure CRDs are installed first", "stderr_lines": ["resource mapping not found for name: "psp.flannel.unprivileged" namespace: "" from "/opt/kube-install/k8s/cniplugin/flannel/flannel.yaml": no matches for kind "PodSecurityPolicy" in version "policy/v1beta1"", "ensure CRDs are installed first", "resource mapping not found for name: "flannel" namespace: "" from "/opt/kube-install/k8s/cniplugin/flannel/flannel.yaml": no matches for kind "ClusterRole" in version "rbac.authorization.k8s.io/v1"", "ensure CRDs are installed first", "resource mapping not found for name: "flannel" namespace: "" from "/opt/kube-install/k8s/cniplugin/flannel/flannel.yaml": no matches for kind "ClusterRoleBinding" in version "rbac.authorization.k8s.io/v1"", "ensure CRDs are installed first"], "stdout": "serviceaccount/flannel created\nconfigmap/kube-flannel-cfg created\ndaemonset.apps/kube-flannel-ds created", "stdout_lines": ["serviceaccount/flannel created", "configmap/kube-flannel-cfg created", "daemonset.apps/kube-flannel-ds created"]} PLAY RECAP ********************************************************************* [Info] 2022-10-12 23:25:03.184857691 +0800 CST m=+6901.265222912 Cleaning and detection after installation are in progress. Please wait ... [Error] 2022-10-12 23:34:06.058730745 +0800 CST m=+7444.139095978 Kubernetes cluster install failed! jzyz-k8s-prod cluster status is unhealthy! |
可能的原因以及建議: |
我是新创建的虚拟机安装的centos8.5 通过图形界面卸载了,重新安装也试过,还是这个问题 |
[root@localhost kube-install]# cat /etc/redhat-release [root@localhost kube-install]# ./kube-install -init -ostype "centos8" Initialization in progress, please wait... Notice: If you are prompted to enter the password below, please enter the root password again! Initialization completed! [root@localhost kube-install]# ./kube-install -exec sshcontrol -sship "192.168.3.165,192.168.3.166,192.168.3.167" -sshpass "1qaz2wsx" Opening SSH tunnel, please wait... [Info] 2022-10-24 14:02:12.643061575 +0800 CST m=+1.098110262 Successfully open the SSH channel from local host to the target host (192.168.3.165,192.168.3.166,192.168.3.167)! The SSH tunnel is opened! [root@localhost kube-install]# [Info] 2022-10-24 14:09:15.602774641 +0800 CST m=+0.147188261 Installing kubernetes cluster, please wait ...
PLAY [master,node] ************************************************************* TASK [/opt/kube-install/data/output/k8s-prod/sys/0x0000000000base/genfile : 0.Distributing deployment files to target host, please wait...] *** TASK [/opt/kube-install/data/output/k8s-prod/sys/0x0000000000base/genfile : file] *** TASK [/opt/kube-install/data/output/k8s-prod/sys/0x0000000000base/genfile : copy] *** TASK [/opt/kube-install/data/output/k8s-prod/sys/0x0000000000base/genfile : copy] *** 中间省略****** TASK [/opt/kube-install/data/output/k8s-prod/sys/0x00000000action/pushimages : wait_for] *** PLAY [node] ******************************************************************** TASK [/opt/kube-install/data/output/k8s-prod/sys/0x00000000finish/install : Create reboot config file] *** TASK [/opt/kube-install/data/output/k8s-prod/sys/0x00000000finish/install : Congratulations, kubernetes cluster installation and deployment is successful! "The operating system will automatically restart in 10 seconds to take effect on the cluster configuration."] *** TASK [/opt/kube-install/data/output/k8s-prod/sys/0x00000000finish/install : shell] *** PLAY RECAP ********************************************************************* [Info] 2022-10-24 14:46:12.195787518 +0800 CST m=+2216.740201120 Cleaning and detection after installation are in progress. Please wait ... [Info] 2022-10-24 14:46:12.206554586 +0800 CST m=+2216.750968182 Kubernetes cluster install completed! [root@localhost kube-install]# pwd 这样是安装成功了吗? |
你是不是把安裝包存放的路徑和安裝的目標路徑設定成為一樣可? 從你的日誌來看,應該都是/opt/kube-install。 這樣會讓你的/opt/kube-install目錄看上去比較混亂。 |
看上去沒有任何報錯,應該是安裝成功了。 |
操作系统:
[root@k8snode04 ~]# cat /etc/redhat-release
CentOS Linux release 8.4.2105
内核版本:
[root@k8snode04 ~]# uname -a
Linux k8snode04 4.18.0-305.3.1.el8.x86_64 #1 SMP Tue Jun 1 16:14:33 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
kube-install版本:kube-install-allinone-v0.8.0.tgz
通过命令行安装失败:
[root@k8snode04 kube-install]# ./kube-install -exec sshcontrol -sship "192.168.50.54,192.168.50.55,192.168.50.56,192.168.50.57,192.168.50.58" -sshport 22 -sshpass "1qaz2wsx"
Opening SSH tunnel, please wait...
2022/10/11 12:57:01 Error waiting for command execution: exit status 1......
[Error] 2022-10-11 12:57:01.462401159 +0800 CST m=+260.489429147 Failed to open the SSH channel. Please use "root" user to manually open the SSH channel from the local host to the target host, or try to open the SSH channel again after executing the following command on the target host:
sudo sed -i "/PermitRootLogin/d" /etc/ssh/sshd_config
sudo sh -c "echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config"
sudo sed -i "/StrictHostKeyChecking/s/^#//; /StrictHostKeyChecking/s/ask/no/" /etc/ssh/ssh_config
sudo systemctl restart sshd
(If the SSH port of the host is not "22", use the "-sshport" to specify the correct port.)
Failed to open SSH tunnel!
[root@k8snode04 kube-install]#
root@k8snode04 kube-install]# ./kube-install -exec install -master "192.168.50.54,192.168.50.55,192.168.50.56" -node "192.168.50.54,192.168.50.55,192.168.50.56,192.168.50.57,192.168.50.58" -k8sver "1.24" -ostype "centos8" -label "k8s_prod" -softdir /data/k8s
[Info] 2022-10-11 12:23:49.96783815 +0800 CST m=+0.047450820 Installing kubernetes cluster, please wait ...
PLAY [master,node] *************************************************************
TASK [/root/kube-install/data/output/k8s_prod/sys/0x0000000000base/genfile : 0.Distributing deployment files to target host, please wait...] ***
fatal: [192.168.50.55]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ssh: connect to host 192.168.50.55 port 22: Connection timed out", "unreachable": true}
fatal: [192.168.50.54]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ssh: connect to host 192.168.50.54 port 22: Connection timed out", "unreachable": true}
fatal: [192.168.50.57]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ssh: connect to host 192.168.50.57 port 22: Connection timed out", "unreachable": true}
fatal: [192.168.50.58]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ssh: connect to host 192.168.50.58 port 22: Connection timed out", "unreachable": true}
fatal: [192.168.50.56]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ssh: connect to host 192.168.50.56 port 22: Connection timed out", "unreachable": true}
PLAY RECAP *********************************************************************
192.168.50.54 : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
192.168.50.55 : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
192.168.50.56 : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
192.168.50.57 : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
192.168.50.58 : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
[Info] 2022-10-11 12:24:01.793613504 +0800 CST m=+11.873226174 Cleaning and detection after installation are in progress. Please wait ...
[Error] 2022-10-11 12:33:01.80195567 +0800 CST m=+551.881568381 Kubernetes cluster install failed! k8s_prod cluster status is unhealthy!
在图形界面安装时,状态显示未知,安装失败。
The text was updated successfully, but these errors were encountered: