我正在尝试使用具有单个主节点和 3 个工作节点的 kubespray 创建 Kubernetes 集群。我克隆了 github kubespray 存储库并从我的控制节点运行 ansible playbook 以形成集群。
我正在尝试以下命令:
ansible-playbook \
-i inventory/sample/hosts.ini \
cluster.yml \
--become \
--ask-become-pass
当我运行命令时,2 个工作节点获得最终状态正常。但是对于主节点,它显示失败并出现如下错误:
fatal: [mildevkub020]: FAILED! => {
"changed": false,
"msg": "error running kubectl (/usr/local/bin/kubectl apply
--force --filename=/etc/kubernetes/k8s-cluster-critical-pc.yml)
command (rc=1), out='', err='error: unable to recognize
\"/etc/kubernetes/k8s-cluster-critical-pc.yml\": Get
http://localhost:8080/api?timeout=32s: dial tcp 127.0.0.1:8080:
connect: connection refused\n'"
}
我正在为以下错误添加屏幕截图:
修改
我删除了旧的 kubespray 存储库,并从以下链接克隆了新的存储库,
https://github.com/kubernetes-sigs/kubespray.git
并更新了我的库存。但仍然得到同样的错误。当我为日志运行“journalctl”命令时,我得到如下信息:
Oct 15 09:56:17 mildevdcr01 kernel: NX (Execute Disable) protection: active
Oct 15 09:56:17 mildevdcr01 kernel: SMBIOS 2.4 present.
Oct 15 09:56:17 mildevdcr01 kernel: DMI: VMware, Inc. VMware Virtual
Platform/440BX Desktop Reference Platform, BIOS 6.00 09/22/2009
Oct 15 09:56:17 mildevdcr01 kernel: Hypervisor detected: VMware
Oct 15 09:56:17 mildevdcr01 kernel: Kernel/User page tables isolation: disabled
Oct 15 09:56:17 mildevdcr01 kernel: e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
Oct 15 09:56:17 mildevdcr01 kernel: e820: remove [mem 0x000a0000-0x000fffff] usable
Oct 15 09:56:17 mildevdcr01 kernel: AGP: No AGP bridge found
Oct 15 09:56:17 mildevdcr01 kernel: e820: last_pfn = 0x240000 max_arch_pfn = 0x400000000
Oct 15 09:56:17 mildevdcr01 kernel: MTRR default type: uncachable
Oct 15 09:56:17 mildevdcr01 kernel: MTRR fixed ranges enabled:
Oct 15 09:56:17 mildevdcr01 kernel: 00000-9FFFF write-back
Oct 15 09:56:17 mildevdcr01 kernel: A0000-BFFFF uncachable
Oct 15 09:56:17 mildevdcr01 kernel: C0000-CBFFF write-protect
错误 ,
fatal: [mildevkub020]: FAILED! => {"attempts": 10, "changed": false, "msg": "error running kubectl (/usr/local/bin/kubectl apply --force --filename=/etc/kubernetes/node-crb.yml) command (rc=1), out='', err='W1016 06:50:31.365172 22692 loader.go:223] Config not found: etc/kubernetes/admin.conf\nerror: unable to recognize \"/etc/kubernetes/node-crb.yml\": Get http://localhost:8080/api?timeout=32s: dial tcp 127.0.0.1:8080: connect: connection refused\n'"}