Skip to content

Commit 06a82d2

Browse files
Peter Matulisevilnick
authored andcommitted
add constraints to models.md page (juju#1245)
1 parent 0721416 commit 06a82d2

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

src/en/charms-constraints.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Title: Constraints
22

3+
34
# Constraints
45

56
Constraints allow you to choose the hardware (or virtual hardware)
@@ -14,6 +15,7 @@ For more granularity, it is also possible to add a machine with specific
1415
constraints (`juju add-machine`) and then specify that machine when deploying
1516
applications ([see the documentation on `juju deploy`](./charms-deploying.html)).
1617

18+
1719
## What constraints can be used?
1820

1921
There is a full list of the constraints used
@@ -74,7 +76,7 @@ juju deploy mariadb --constraints mem=4G cpu-cores=
7476

7577
In the event that a constraint cannot be met, the unit will not be deployed.
7678

77-
!!!Note: Constraints work on an "or better" basis: If you ask for 4 CPUs, you
79+
!!! Note: Constraints work on an "or better" basis: If you ask for 4 CPUs, you
7880
may get 8, but you won't get 2
7981

8082

@@ -121,6 +123,7 @@ juju set-model-constraints mem=
121123
Model-related constraints can also be overridden at the application and machine
122124
level.
123125

126+
124127
## Setting constraints for an application
125128

126129
Usually, constraints for an application are set at deploy time, by passing the
@@ -153,6 +156,7 @@ juju get-constraints mariadb
153156
juju get-constraints database1
154157
```
155158

159+
156160
## Adding a machine with constraints
157161

158162
The `juju add-machine` command also accepts the '--constraints' flag, which can
@@ -168,4 +172,3 @@ Will provision a machine that is connected to both the 'storage' and 'db'
168172
network spaces. You can subsequently deploy applications to this machine using
169173
the '--to' placement switch -
170174
[see the documentation on deploying charms](./charms-deploying.html)
171-

src/en/models.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,19 @@ Common model management tasks are summarized below.
6262
stipulated.
6363

6464
This is a complex subject. See [Model configuration](./models-config.html).
65+
66+
67+
68+
^# Set constraints for a model
69+
70+
Charm constraints can be managed at the model level. This will affect all
71+
charms used in the model unless overridden by constraints set at the
72+
application level. Constraints are used to select minimum requirements for any
73+
future machines Juju may create. For instance, a constraint may be set so that
74+
machines have a minimum amount of disk space on their root drive.
75+
76+
This is a complex subject. See
77+
[Constraints](./charms-constraints.html#setting-constraints-for-a-model).
6578

6679

6780

0 commit comments

Comments
 (0)