Skip to content

canonical/anbox-cloud-terraform

Repository files navigation

Anbox Cloud Terraform

Warning

This terraform plan is a work in progress and makes use of terraform-provider-juju which is in active development too. Please expect breaking changes (if required) in the future for the plan and the module.

This is a terraform plan to deploy anbox cloud using juju and terraform. The module uses terraform-provider-juju to deploy the anbox bundles to a bootstrapped juju cluster.

This plan uses terraform modules to deploy an anbox subcluster and a control plane for Anbox Cloud into two separate juju models. The subclusters can be scaled up and down according to the requirements. The two terraform modules expose the required attributes as outputs to be used to connect apps across the two juju models using cross model relations.

Requirements

Name Version
terraform ~> 1.6
juju ~> 0.19.0

Providers

Name Version
juju 0.19.0

Modules

Name Source Version
controller ./modules/controller n/a
registry ./modules/registry n/a
subcluster ./modules/subcluster n/a

Resources

Name Type
juju_integration.agent_nats_cmr resource
juju_integration.dashboard_ams_cmr resource

Inputs

Name Description Type Default Required
anbox_channel Channel to deploy anbox cloud charms from. string n/a yes
constraints List of constraints that need to be applied to applications. Each constraint must be of format <constraint_name>=<constraint_value> list(string) [] no
deploy_registry Deploy the Anbox Application Registry bool false no
enable_cos Enable cos integration by deploying grafana-agent charm. bool false no
enable_ha Enable HA mode for anbox cloud bool false no
ssh_key_path Path to the SSH key to be imported in the juju models. No key is imported by default. string "" no
subclusters List of subclusters to deploy.
list(object({
name = string
lxd_node_count = number
registry = optional(object({
mode = optional(string)
}))
}))
[] no

Outputs

Name Description
anbox_models Name of the models created for Anbox Cloud

Usage

The module can deploy a number of anbox subclusters per juju region using the variable var.subclusters_per_region. To execute the terraform plan:

Note: You need to have juju controller bootstrapped and a juju client configured on your local system to be able to use the plan.

  • Create a file called anbox.tfvars and set the values for the variables e.g
ubuntu_pro_token = "<pro_token_here>"
anbox_channel    = "1.26/edge"
subclusters = [
  {
    name           = "a"
    lxd_node_count = 1
    registry = {
      mode = "client"
    }
  }
]
ssh_key_path = "~/.ssh/id_rsa.pub"
deploy_registry = true
enable_ha = false
enable_cos = false
constraints = [ "arch=arm64" ]
  • Initialise the terraform directory
terraform init
  • Create a terraform plan using
terraform plan -out=tfplan -var-file=anbox.tfvars
  • Apply the terraform plan using
terraform apply tfplan

Known Issues

  • COS Support: This plan does not create integrations for the grafana agent charm. This is because the Juju Terraform provider does not support cross-controller model relations.
  • var.constraints may not work properly and needs to be specified to keep terraform consistent even when default constraints are being filled by Juju. #344, #632
  • The plan might see failures from juju when running terraform with default parallelism. It is recommended to run terraform with -parallelism=1 for most consistent results.

Contributing

Generate Docs

This repository uses terraform docs to generate the docs. To generate docs run:

./scripts/generate-docs.sh

About

Terraform plans for Anbox Cloud

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •