1

I need to know what are the hardware requirements to deploy the charmed-kubernetes charm.

I tried unsuccessfully (installation never ends) on this configuration:

hardware: notebook with Intel i7 and 32Gb RAM

VM: three kvm vm with 8 processors and 8Gb RAM

Cloud: three node LXD cluster

Controlling workstation on which juju is run

All machines have Kubuntu 18.04. LXD is version 3.12 snap installed

I used the command

juju deploy charmed-kubernetes

After 3 hours the process never ended.

After a complete restart from the hardware I end up in this situation:

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:~$ 

And I see a countinous access to the hard disk.

In my past experience this indicates insufficient hardware to complete the installation.

So, what are the minimum hardware requirements to deploy charmed kubernetes?

  • LXD and the CDK, out of the box, does not work well together. Your best bet would probably be to try conjure-up which uses a modified app-profile with the needed permissions for writing to disk etc. source – user3499430 Jun 3 at 12:45
  • My first attempt was to use conjure-up; but it fails ending (after six hours) in a never ending installation. Tried also with kubuntu-core charm with the same results. – Mirto Busico Jun 3 at 13:35
2

1) Create KVM VM on a laptop and ssh into it

uvt-kvm create cdk-vm --cpu 6 --memory 10240 --disk 50
ssh ubuntu@192.168.122.19

2) On the VM:

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

3) Install LXD

sudo snap install lxd 

2019-07-17T16:09:50Z INFO Waiting for restart... lxd 3.14 from Canonical✓ installed

4) Install JUJU

sudo snap install juju --classic

juju 2.6.5 from Canonical✓ installed

5) Migrate LXD from deb packages + clean-up

sudo /snap/bin/lxd.migrate

=> Connecting to source server

=> Connecting to destination server

=> Running sanity checks

The source server is empty, no migration needed.

The migration is now complete and your containers should be back online.

Do you want to uninstall the old LXD (yes/no) [default=yes]?

All done. You may need to close your current shell and open a new one to have the "lxc" command work.

To migrate your existing client configuration, move ~/.config/lxc to ~/snap/lxd/current/.config/lxc

6) Init and set up LXD

/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, zfs) [default=zfs]: dir

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]: none

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]:

7) Bootsrap all together

juju bootstrap

Clouds

aws

aws-china

aws-gov

azure

azure-china

cloudsigma

google

joyent

localhost

oracle

oracle-classic

rackspace

Select a cloud [localhost]:

Enter a name for the Controller [localhost-localhost]:

Creating Juju controller "localhost-localhost" on localhost/localhost

Looking for packaged Juju agent version 2.6.5 for amd64

To configure your system to better support LXD containers, please see: https://github.com/lxc/lxd/blob/master/doc/production-setup.md Launching controller instance(s) on localhost/localhost... - juju-0c16b8-0 (arch=amd64)
Installing Juju agent on bootstrap instance Fetching Juju GUI 2.14.0 Waiting for address Attempting to connect to 10.42.215.113:22 Connected to 10.42.215.113 Running machine configuration script... Bootstrap agent now started Contacting Juju controller at 10.42.215.113 to verify accessibility... Bootstrap complete, controller "localhost-localhost" now is available Controller machines are in the "controller" model Initial model "default" added

8) Add model - to keep things clean

juju add-model cdk-114

Added 'cdk-114' model on localhost/localhost with credential 'localhost' for user 'admin'

9) edit profile for LXC

lxc profile edit juju-cdk-114

and replace it with:

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) Deploy CDK 1.14

juju deploy charmed-kubernetes-124

and after (insert time here) depending on your resources allocated:

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

You do not need to run this in a VM. If you deploy JUJU on your laptop/desktop + LXD the way I showed here, when you are done with testing, just delete the model. This will remove all applications and LXC containers created.

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.

I hope this will help.

  • 2
    Fantastic. Thanks a lot. I found the big difference: for LXD I used zfs as backend. Your explanation is very useful; I think it should be added to the documentation – Mirto Busico Jul 23 at 22:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.