Juju
Last updated: Apr 22, 2020
IMAGE GALLERY (5)
What is juju?
Juju is an open source application modelling tool. It allows you to deploy, configure, scale and operate your software on public and private clouds1.
- juju charms like install node, django etc and connect to mongodb
- one charm to rule them all. Devops operations
- Configuration and deployment tool
- Juju by default stores its configuration and state locally in the
~/.local/share/juju
directory
Juju can be used locally2 using LXD.
Problem it solves?
How to connect new interfaces, services/instances when application is scaled up?
Juju excels at continue to upgrade the model once its deployed
- scaling application
- upgrading applications
- configuring applications while they are running
Things always change
Modelling software deployments?
Application is not a single server these days, its a plethora of interconnectedd services
- charm
- is a set of action and hooks
actions
are programshooks
are events and signals
Developers can simulate a production like real cloud instances/interconnected environment using lightweigt LXD
How does it work?
Juju also has a concept of Bundles. A Bundle is a portable specification for a model with charms, configuration, and relations all specified in a declarative YAML format
Relations and applications information os provided in YAML descriptor file
sudo snap install juju --edge --classic
fish_update_completions
juju whoami
juju list-controllers
# Initializes a cloud environment.
juju bootstrap
Specific Terminologies
- controller
- A Juju controller is the management node of a Juju cloud environment. It houses the database and keeps track of all the models in that environment.
juju bootstrap localhost lxd-local
juju controllers --refresh
juju whoami
juju deploy cs:bundle/mediawiki-single
juju status
juju destroy-model default
juju add-model default
juju gui --browser
juju deploy cs:bundle/openstack-base-61
Juju - WHy
- Documentation3
- Stop spending time on Configuration MAnagement - use prebuilt charms
- A software is stuff connected to other stuff
- Hosting Environment
- Machines
- Providers
- Clouds
- Juju Architecture
- Bundles
- Charmes
- Layers
- Client
- Controller
- Agents
- SOftware Medelling
- Applications
- Models
- Units
- Relations
The Juju controller will manage:
- Multiple models
- All VMs in all your running models
- Scale out, config and placement
- User accounts and identification
- Sharing and access
Charms
- Reactive Programming
- For example, in an imperative programming setting, {\displaystyle a:=b+c}a:=b+c would mean that {\displaystyle a}a is being assigned the result of {\displaystyle b+c}b+c in the instant the expression is evaluated, and later, the values of {\displaystyle b}b and {\displaystyle c}c can be changed with no effect on the value of {\displaystyle a}a. On the other hand, in reactive programming, the value of {\displaystyle a}a is automatically updated whenever the values of {\displaystyle b}b or {\displaystyle c}c change, without the program having to re-execute the statement {\displaystyle a:=b+c}a:=b+c to determine the presently assigned value of a
- deploy OS, event handling based interface management
- Bundles
- Charms
- Layers
charm layers
- built in layers, anologous to docker layers
- could be written in bash or python
charm build
- reactive framework
- juju
hooks
def install()
relationship
- juju
- Components of a charm
- Charm store
Relationships - Provides and Requires
charm create vanilla juju add-unit -n5 ubuntu # add 5 units juju deploy ubuntu mytestmachine1 juju deploy ubuntu mytestmachine2 juju add-model --verbose mediawiki juju deploy haproxy juju deploy my-web-app juju add-relation my-web-app:website haproxy:reverseproxy juju add-unit my-web-app juju destroy-model --verbose mediawiki juju switch avi-os
-
- Layer 4 or Layer 7 load balancing
- Algorithms
- Round robin
- Least connections *