juju charmed-kubernetes - 最低硬件要求是什么?

juju charmed-kubernetes - 最低硬件要求是什么?

我需要知道部署 charmed-kubernetes charm 的硬件要求是什么。

我尝试了以下配置,但没有成功(安装从未结束):

硬件:配备 Intel i7 和 32GB RAM 的笔记本电脑

VM:三个 kvm vm,配备 8 个处理器和 8Gb RAM

云:三节点 LXD 集群

控制运行 juju 的工作站

所有机器都安装了 Kubuntu 18.04。LXD 是 3.12 版

我使用了命令

juju deploy charmed-kubernetes

三个小时过去了,这个过程仍未结束。

从硬件完全重启后,我遇到了这种情况:

Model    Controller          Cloud/Region        Version  SLA          Timestamp
default  lxd-remote-default  lxd-remote/default  2.6.2    unsupported  10:50:30+02:00

App                    Version  Status   Scale  Charm                  Store       Rev  OS      Notes
easyrsa                3.0.1    active     0/1  easyrsa                jujucharms  248  ubuntu  
etcd                   3.2.10   active       3  etcd                   jujucharms  426  ubuntu  
flannel                0.10.0   active     1/3  flannel                jujucharms  417  ubuntu  
kubeapi-load-balancer  1.14.0   active     0/1  kubeapi-load-balancer  jujucharms  642  ubuntu  exposed
kubernetes-master      1.14.2   waiting    1/2  kubernetes-master      jujucharms  678  ubuntu  
kubernetes-worker      1.14.2   waiting    2/3  kubernetes-worker      jujucharms  536  ubuntu  exposed

Unit                     Workload     Agent      Machine  Public address  Ports     Message
easyrsa/0                unknown      lost       0        240.12.0.59               agent lost, see 'juju show-status-log easyrsa/0'
etcd/0                   active       idle       1        240.13.0.77     2379/tcp  Healthy with 3 known peers
etcd/1*                  active       idle       2        240.11.0.3      2379/tcp  Errored with 0 known peers
etcd/2                   active       idle       3        240.11.0.51     2379/tcp  Errored with 0 known peers
kubeapi-load-balancer/0  unknown      lost       4        240.12.0.125    443/tcp   agent lost, see 'juju show-status-log kubeapi-load-balancer/0'
kubernetes-master/0*     waiting      executing  5        240.13.0.62     6443/tcp  (leader-elected) Waiting for 6 kube-system pods to start
flannel/1*             active       idle                240.13.0.62               Flannel subnet 10.1.90.1/24
kubernetes-master/1      unknown      lost       6        240.12.0.115    6443/tcp  agent lost, see 'juju show-status-log kubernetes-master/1'
flannel/0              unknown      lost                240.12.0.115              agent lost, see 'juju show-status-log flannel/0'
kubernetes-worker/0*     maintenance  executing  7        240.13.0.144              (upgrade-charm) Checking resources
kubernetes-worker/1      maintenance  executing  8        240.13.0.82               (upgrade-charm) Checking resources
kubernetes-worker/2      unknown      lost       9        240.12.0.106              agent lost, see 'juju show-status-log kubernetes-worker/2'
flannel/2              unknown      lost                240.12.0.106              agent lost, see 'juju show-status-log flannel/2'

Machine  State    DNS           Inst id        Series  AZ  Message
0        down     240.12.0.59   juju-1627e9-0  bionic      Stopped
1        started  240.13.0.77   juju-1627e9-1  bionic      Running
2        started  240.11.0.3    juju-1627e9-2  bionic      Running
3        started  240.11.0.51   juju-1627e9-3  bionic      Running
4        down     240.12.0.125  juju-1627e9-4  bionic      Stopped
5        started  240.13.0.62   juju-1627e9-5  bionic      Running
6        down     240.12.0.115  juju-1627e9-6  bionic      Stopped
7        started  240.13.0.144  juju-1627e9-7  bionic      Running
8        started  240.13.0.82   juju-1627e9-8  bionic      Running
9        down     240.12.0.106  juju-1627e9-9  bionic      Stopped

sysop@kvmnode0:~$ 

我看到对硬盘的连续访问。

根据我过去的经验,这表明硬件不足以完成安装。

那么,部署 charmed kubernetes 的最低硬件要求是什么?

答案1

1)在笔记本电脑上创建 KVM VM 并通过 ssh 进入

uvt-kvm create cdk-vm --cpu 6 --memory 10240 --disk 50
ssh [email protected]

2)在虚拟机上:

sudo apt-get update; sudo apt-get upgrade -y; sudo apt-get autoclean; sudo apt-get autoremove -y;

3)安装 LXD

sudo snap install lxd 

2019-07-17T16:09:50Z INFO 正在等待重新启动...已安装 Canonical✓ 的 lxd 3.14

4)安装 JUJU

sudo snap install juju --classic

已安装来自 Canonical✓ 的 juju 2.6.5

5)从 deb 包迁移 LXD + 清理

sudo /snap/bin/lxd.migrate

=> 连接到源服务器

=> 正在连接到目标服务器

=> 运行健全性检查

源服务器是空的,不需要迁移。

迁移现已完成并且您的容器应该重新上线。

您是否要卸载旧的 LXD(是/否)[默认=是]?

全部完成。您可能需要关闭当前 shell 并打开一个新 shell 以使“lxc”命令正常工作。

要迁移现有的客户端配置,请将 ~/.config/lxc 移动到 ~/snap/lxd/current/.config/lxc

6)初始化并设置 LXD

/snap/bin/lxd init

您想使用 LXD 集群吗?(是/否)[默认=否]:

您是否要配置一个新的存储池?(是/否)[默认=是]:

新存储池的名称[default=default]:

要使用的存储后端的名称(btrfs、ceph、dir、lvm、zfs)[默认 = zfs]:目录

您想连接到 MAAS 服务器吗?(是/否)[默认=否]:

您想创建新的本地网络桥吗?(是/否)[默认=是]:

新的桥应该叫什么?[default=lxdbr0]:

应使用什么 IPv4 地址?(CIDR 子网表示法,“自动”或“无”)[默认=自动]:

应使用什么 IPv6 地址?(CIDR 子网表示法,“自动”或“无”)[默认=自动]:没有任何

您希望 LXD 通过网络使用吗?(是/否)[默认=否]:

您希望自动更新过时的缓存图像吗?(是/否)[默认=是]

您是否希望打印 YAML“lxd init”预设?(是/否)[默认=否]:

7)Bootrap 全部整合

juju bootstrap

亚马逊

aws-中国

aws-gov

天蓝色

azure-中国

云西格玛

谷歌

乔伊恩特

本地主机

神谕

oracle-经典

机架空间

选择云[localhost]:

输入控制器的名称 [localhost-localhost]:

在 localhost/localhost 上创建 Juju 控制器“localhost-localhost”

寻找适用于 amd64 的打包 Juju 代理版本 2.6.5

为了配置您的系统以更好地支持 LXD 容器,请参阅: https://github.com/lxc/lxd/blob/master/doc/production-setup.md 在 localhost/localhost 上启动控制器实例... - juju-0c16b8-0(arch=amd64)
在引导实例上安装 Juju 代理 获取 Juju GUI 2.14.0 等待地址 尝试连接到 10.42.215.113:22 已连接到 10.42.215.113 正在运行机器配置脚本...引导代理现已启动 联系 10.42.215.113 的 Juju 控制器以验证可访问性... 引导完成,控制器“localhost-localhost”现在可用 控制器机器处于“控制器”模型中 已添加初始模型“默认”

8)添加模型——保持整洁

juju add-model cdk-114

在 localhost/localhost 上为用户“admin”添加了“cdk-114”模型,并使用凭证“localhost”

9)编辑LXC的配置文件

lxc profile edit juju-cdk-114

并将其替换为:

config:
  boot.autostart: "true"
  linux.kernel_modules: ip_tables,ip6_tables,netlink_diag,nf_nat,overlay
  raw.lxc: |
    lxc.apparmor.profile=unconfined
    lxc.mount.auto=proc:rw sys:rw cgroup:rw
    lxc.cgroup.devices.allow=a
    lxc.cap.drop=
  security.nesting: "true"
  security.privileged: "true"
description: ""
devices:
  aadisable:
    path: /sys/module/nf_conntrack/parameters/hashsize
    source: /dev/null
    type: disk
  aadisable1:
    path: /sys/module/apparmor/parameters/enabled
    source: /dev/null
    type: disk
name: juju-cdk-114
used_by:[]

10)部署CDK 1.14

juju deploy charmed-kubernetes-124

之后(在此插入时间)取决于您分配的资源:

Model    Controller           Cloud/Region         Version  SLA          Timestamp
cdk-114  localhost-localhost  localhost/localhost  2.6.5    unsupported  17:25:52+01:00

App                    Version  Status  Scale  Charm                  Store       Rev  OS      Notes
easyrsa                3.0.1    active      1  easyrsa                jujucharms  253  ubuntu  
etcd                   3.2.10   active      3  etcd                   jujucharms  431  ubuntu  
flannel                0.10.0   active      5  flannel                jujucharms  424  ubuntu  
kubeapi-load-balancer  1.14.0   active      1  kubeapi-load-balancer  jujucharms  647  ubuntu  exposed
kubernetes-master      1.14.3   active      2  kubernetes-master      jujucharms  695  ubuntu  
kubernetes-worker      1.14.3   active      3  kubernetes-worker      jujucharms  549  ubuntu  exposed

Unit                      Workload  Agent  Machine  Public address  Ports           Message
easyrsa/0*                active    idle   0        10.54.179.170                   Certificate Authority connected.
etcd/0*                   active    idle   1        10.54.179.128   2379/tcp        Healthy with 3 known peers
etcd/1                    active    idle   2        10.54.179.106   2379/tcp        Healthy with 3 known peers
etcd/2                    active    idle   3        10.54.179.26    2379/tcp        Healthy with 3 known peers
kubeapi-load-balancer/0*  active    idle   4        10.54.179.93    443/tcp         Loadbalancer ready.
kubernetes-master/0*      active    idle   5        10.54.179.193   6443/tcp        Kubernetes master running.
  flannel/3*              active    idle            10.54.179.193                   Flannel subnet 10.1.2.1/24
kubernetes-master/1       active    idle   6        10.54.179.86    6443/tcp        Kubernetes master running.
  flannel/4               active    idle            10.54.179.86                    Flannel subnet 10.1.71.1/24
kubernetes-worker/0       active    idle   7        10.54.179.245   80/tcp,443/tcp  Kubernetes worker running.
  flannel/0               active    idle            10.54.179.245                   Flannel subnet 10.1.89.1/24
kubernetes-worker/1       active    idle   8        10.54.179.141   80/tcp,443/tcp  Kubernetes worker running.
  flannel/1               active    idle            10.54.179.141                   Flannel subnet 10.1.33.1/24
kubernetes-worker/2*      active    idle   9        10.54.179.230   80/tcp,443/tcp  Kubernetes worker running.
  flannel/2               active    idle            10.54.179.230                   Flannel subnet 10.1.91.1/24

您不需要在虚拟机中运行它。如果您按照我在此处展示的方式在笔记本电脑/台式机 + LXD 上部署 JUJU,则在完成测试后,只需删除模型即可。这将删除创建的所有应用程序和 LXC 容器。

juju destroy-model cdk-114
WARNING! This command will destroy the "cdk-114" model.
This includes all machines, applications, data and other resources.

Continue [y/N]? y
Destroying model
Waiting for model to be removed, 10 machine(s), 6 application(s)................
..
Waiting for model to be removed, 9 machine(s), 6 application(s).....
Waiting for model to be removed, 8 machine(s), 6 application(s)......
Waiting for model to be removed, 7 machine(s), 6 application(s).......
Waiting for model to be removed, 7 machine(s), 4 application(s)....
Waiting for model to be removed, 6 machine(s), 3 application(s)...
Waiting for model to be removed, 5 machine(s), 1 application(s)....
Waiting for model to be removed, 5 machine(s)...
Waiting for model to be removed, 4 machine(s).....
Waiting for model to be removed, 3 machine(s).........
Waiting for model to be removed, 1 machine(s)...
Waiting for model to be removed...
Model destroyed.

我希望这个能帮上忙。

相关内容