Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix up constraints to be used during bootstrap #2339

Merged
merged 1 commit into from
Dec 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 20 additions & 19 deletions src/en/charms-constraints.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,26 +75,23 @@ In the event that a constraint cannot be met, the unit will not be deployed.

!!! Note:
Constraints work on an "or better" basis: If you ask for 4 CPUs, you
may get 8, but you won't get 2
may get 8, but you won't get 2.

## Setting constraints for a controller

Constraints can be applied to a controller during its creation
(`juju bootstrap` command) by using the `--bootstrap-constraints` option. See
[Creating a controller][controllers-creating] for details and examples.


## Using constraints when creating a controller
## Setting default model constraints

A controller is created using the `bootstrap` command, which accepts a
'--constraints' switch to specify which machine to use. When you create the
controller with constraints, the same constraints apply to each subsequent
machine created, so setting constraints on the controller is the same as making
global constraints. These can of course be overriden by constraints at the
model, application or machine level as detailed below.
Default model constraints can be set during the controller-creation process by
using the `--constraints` option (with the `juju bootstrap` command). See
[Creating a controller][controllers-creating] for more information on how to do
this.

Example:

Creating a new AWS controller to use a particular amount of memory:

```bash
juju bootstrap aws mycloud --constraints mem=4G
```
Default model constraints can be overridden for specific models, applications,
or machines, as detailed below.

## Setting constraints for a model

Expand All @@ -111,8 +108,8 @@ least 4 gigabytes of memory. You can check the current constraints with:
juju get-model-constraints
```

As with similar commands, you can 'unset' the constraint by setting its value to
null:
As with similar commands, you can 'unset' the constraint by setting its value
to null:

```bash
juju set-model-constraints mem=
Expand All @@ -121,7 +118,6 @@ juju set-model-constraints mem=
Model-related constraints can also be overridden at the application and machine
level.


## Setting constraints for an application

Usually, constraints for an application are set at deploy time, by passing the
Expand Down Expand Up @@ -176,3 +172,8 @@ the '--to' placement switch -
Juju's knowledge of the available spaces on the underlying cloud may lag
behind recent changes. To force Juju to re-examine the spaces it can use,
you should run the command `juju reload-spaces`.


<!-- LINKS -->

[controllers-creating]: ./controllers-creating.html
12 changes: 6 additions & 6 deletions src/en/controllers-creating.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@ itself, are known as **model constraints**. These are set via the
known as **controller constraints** and are set by using the
`--bootstrap-constraints` option. The same values can be used by either type.

For more details on constraints, see [Constraints][constraints].
For general information on constraints, see [Constraints][constraints].

## Examples

### Set minimum specifications for all machines in a controller's models
### Set default model constraints for a given controller

Below, all machines in the LXD controller's models will have at
least 4GiB of memory:
Below, all machines in the LXD controller's models will have at least 4GiB of
memory:

```bash
juju bootstrap --constraints="mem=4G" localhost
```

### Set minimum specifications for a new controller
### Set controller constraints for a new controller

This example shows how to request at least 4GiB of memory and two CPUs for a
This example shows how to request at least 4GiB of memory and two CPUs for an
AWS controller:

```bash
Expand Down