gpt4 book ai didi

kubernetes - 无法引导(云类型 : localhost) - Error when installing Kuberneters cluster locally with LXD/Conjure-up

转载 作者:行者123 更新时间:2023-12-03 04:37:14 26 4
gpt4 key购买 nike

使用 Ubuntu 18.04。

我正在尝试使用本指南(LXD + conjure-up kubernetes)在本地计算机(localhost)上安装 kubernetes 集群:

https://kubernetes.io/docs/getting-started-guides/ubuntu/local/#before-you-begin

当我运行时:

conjure-up kubernetes

我选择以下安装:

enter image description here

并为“选择云”选择localhost,并使用安装向导其余部分的默认值。然后开始安装,30-40 分钟后完成,并出现以下错误:

enter image description here

这是日志: https://pastebin.com/raw/re1UvrUU

其中一个错误显示:

2018-07-25 20:09:38,125 [ERROR] conjure-up/canonical-kubernetes - events.py:161 - Unhandled exception in <Task finished coro=<BaseBootstrapController.run() done, defined at /snap/conjure-up/1015/lib/python3.6/site-packages/conjureup/controllers/juju/bootstrap/common.py:15> exception=BootstrapError('Unable to bootstrap (cloud type: localhost)',)>

但这并没有多大帮助。

对于安装向导/conjure-up 失败的原因有什么建议吗?

同样基于这篇文章:

https://github.com/conjure-up/conjure-up/issues/1308

我尝试先禁用防火墙:

sudo ufw disable

然后重新运行安装/召唤安装向导。但我遇到了同样的错误。

有关我如何安装和配置 LXD/conjure-up 的更多详细信息如下:

$ snap install lxd
lxd 3.2 from 'canonical' installed
$ /snap/bin/lxd init
Would you like to use LXD clustering? (yes/no) [default=no]:
Do you want to configure a new storage pool? (yes/no) [default=yes]:
Name of the new storage pool [default=default]:
Name of the storage backend to use (btrfs, ceph, dir, lvm) [default=btrfs]:
Create a new BTRFS pool? (yes/no) [default=yes]:
Would you like to use an existing block device? (yes/no) [default=no]:
Size in GB of the new loop device (1GB minimum) [default=26GB]:
Would you like to connect to a MAAS server? (yes/no) [default=no]:
Would you like to create a new local network bridge? (yes/no) [default=yes]:
What should the new bridge be called? [default=lxdbr0]:
What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:
What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:
Would you like LXD to be available over the network? (yes/no) [default=no]:
Would you like stale cached images to be updated automatically? (yes/no) [default=yes]
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]:

配置的组成员身份:

sudo usermod -a -G lxd $USER
newgrp lxd

下一步安装:

sudo snap install conjure-up --classic

然后运行安装:

conjure-up kubernetes

最佳答案

我无法重现您的确切问题,但我安装了 conjure-up + lxd,最后在我新安装的 VirtualBox Ubuntu 18.04(桌面)上安装了 Kubernetes )虚拟机。希望这个答案能够对您有所帮助!

我浏览了 kubernetes.io 文档页面,其中缺少一点信息,它确实提到了 lxd 但没有提到 lxd init 部分,我假设你拾取于conjure-up user manual

话虽如此,我按照conjure-up用户手册进行了一些细微的更改。我假设您可以使用 conjure-up 的边缘版本,我一开始使用稳定版本,但在测试不同组合时更改为边缘版本。

此外,请确保您拥有 user manual 中规定的可用推荐资源。 、conjure-upKubernetes 的规范发行版 为您启动了许多容器。您可能不需要 3 个 etcd、3 个 worker 节点和 2 个 Master,并且如果您不只是调整容器的数量在conjure-up向导中向下。

这些是我执行的步骤(作为我的本地用户):

  1. 确保您的 Ubuntu 盒子已更新:sudo apt update && sudo apt update
  2. 通过运行以下命令安装 conjure-up:sudo snap install conjure-up --classic --edge
  3. 通过运行以下命令安装lxd:sudo snap install lxd
  4. 随着 lxd 而来的是客户端部分,即 lxc,如果您运行例如lxc list 您应该得到一个空表(尚未启动容器)。我此时遇到权限错误,我运行了以下命令:sudo chown -R lxd:lxd/var/snap/lxd/ 更改 lxd 的所有者和组包含您将使用 lxc 进行通信的套接字的目录。
  5. 将您的用户添加到 lxd 组:sudo usermod -a -G lxd $USER && newgrp lxd,注销并重新登录以使其永久而不仅仅是事件在您当前的 shell 中。
  6. 现在使用以下命令手动创建 lxd 网桥:lxc network create lxdbr1 ipv4.address=auto ipv4.nat=true ipv6.address=none ipv6.nat=false
  7. 现在让我们使用 lxd init 运行 lxd 的 init 部分。当被要求创建新的本地网桥时,请记住回答,在下一个提示中提供您新创建的网桥(lxdbr1 )。其余问题的答案可以保留默认。
  8. 现在继续运行 conjure-up kubernetes 并选择 localhost 作为您的类型。对我来说,localhost 选择从一开始就是灰色的,当我手动创建网桥而不是通过 lxd init 步骤时,它就起作用了。
  9. 跳过您可以安装的其他组件,例如 Rancher、Prometheus 等。
  10. 选择新的网桥和默认存储池,然后继续下一步。
  11. 在下一步中,根据需要自定义您的 Kubernetes 集群,然后点击“部署”。现在你就等着吧!

您始终可以排除故障并列出使用 lxc 工具创建的所有容器。如果您曾经使用过 Docker,那么 lxc 工具感觉很像 docker 客户端。

最后是一些想法和观察,正如您可能已经看到的,有很多的移动部件需要想象。它实际上被描述为:conjure-up 是一个涵盖几种不同底层技术的薄层 - Juju、MAAS 和 LXD。

作为引用,我最终安装了以下版本:

  • lxd 版本 3.3
  • 召唤版本2.6.1

关于kubernetes - 无法引导(云类型 : localhost) - Error when installing Kuberneters cluster locally with LXD/Conjure-up,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51525646/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com