Skip to content

feat(terraform): Testing - #77

Draft
MichaelThamm wants to merge 2 commits into
feat/monolithic-option-2from
feat/monolithic-option-3
Draft

feat(terraform): Testing#77
MichaelThamm wants to merge 2 commits into
feat/monolithic-option-2from
feat/monolithic-option-3

Conversation

@MichaelThamm

@MichaelThamm MichaelThamm commented May 28, 2026

Copy link
Copy Markdown
Contributor

Issue

Solution

Context

Testing Instructions

Deploy a distributed mimir

terraform {
  required_providers {
    juju = {
      source  = "juju/juju"
      version = "~> 1.0"
    }
  }
}

resource "juju_model" "mimir" {
  name = "mimir-v2"
}

module "mimir" {
  source     = "git::https://github.com/canonical/mimir-operators//terraform?ref=feat/monolithic-option-3"
  model_uuid = juju_model.mimir.uuid
  channel    = "dev/edge"
  workers = {
    backend = { units = 1 }
    read    = { units = 1 }
    write   = { units = 1 }
  }
}

module "seaweedfs" {
  source     = "git::https://github.com/canonical/observability-stack//terraform/seaweedfs"
  model_uuid = juju_model.mimir.uuid
}

resource "juju_integration" "seaweedfs_mimir" {
  model_uuid = juju_model.mimir.uuid
  application {
    name     = module.seaweedfs.app_name
    endpoint = module.seaweedfs.provides.s3
  }
  application {
    name     = module.mimir.app_names.mimir_coordinator
    endpoint = module.mimir.requires.s3
  }
}

Apply complete! Resources: 10 added, 0 changed, 0 destroyed.

image

Update to monolithic mimir

module "mimir" {
  source     = "git::https://github.com/canonical/mimir-operators//terraform?ref=feat/monolithic-option-3"
  model_uuid = juju_model.mimir.uuid
  channel    = "dev/edge"
  workers = { all = { units = 1 } }
}

Apply complete! Resources: 2 added, 0 changed, 6 destroyed.

image

When s3_endpoint is provided, validation for integrations triggers, user needs to remove the seaweedfs integration to resolve the error

then add the s3 endpoint information (simulating microceph):

module "mimir" {
  source     = "git::https://github.com/canonical/mimir-operators//terraform?ref=feat/monolithic-option-3"
  model_uuid = juju_model.mimir.uuid
  channel    = "dev/edge"

  workers = { all = { units = 1 } }

  s3_endpoint   = "http://10.1.0.122:8333"
  s3_access_key = "placeholder"
  s3_secret_key = "placeholder"
}

but we get a client error because we have 2 integrations to an s3-integrator:

│ Error: Client Error
│ 
│   with module.mimir.juju_integration.coordinator_to_s3_integrator[0],
│   on .terraform/modules/mimir/terraform/main.tf line 84, in resource "juju_integration" "coordinator_to_s3_integrator":
│   84: resource "juju_integration" "coordinator_to_s3_integrator" {
│ 
│ Unable to create integration, got error: cannot add relation "mimir:s3
│ mimir-s3-integrator:s3-credentials": establishing a new relation for
│ mimir:s3 would exceed its maximum relation limit of 1 (quota limit
│ exceeded)

so we have to remove that integration in the root module:

-resource "juju_integration" "seaweedfs_mimir" {
-  model_uuid = juju_model.mimir.uuid
-  application {
-    name     = module.seaweedfs.app_name
-    endpoint = module.seaweedfs.provides.s3
-  }
-  application {
-    name     = module.mimir.app_names.mimir_coordinator
-    endpoint = module.mimir.requires.s3
-  }
-}

Apply complete! Resources: 4 added, 0 changed, 1 destroyed.

image

Upgrade Notes

Signed-off-by: Michael Thamm <mike.thamm@canonical.com>
@MichaelThamm MichaelThamm changed the title feat(terraform): unit tests feat(terraform): Testing Jun 1, 2026
Comment thread terraform/README.md

### External storage backend (no S3 integrator)

When using an external storage backend (e.g. SeaweedFS), omit the `s3_*` variables. The module will not deploy the S3 integrator, and you are responsible for integrating your storage with the coordinator's `s3` endpoint:

@mmkay mmkay Jun 1, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here it might be tricky which storage backend is external and which is internal. I think the difference is mostly in whether the storage backend supports the s3 interface or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants