Juju Quick introduction
Juju is a open source, solution-driven orchestration tool from Ubuntu , juju help to model and deploy, maintain and scale various services to cloud or bare metal servers easily , using command line or graphical gui tool. you can use juju with ansible , puppet or chef .
Demo environment
1 . Juju host : if you are on ubuntu then its fine you can use localhost as your juju host , or if you are on mac , then use a new fresh vm as ubuntu host
2 . three virtual box fresh installed ubuntu
Installing Juju
In Ubuntu :
sudo add-apt-repository ppa:juju/stable
sudo apt-get update && sudo apt-get install juju-core
In Mac : use homebrew to install juju
brew install juju
Setting up juju manual environment
lets generate config
and switch to local environment
juju generate-config
juju switch manual
now config file is generated under ~/.juju/
directory with name environments.yaml
, this only configuration file that we are going to edit to configure our manual environment .
let’s bootstrap then environment
juju bootstrap
after successful bootstrap , you can run juju status
to see juju status , notice agent-state: started
line , it means juju is connected to stated and installed all the necessary packages and started the agent daemon successfully.
$ juju status
environment: manual
machines:
"0":
agent-state: started
agent-version: 1.24.3
dns-name: 192.168.0.107
instance-id: 'manual:'
series: trusty
hardware: arch=amd64 cpu-cores=1 mem=475M
state-server-member-status: has-vote
services: {}
Adding Machines
You can add machines by just using this juju add-machine
then ssh
followed by username
and IP address of machine . if you don’t provide username it will use your current username , or whatever you specified in environment.yaml
configuration file to use as default username .
Format :
juju add-machine ssh:[user@]<host>
adding machine
juju add-machine ssh:[email protected]
// Ensure all machines must be able to connect back to host and vice-versa
Installing GUI
after successfully adding new machine let’s deploy juju gui
charms to machine one . then I will show you how to add machines using nice gui
// You can pass any deployment related to juju without waiting to finish first command .
juju deploy juju-gui --to 1
juju expose juju-gui
notice --to 1
argument , its tells juju to deploy this charm to specifically on machine 1
, you can see all machine list using , juju status
.
you can access juju-gui by opening browser and point it to ip of machine 1
, and you can see password by looking at ~/.juju/environments/manual.jenv
file
cat ~/.juju/environments/manual.jenv | grep "password"
to see password , login using that password , default username is admin
You can checkout demo juju-gui interface , here : https://demo.jujucharms.com/
Now juju gui is deployed and ready to use , now you can use juju-gui to deploy services , in next post about juju I will show you how to deploy some other services in juju .