TimeBye / kubeadm-ha

kubeadm-ha 使用 kubeadm 进行高可用 kubernetes 集群搭建,利用 ansible-playbook 实现自动化安装,既提供一键安装脚本,也可以根据 playbook 分步执行安装各个组件。
Other
607 stars 298 forks source link

ubuntu离线安装失败 #134

Closed Xingac1999 closed 1 year ago

Xingac1999 commented 1 year ago

缺陷描述

清晰而简明的描述缺陷是什么。

环境 (请填写以下信息): ubuntu16.04.12

执行下面括号中的命令,提交返回结果

如何复现

  1. 出现错误 root@deploy:~/my-cluster# vi inventory.ini root@deploy:~/my-cluster# docker exec -it kubeadm-ha ansible-playbook -i my-cluster/inventory.ini -e @my-cluster/variables.yaml 90-init-cluster.yml

PLAY [all] ***

TASK [设置代理服务器环境变量] *** ok: [node1] ok: [node3] ok: [node2] ok: [node4]

PLAY [all] ***

TASK [Gathering Facts] *** [DEPRECATION WARNING]: Distribution Ubuntu 16.04 on host node3 should use /usr/bin/python3, but is using /usr/bin/python for backward compatibility with prior Ansible releases. A future Ansible release will default to using the discovered platform python for this host. See https://docs.ansible.com/ansible/2.10/reference_appendices/interpreter_discovery.html for more information. This feature will be removed in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. ok: [node3] [DEPRECATION WARNING]: Distribution Ubuntu 16.04 on host node4 should use /usr/bin/python3, but is using /usr/bin/python for backward compatibility with prior Ansible releases. A future Ansible release will default to using the discovered platform python for this host. See https://docs.ansible.com/ansible/2.10/reference_appendices/interpreter_discovery.html for more information. This feature will be removed in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. ok: [node4] [DEPRECATION WARNING]: Distribution Ubuntu 16.04 on host node2 should use /usr/bin/python3, but is using /usr/bin/python for backward compatibility with prior Ansible releases. A future Ansible release will default to using the discovered platform python for this host. See https://docs.ansible.com/ansible/2.10/reference_appendices/interpreter_discovery.html for more information. This feature will be removed in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. ok: [node2] [DEPRECATION WARNING]: Distribution Ubuntu 16.04 on host node1 should use /usr/bin/python3, but is using /usr/bin/python for backward compatibility with prior Ansible releases. A future Ansible release will default to using the discovered platform python for this host. See https://docs.ansible.com/ansible/2.10/reference_appendices/interpreter_discovery.html for more information. This feature will be removed in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. ok: [node1]

TASK [prepare/variables : 设置变量] ** ok: [node1] => { "msg": "Check roles/prepare/variables/defaults/main.yml" } ok: [node2] => { "msg": "Check roles/prepare/variables/defaults/main.yml" } ok: [node3] => { "msg": "Check roles/prepare/variables/defaults/main.yml" } ok: [node4] => { "msg": "Check roles/prepare/variables/defaults/main.yml" } included: /etc/ansible/roles/prepare/base/tasks/verify_variables.yml for node1, node2, node3, node4

TASK [prepare/base : 校验 NodeName 是否合法] *** ok: [node1] => { "changed": false, "msg": "All assertions passed" } ok: [node2] => { "changed": false, "msg": "All assertions passed" } ok: [node3] => { "changed": false, "msg": "All assertions passed" } ok: [node4] => { "changed": false, "msg": "All assertions passed" }

TASK [prepare/base : 校验 etcd 节点数量] *** ok: [node1] => { "changed": false, "msg": "All assertions passed" }

TASK [prepare/base : 校验 master 节点数量] ***** ok: [node1] => { "changed": false, "msg": "All assertions passed" }

TASK [prepare/base : 校验 worker 节点数量] ***** ok: [node1] => { "changed": false, "msg": "All assertions passed" }

TASK [prepare/base : 校验 new-etcd 节点组数量] ** ok: [node1] => { "changed": false, "msg": "All assertions passed" } ok: [node2] => { "changed": false, "msg": "All assertions passed" } ok: [node3] => { "changed": false, "msg": "All assertions passed" } ok: [node4] => { "changed": false, "msg": "All assertions passed" }

TASK [prepare/base : 校验 etcd 节点数量] *** ok: [node1] => { "changed": false, "msg": "All assertions passed" }

TASK [prepare/base : 校验 lb 模式类型] ***** ok: [node1] => { "changed": false, "msg": "All assertions passed" }

TASK [prepare/base : 校验 lb 模式端口设置] *** ok: [node1] => { "changed": false, "msg": "All assertions passed" } ok: [node2] => { "changed": false, "msg": "All assertions passed" } ok: [node3] => { "changed": false, "msg": "All assertions passed" }

TASK [prepare/base : 校验 kube-proxy 模式类型] ***** ok: [node1] => { "changed": false, "msg": "All assertions passed" }

TASK [prepare/base : 校验容器运行时类型] ** ok: [node1] => { "changed": false, "msg": "All assertions passed" } included: /etc/ansible/roles/prepare/base/tasks/verify_node.yml for node1, node2, node3, node4

TASK [prepare/base : 校验节点操作系统] *** ok: [node1] => { "changed": false, "msg": "All assertions passed" } ok: [node2] => { "changed": false, "msg": "All assertions passed" } ok: [node3] => { "changed": false, "msg": "All assertions passed" } ok: [node4] => { "changed": false, "msg": "All assertions passed" }

TASK [prepare/base : 校验节点 systemd 类型操作系统] **** ok: [node1] => { "changed": false, "msg": "All assertions passed" } ok: [node2] => { "changed": false, "msg": "All assertions passed" } ok: [node3] => { "changed": false, "msg": "All assertions passed" } ok: [node4] => { "changed": false, "msg": "All assertions passed" }

TASK [prepare/base : 校验节点系统内核] *** ok: [node1] => { "changed": false, "msg": "All assertions passed" } ok: [node2] => { "changed": false, "msg": "All assertions passed" } ok: [node3] => { "changed": false, "msg": "All assertions passed" } ok: [node4] => { "changed": false, "msg": "All assertions passed" }

TASK [prepare/base : 校验节点系统架构] *** ok: [node1] => { "changed": false, "msg": "All assertions passed" } ok: [node2] => { "changed": false, "msg": "All assertions passed" } ok: [node3] => { "changed": false, "msg": "All assertions passed" } ok: [node4] => { "changed": false, "msg": "All assertions passed" }

TASK [prepare/base : 校验节点系统版本] *** ok: [node1] => { "changed": false, "msg": "All assertions passed" } ok: [node2] => { "changed": false, "msg": "All assertions passed" } ok: [node3] => { "changed": false, "msg": "All assertions passed" } ok: [node4] => { "changed": false, "msg": "All assertions passed" }

TASK [prepare/base : 校验 master 节点内存] ***** ok: [node1] => { "changed": false, "msg": "All assertions passed" } ok: [node2] => { "changed": false, "msg": "All assertions passed" } ok: [node3] => { "changed": false, "msg": "All assertions passed" }

TASK [prepare/base : 校验 worker 节点内存] ***** ok: [node1] => { "changed": false, "msg": "All assertions passed" } ok: [node2] => { "changed": false, "msg": "All assertions passed" } ok: [node3] => { "changed": false, "msg": "All assertions passed" } ok: [node4] => { "changed": false, "msg": "All assertions passed" }

TASK [prepare/base : 校验 master 节点CPU核数] ** ok: [node1] => { "changed": false, "msg": "All assertions passed" } ok: [node2] => { "changed": false, "msg": "All assertions passed" } ok: [node3] => { "changed": false, "msg": "All assertions passed" }

TASK [prepare/base : 校验 worker 节点CPU核数] ** ok: [node1] => { "changed": false, "msg": "All assertions passed" } ok: [node2] => { "changed": false, "msg": "All assertions passed" } ok: [node3] => { "changed": false, "msg": "All assertions passed" } ok: [node4] => { "changed": false, "msg": "All assertions passed" } included: /etc/ansible/roles/prepare/base/tasks/common.yml for node1, node2, node3, node4

TASK [prepare/base : 统一时区为 Asia/Shanghai] **** ok: [node2] ok: [node1] ok: [node4] ok: [node3]

TASK [prepare/base : 禁用系统 swap] ** changed: [node1] changed: [node3] changed: [node4] changed: [node2]

TASK [prepare/base : 删除 fstab swap 相关配置] ***** changed: [node3] changed: [node4] changed: [node1] changed: [node2]

TASK [prepare/base : 加载内核模块] ***** changed: [node1] => (item=sunrpc) changed: [node2] => (item=sunrpc) changed: [node4] => (item=sunrpc) changed: [node3] => (item=sunrpc) changed: [node4] => (item=ip_vs) changed: [node1] => (item=ip_vs) changed: [node3] => (item=ip_vs) changed: [node2] => (item=ip_vs) changed: [node4] => (item=ip_vs_rr) changed: [node1] => (item=ip_vs_rr) changed: [node2] => (item=ip_vs_rr) changed: [node3] => (item=ip_vs_rr) changed: [node4] => (item=ip_vs_sh) changed: [node1] => (item=ip_vs_sh) changed: [node2] => (item=ip_vs_sh) changed: [node3] => (item=ip_vs_sh) changed: [node4] => (item=ip_vs_wrr) changed: [node1] => (item=ip_vs_wrr) changed: [node2] => (item=ip_vs_wrr) changed: [node3] => (item=ip_vs_wrr) changed: [node4] => (item=br_netfilter) changed: [node1] => (item=br_netfilter) changed: [node2] => (item=br_netfilter) changed: [node3] => (item=br_netfilter)

TASK [prepare/base : 加载 nf_conntrack_ipv4] *** changed: [node1] changed: [node2] changed: [node3] changed: [node4]

TASK [prepare/base : 设置 systemd-modules-load 配置] ***** changed: [node1] changed: [node2] changed: [node3] changed: [node4]

TASK [prepare/base : 启动/重启 systemd-modules-load] ***** changed: [node4] changed: [node2] changed: [node3] changed: [node1]

TASK [prepare/base : 设置系统参数] ***** changed: [node1] changed: [node2] changed: [node4] changed: [node3]

TASK [prepare/base : 生效系统参数] ***** changed: [node1] changed: [node2] changed: [node3] changed: [node4]

TASK [prepare/base : 优化 nfs clinet 配置] *** changed: [node1] changed: [node3] changed: [node4] changed: [node2]

TASK [prepare/base : 生效 nfs clinet 配置] *** changed: [node1] changed: [node2] changed: [node4] changed: [node3]

TASK [prepare/base : 添加集群节点 hostname 信息到 hosts 文件中] ** changed: [node2] changed: [node3] changed: [node1] changed: [node4]

TASK [prepare/base : 确认 hosts 文件中 localhost ipv4 配置正确] *** changed: [node1] changed: [node3] changed: [node2] changed: [node4]

TASK [prepare/base : 确认 hosts 文件中 localhost ipv6 配置正确] *** changed: [node1] changed: [node3] changed: [node2] changed: [node4]

TASK [prepare/base : 创建 systemd 配置目录] **** changed: [node4] changed: [node2] changed: [node3] changed: [node1]

TASK [prepare/base : 设置系统 ulimits] *** changed: [node1] changed: [node2] changed: [node4] changed: [node3] included: /etc/ansible/roles/prepare/base/tasks/debian.yml for node1, node2, node3, node4

TASK [prepare/base : 判断 ufw 是否安装] **** changed: [node1] changed: [node2] changed: [node3] changed: [node4]

TASK [prepare/base : 禁用防火墙] ** changed: [node1] changed: [node2] changed: [node4] changed: [node3]

TASK [prepare/base : 安装 ubuntu 基础软件] ***** [WARNING]: Updating cache and auto-installing missing dependency: python-apt changed: [node1] changed: [node2] changed: [node4] changed: [node3]

TASK [prepare/base : 重新启动 cron 避免因修改时区而导致的作业错乱问题] **** changed: [node1] changed: [node2] changed: [node3] changed: [node4]

TASK [prepare/container-engine : 判断 Docker 是否早已安装] *** changed: [node2] changed: [node1] changed: [node3] changed: [node4]

TASK [prepare/container-engine : 判断 containerd 是否早已安装] *** changed: [node2] changed: [node3] changed: [node1] changed: [node4] included: /etc/ansible/roles/prepare/container-engine/tasks/containerd/main.yml for node1, node2, node3, node4 included: /etc/ansible/roles/prepare/container-engine/tasks/containerd/debian.yml for node1, node2, node3, node4

TASK [prepare/container-engine : 生成 Docker GPG 公钥] *** changed: [node1] changed: [node2] changed: [node3] changed: [node4]

TASK [prepare/container-engine : 添加 Docker GPG 公钥] *** changed: [node2] changed: [node4] changed: [node1] changed: [node3]

TASK [prepare/container-engine : 添加 Docker apt 仓库] *** fatal: [node1]: FAILED! => {"changed": false, "msg": "Failed to update apt cache: unknown reason"} fatal: [node3]: FAILED! => {"changed": false, "msg": "Failed to update apt cache: unknown reason"} fatal: [node2]: FAILED! => {"changed": false, "msg": "Failed to update apt cache: unknown reason"} fatal: [node4]: FAILED! => {"changed": false, "msg": "Failed to update apt cache: unknown reason"}

NO MORE HOSTS LEFT ***

PLAY RECAP *** node1 : ok=52 changed=23 unreachable=0 failed=1 skipped=17 rescued=0 ignored=0 node2 : ok=45 changed=23 unreachable=0 failed=1 skipped=13 rescued=0 ignored=0 node3 : ok=45 changed=23 unreachable=0 failed=1 skipped=13 rescued=0 ignored=0 node4 : ok=42 changed=23 unreachable=0 failed=1 skipped=16 rescued=0 ignored=0

安装ubuntu基础软件与添加docker GPG公钥有较长等待

TimeBye commented 1 year ago

已支持,请查看离线安装文档