LXD Projects

How does juju integrate with lxd projects?

Can I bootstrap juju into a particular lxd project and have my applications be installed there?

For example:

$ juju bootstrap --constraints="project=juju" localhost juju-controller 
ERROR unknown constraint "project"
$ juju bootstrap --constraints="lxd-project=juju" localhost juju-controller 
ERROR unknown constraint "lxd-project"

Hi,

I did some searching and dug up this PR.

It seems to suggest something like the following:

lxc project create juju
juju bootstrap localhost juju-controller --config "project=juju"
2 Likes

@tmihoc this seems to be missing from our LXD/Juju docs. Once we’ve confirmed it would probably be good to include this :slight_smile:

2 Likes

Indeed I searched through LXD/Juju docs and couldn’t find it.

About the LXD/Juju docs it should be noted the link for ‘Constraints and LXD containers’ is broken.

Seems I can’t bootstrap to a project?

image

@jnsgruk

Try config instead of constraints, as Jon’s reply states.

2 Likes

Oh, my bad! I will try again today!

“project” is config specific to LXD clouds. In my local config, this cloud is named localhost. You can find cloud specific config with the following command.

$ juju show-cloud localhost --include-config
Client cloud "localhost":

defined: built-in
type: lxd
description: LXD Container Hypervisor
auth-types: [certificate]
credential-count: 1
regions:
  localhost: {}

The available config options specific to lxd clouds are:
project:
  type: string
  description: The LXD project name to use for Juju's resources.

We have this in the docs too:

https://juju.is/docs/juju/list-of-model-configuration-keys#heading--cloud-specific-key