#Juju in a few steps

I’m giving a try to juju now using xenial version (beta version). I have to say I was nicely impressed. They are actually working with containers (canonical lxd) and you can develop your charms really fast. Also, there’s an option that help you to create more replicas of the same app.

Juju also can work with VMs and Bare Metals (MAAS). Also, you have more apps to develop than other orchestration tool by far. Most of charms are working into the trusty version. Also, I’ve got some issues with some charms: I’ve tried with mediawiki and I’ve got a panic message. better try other version until this one for xenial stop being beta.

Enough said.

Installation steps

First install your ubuntu 16.04 server. I’ve made mine with 8GB memory and 4 vcpus.
Sadly, this version called xenial didn’t work with my cloud-init scripts. Then, I had to modify the image file with guestfish

After a while changing ip addresses, adding dns/gateway and adding my ssh keys. I’ve switch over the installation.

sudo apt update
sudo apt install juju zfsutils-linux
newgrp lxd
lxd init

I’ve got this error message:

root@juju01:~# juju bootstrap controller localhost
Creating Juju controller "controller" on localhost/localhost
Bootstrapping model "controller"
Starting new instance for initial controller
Launching instance
ERROR failed to bootstrap model: cannot start bootstrap instance: unable to get LXD image for ubuntu-xenial: The requested image couldn't be found.

Then, I’ve made my own ubuntu-xenial image

lxc image copy ubuntu:16.04 local: --alias ubuntu-xenial

Check this out

root@juju01:~# lxc image list
+-----------------+--------------+--------+---------------------------------------------+--------+----------+-----------------------------+
|      ALIAS      | FINGERPRINT  | PUBLIC |                 DESCRIPTION                 |  ARCH  |   SIZE   |         UPLOAD DATE         |
+-----------------+--------------+--------+---------------------------------------------+--------+----------+-----------------------------+
| xenial (1 more) | 74a491804877 | no     | ubuntu 16.04 LTS amd64 (release) (20160830) | x86_64 | 176.72MB | Sep 1, 2016 at 3:01pm (UTC) |
+-----------------+--------------+--------+---------------------------------------------+--------+----------+-----------------------------+

Try again

root@juju01:~# juju bootstrap controller localhost
Creating Juju controller "controller" on localhost/localhost
Bootstrapping model "controller"
Starting new instance for initial controller
Launching instance
 - juju-bf0048-0d      
Installing Juju agent on bootstrap instance
### success! removing some boring lines
Bootstrap complete, controller now available.
root@juju01:~# juju list-controllers 
CONTROLLER   MODEL    USER         CLOUD/REGION
controller*  default  admin@local  localhost/localhost

root@juju01:~# juju switch
controller:admin@local/default

Launching some Apps

I launched a couple of apps: mariadb and haproxy

root@juju01:~# juju deploy mariadb
Added charm "cs:trusty/mariadb-3" to the model.
Deploying charm "cs:trusty/mariadb-3" with the default charm metadata series "trusty".
root@juju01:~# juju deploy haproxy
Added charm "cs:trusty/haproxy-19" to the model.
Deploying charm "cs:trusty/haproxy-19" with the default charm metadata series "trusty".
root@juju01:~# lxc list
+---------------+---------+----------------------+-----------------------------------------------+------------+-----------+
|     NAME      |  STATE  |         IPV4         |                     IPV6                      |    TYPE    | SNAPSHOTS |
+---------------+---------+----------------------+-----------------------------------------------+------------+-----------+
| juju-40ebd2-0 | RUNNING | 10.10.187.129 (eth0) | fd33:2821:ffee:9ecd:216:3eff:fe15:196f (eth0) | PERSISTENT | 0         |
+---------------+---------+----------------------+-----------------------------------------------+------------+-----------+
| juju-cd7cd2-0 | RUNNING | 10.10.187.187 (eth0) | fd33:2821:ffee:9ecd:216:3eff:fec6:100f (eth0) | PERSISTENT | 0         |
+---------------+---------+----------------------+-----------------------------------------------+------------+-----------+
| juju-cd7cd2-1 | RUNNING | 10.10.187.227 (eth0) | fd33:2821:ffee:9ecd:216:3eff:fe6e:4126 (eth0) | PERSISTENT | 0         |
+---------------+---------+----------------------+-----------------------------------------------+------------+-----------+
root@juju01:~# juju status
MODEL    CONTROLLER  CLOUD/REGION         VERSION
default  lxd-test    localhost/localhost  2.0-beta15

APP      VERSION  STATUS   EXPOSED  ORIGIN      CHARM    REV  OS
haproxy           unknown  false    jujucharms  haproxy  19   ubuntu
mariadb           unknown  false    jujucharms  mariadb  3    ubuntu

RELATION  PROVIDES  CONSUMES  TYPE
peer      haproxy   haproxy   peer
cluster   mariadb   mariadb   peer

UNIT       WORKLOAD  AGENT       MACHINE  PUBLIC-ADDRESS                          PORTS  MESSAGE
haproxy/0  unknown   allocating  1        10.10.187.227                                  Waiting for agent initialization to finish
mariadb/0  unknown   allocating  0        fd33:2821:ffee:9ecd:216:3eff:fec6:100f         Waiting for agent initialization to finish

MACHINE  STATE    DNS                                     INS-ID         SERIES  AZ
0        pending  fd33:2821:ffee:9ecd:216:3eff:fec6:100f  juju-cd7cd2-0  trusty  
1        pending  10.10.187.227                           juju-cd7cd2-1  trusty  

I’ve removed them later

root@juju01:~# juju remove-application mariadb
root@juju01:~# juju remove-application haproxy
root@juju01:~# juju status
MODEL    CONTROLLER  CLOUD/REGION         VERSION
default  lxd-test    localhost/localhost  2.0-beta15

APP      VERSION  STATUS       EXPOSED  ORIGIN      CHARM    REV  OS
haproxy           unknown      false    jujucharms  haproxy  19   ubuntu
mariadb           maintenance  false    jujucharms  mariadb  3    ubuntu

UNIT       WORKLOAD     AGENT      MACHINE  PUBLIC-ADDRESS                          PORTS  MESSAGE
haproxy/0  unknown      idle       1        10.10.187.227                                  
mariadb/0  maintenance  executing  0        fd33:2821:ffee:9ecd:216:3eff:fec6:100f         (stop) cleaning up prior to charm deletion

MACHINE  STATE    DNS                                     INS-ID         SERIES  AZ
0        started  fd33:2821:ffee:9ecd:216:3eff:fec6:100f  juju-cd7cd2-0  trusty  
1        started  10.10.187.227                           juju-cd7cd2-1  trusty  

root@juju01:~# juju status
MODEL    CONTROLLER  CLOUD/REGION         VERSION
default  lxd-test    localhost/localhost  2.0-beta15

APP  VERSION  STATUS  EXPOSED  ORIGIN  CHARM  REV  OS

UNIT  WORKLOAD  AGENT  MACHINE  PUBLIC-ADDRESS  PORTS  MESSAGE

MACHINE  STATE    DNS                                     INS-ID         SERIES  AZ
0        stopped  fd33:2821:ffee:9ecd:216:3eff:fec6:100f  juju-cd7cd2-0  trusty  
1        started  10.10.187.227                           juju-cd7cd2-1  trusty  

See ya!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s