A controller is the management node of a Juju cloud environment. It runs the API server and the underlying database. Its overall purpose is to keep state of all the models, applications, and machines in that environment. Although it is a special node, it is a machine that gets created by Juju and, in that sense, is similar to any other Juju machine.

During controller creation two models are also created, the ‘controller’ model and the ‘default’ model. Additional models may be added by the user very easily.

The minimum resources required for a controller are 3.5 GiB of memory and 1 vCPU.

Controller Management Tasks

Common controller management tasks are summarised below. The most important one is Creating a controller.

Back up a controller

Juju allows one to create, restore and manage backup files containing the controller configuration/metadata. If the controller or its host machine fails, it is possible to recreate the controller from the backup. See Controller backups for assistance.

Configure a controller

There are many settings available for configuring a controller, such as whether the controller will record auditing information. Controller configuration must be passed at controller-creation time, although some exceptions exist (i.e. some changes can be made after creation). This topic is covered in more depth in Configuring controllers.

Controller high availability

Each controller can be made highly available to add resilience to the operations of the controller itself. This topic is covered on the Controller high availability page.

Create a controller

The creation of a controller is a hallmark step in the setting up of a Juju environment. See Creating a controller for examples.

Destroy a controller

When a controller is destroyed all associated models and applications are also removed. It is a very destructive process.
See the Removing things for a full explanation.

Disable commands

A controller administrator can restrict what sorts of changes a user can make across the controller’s models. This topic is treated on the Disabling commands page.

List controllers

Use the controllers command to list all controllers known to the client. The currently active controller is indicated in the list with an asterisk(’*’).

Log in to a controller

A user can log in to a controller in various ways. See page Controller logins for details.

Show controller details

Use the show-controller command to show details for a controller. Information includes UUID, API endpoints, certificates, and bootstrap configuration.

Use the Juju GUI

Each controller creates a web GUI as an alternative method of management. The GUI is capable of deploying, scaling, and monitoring applications, as well as more advanced operations. More details can be found on the Juju GUI page.

As the juju controller occupies one machine all by itself and if redundancy is neede (which most certainly always is) 3 full machines are “lost” to juju, it would be beneficial to learn, how to conserve resources in different scenarios.

E.g., if I have a MAAS cloud with multiple regions, do I need a dedicated juju controller in each region, or can I make one work for all regions combined - makes quite a difference.

Also important for this scenario is, if juju controller only manages state and is therefore bandwidth extensive or if it acts as a sort of proxy for packages installed also, which would make the scenario above greatly depend on the bandwidth of the interconnection between regions.

One option is to use JAAS, which is a hosted controller provided for the Juju community. At this stage, no billing is associated with it.

I propose adding a short para to this page showing how to switch the active controller. Unlike the other paragraphs in this page, I don’t think it needs to include enough content that it’s worth linking to another page. We should just put the content here. Something like the following (Caveat: I’m just figuring this out myself, so feel free to override if this is inaccurate or a bad idea):

Switch active controller

If you have more than one controller, commands will act on the one that is currently active. juju switch will output the name of the active controller in the format <controller>:<user>/<model>, eg. “mycontroller:admin/default”. You can pass in a controller name to set the currently active controller, eg: juju switch mycontroller. The the passed controller name can be qualified with a user and model name, eg: juju switch mycontroller:admin/default. Discover the available controller, user and model names using juju controllers.