Ubuntu: Semantics of Containers, which is used to deploy service-units, are not clear



Question:

If we have a look at the status of a Juju environment we can see a set of machines and services. Within the services we can see a set of service-units.

environment: local  machines:    "0":      agent-state: started      agent-version: 1.18.1.1      dns-name: localhost      instance-id: localhost      series: trusty    "1":      agent-state: started      agent-version: 1.18.1.1      dns-name: 10.0.3.154      instance-id: atech-local-machine-1      series: trusty      hardware: arch=i386    services:    juju-gui:      charm: cs:trusty/juju-gui-3      exposed: true      units:        juju-gui/0:          agent-state: started          agent-version: 1.18.1.1          machine: "1"          open-ports:          - 80/tcp          - 443/tcp          public-address: 10.0.3.154    mysql:      charm: cs:precise/mysql-46      exposed: true      relations:        cluster:        - mysql      units:        mysql/0:          agent-state: pending          machine: "4"  

But https://jujucharms.com/docs/stable/charms-constraints says, there is a constraint called "container", which specify the container type that a service-unit must run inside. But the above status log does not show any container related details.

On the other hand, in https://jujucharms.com/docs/stable/authors-subordinate-services, it says "Service units are typically run in an isolated container on a machine with no knowledge or access to other services deployed onto the same machine".

Does this mean, when we creating new service-units, does Juju runtime create a new container within a existing machine and deploy the service-unit? or create a new container within a new machine and deploy the service-unit? or use a single container to deploy all the service units?


Solution:1

There are many different ways Juju can deploy a unit to a machine but by default it will deploy the unit onto the bare metal of a new instance. Depending on how you specify your deploy command Juju can deploy it:

  • onto the bare metal of the machine.
  • into a lxc container on the machine.
  • into a kvm container on the machine.
  • and on and on...

Specifically if you are looking for more information on deploying services into containers you should take a look at the docs here: https://jujucharms.com/docs/stable/charms-deploying#deploying-to-specific-machines-and-containers looking for the lines:

juju deploy mysql --to 24/lxc/3  juju deploy mysql --to lxc:25  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »