Fantastic Settings and Where to Find Them

draft

#1

It can be difficult to understand how to see how Juju has made its decisions. There are several commands that affect Juju’s behaviour, each with a different scope. Each command controls dozens of settings. This post aims to simplify navigating this.

Juju has lots of knobs to adjust. Almost every option has a bug report (or several) attached to them. Juju is a system that has implemented functionality in response to user requests.

Terminology

Constraints affect which machine is provisioned. They’re constraints on the shape of the machine that are provisioned. The smallest instance type that satisfies the constraints is chosen.

Configuration affects everything else. Configuration options affect Juju’s behaviour, outside of selecting machines to provision.

Additionally, you may also see series options as command-line arguments for a few commands. They affect the operating system that’s deployed to the newly provisioned machine and behave as a configuration option.

Precedence Rules

Highest position wins.

Constraints

  • command-line options (--constraints)
  • application constraints
  • model constraints

Configuration

  • command-line options (--config)
  • application config
  • model config, which is initially set by
  • model defaults

Types of Settings

Bootstrap Constraints

juju bootstrap --bootstrap-constraints --bootstrap-series

The bootstrap process deploys the Juju controller onto a newly provisioned machine on a cloud. Bootstrap constraints only affect the machine that the Juju controller is deployed to.

Application Constraints

get-constraints
set-constraints

Users can define constraints to apply whenever a unit of an application is deployed.

Application constraints are combined with model constraints to determine which instance is provisioned.

Where model and application constraints overlap, the application constraints take precedence.

Model Constraints

get-model-constraints
set-model-constraints 

Model constraints affect all machines that are created within the model, irrespective which charm is being deployed or application being added to.

They work with application constraints to determine which instance type to provision.

Model Defaults

juju model-defaults

Model defaults specify the model config settings that will be used for any future models.

Model Config

juju model-config

Model-level configuration settings affect anything under the model’s control.

Application Config

juju model-config

Application-level configuration settings affect any new models within the application.

Further Reading

Documentation

Community Advice on Using Juju in Production


Using model-config key: cloudinit-userdata
#2

@timClicks, in the topic of constraints, perhaps it is handy to note the special case for LXD and Kubernetes? Using constraints | Juju


#3

That’s an excellent point. I will take some time to expand this out.