在本地主机上安装 Ubuntu Kubernates 1.20 -> 文档导致错误 -> 等待 3 个 kube-system pod 启动

在本地主机上安装 Ubuntu Kubernates 1.20 -> 文档导致错误 -> 等待 3 个 kube-system pod 启动

我在 VirtualBox 上创建了全新的 Ubuntu 20.03,然后根据文档开始安装。机器有 Quadro RTX 卡(可能会有影响?)。

文档很乱,因为有很多方法可以做 - 无论我检查了几乎所有方法,结果都很糟糕,因为它从未成功过。你能帮忙安装吗?或者 Ubuntu Kubernetes 不起作用,这是在浪费时间?

是否需要额外的日志?

无效的文档导致此错误:

  1. https://ubuntu.com/kubernetes/install#multi-node
  2. https://ubuntu.com/kubernetes/docs/install-manual
  3. https://ubuntu.com/kubernetes/docs/install-local

首先我尝试:

sudo snap install lxd

sudo lxd init
# all default apart:
# dir
# ipv6 none

sudo snap install juju --classic
juju bootstrap localhost

juju add-model k8s
juju deploy charmed-kubernetes

结果是 10 台机器,却没有一台能正常工作的主机 :)

kubernetes-master/0*      waiting   idle   5        10.184.167.240  6443/tcp        Waiting for 3 kube-system pods to start
  containerd/2            active    idle            10.184.167.240                  Container runtime available
  flannel/2               active    idle            10.184.167.240                  Flannel subnet 10.1.1.1/24
kubernetes-master/1       waiting   idle   6        10.184.167.89   6443/tcp        Waiting for 3 kube-system pods to start
  containerd/3            active    idle            10.184.167.89                   Container runtime available
  flannel/3               active    idle            10.184.167.89                   Flannel subnet 10.1.43.1/24

完整状态为:

juju status --color
Model           Controller           Cloud/Region         Version  SLA          Timestamp
k8s-production  localhost-localhost  localhost/localhost  2.8.9    unsupported  17:00:24+01:00

App                    Version  Status   Scale  Charm                  Store       Rev  OS      Notes
containerd             1.3.3    active       5  containerd             jujucharms  102  ubuntu  
easyrsa                3.0.1    active       1  easyrsa                jujucharms  345  ubuntu  
etcd                   3.4.5    active       3  etcd                   jujucharms  553  ubuntu  
flannel                0.11.0   active       5  flannel                jujucharms  518  ubuntu  
kubeapi-load-balancer  1.18.0   active       1  kubeapi-load-balancer  jujucharms  757  ubuntu  exposed
kubernetes-master      1.20.4   waiting      2  kubernetes-master      jujucharms  955  ubuntu  
kubernetes-worker      1.20.4   active       3  kubernetes-worker      jujucharms  726  ubuntu  exposed

Unit                      Workload  Agent  Machine  Public address  Ports           Message
easyrsa/0*                active    idle   0        10.184.167.48                   Certificate Authority connected.
etcd/0*                   active    idle   1        10.184.167.23   2379/tcp        Healthy with 3 known peers
etcd/1                    active    idle   2        10.184.167.180  2379/tcp        Healthy with 3 known peers
etcd/2                    active    idle   3        10.184.167.194  2379/tcp        Healthy with 3 known peers
kubeapi-load-balancer/0*  active    idle   4        10.184.167.106  443/tcp         Loadbalancer ready.
kubernetes-master/0*      waiting   idle   5        10.184.167.240  6443/tcp        Waiting for 3 kube-system pods to start
  containerd/2            active    idle            10.184.167.240                  Container runtime available
  flannel/2               active    idle            10.184.167.240                  Flannel subnet 10.1.1.1/24
kubernetes-master/1       waiting   idle   6        10.184.167.89   6443/tcp        Waiting for 3 kube-system pods to start
  containerd/3            active    idle            10.184.167.89                   Container runtime available
  flannel/3               active    idle            10.184.167.89                   Flannel subnet 10.1.43.1/24
kubernetes-worker/0*      active    idle   7        10.184.167.52   80/tcp,443/tcp  Kubernetes worker running.
  containerd/0*           active    idle            10.184.167.52                   Container runtime available
  flannel/0*              active    idle            10.184.167.52                   Flannel subnet 10.1.20.1/24
kubernetes-worker/1       active    idle   8        10.184.167.226  80/tcp,443/tcp  Kubernetes worker running.
  containerd/4            active    idle            10.184.167.226                  Container runtime available
  flannel/4               active    idle            10.184.167.226                  Flannel subnet 10.1.6.1/24
kubernetes-worker/2       active    idle   9        10.184.167.158  80/tcp,443/tcp  Kubernetes worker running.
  containerd/1            active    idle            10.184.167.158                  Container runtime available
  flannel/1               active    idle            10.184.167.158                  Flannel subnet 10.1.12.1/24

Machine  State    DNS             Inst id        Series  AZ  Message
0        started  10.184.167.48   juju-c4f295-0  focal       Running
1        started  10.184.167.23   juju-c4f295-1  focal       Running
2        started  10.184.167.180  juju-c4f295-2  focal       Running
3        started  10.184.167.194  juju-c4f295-3  focal       Running
4        started  10.184.167.106  juju-c4f295-4  focal       Running
5        started  10.184.167.240  juju-c4f295-5  focal       Running
6        started  10.184.167.89   juju-c4f295-6  focal       Running
7        started  10.184.167.52   juju-c4f295-7  focal       Running
8        started  10.184.167.226  juju-c4f295-8  focal       Running
9        started  10.184.167.158  juju-c4f295-9  focal       Running

与文档中的其他排序相同,但都无济于事。也许我做错了什么,也许 Ubuntu Kubernetes 无法在本地主机上运行。

juju add-model k8s-production
juju deploy cs:bundle/charmed-kubernetes-596

即使这种小型部署也不起作用(安装永远不会结束)。

juju add-model k8s-development
juju deploy cs:bundle/kubernetes-core-1200

答案1

我觉得这是一个解决方法:

juju config kubernetes-worker kubelet-extra-config='{protectKernelDefaults: false}'

https://bugs.launchpad.net/charmed-kubernetes-bundles/+bug/1918160

相关内容