feat(terraform): monolithic support - #75
Draft
MichaelThamm wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Caution
Since we are making breaking changes:
juju_applicationreference changes are serious because this will replace the app. We need to either implement amove { }if we want the state to move. However, this is not too serious because our users use S3 storage backends anywaysIssue
Solution
Summary
Replaces the three hardcoded worker modules (
mimir_backend,mimir_read,mimir_write) with a singlemodule.mimir_workerusingfor_eachover avar.workersmap. This enables both microservices and monolithic deployment modes from the same module interface.Motivation
role-all) with a single worker instead of threeUsage
Microservices (default, same as before):
Monolithic (single worker with all roles):
Breaking Changes
var.backend_name/var.read_name/var.write_namevar.workers.<role>.app_namevar.backend_config/var.read_config/var.write_configvar.workers.<role>.configvar.backend_units/var.read_units/var.write_unitsvar.workers.<role>.unitsvar.backend_worker_storage_directives/ etc.var.workers.<role>.storage_directivesvar.worker_constraintsvar.workers.<role>.constraintsmodule.mimir_backend/module.mimir_read/module.mimir_writemodule.mimir_worker["backend"]/["read"]/["write"]juju_integration.coordinator_to_backend/ etc.juju_integration.coordinator_to_worker["backend"]/ etc.State migration: Existing deployments will need to recreate worker resources. The Terraform state addresses change due to the
for_eachrefactor.Validations
["all", "backend", "read", "write"]"all"cannot coexist with other role keysUnchanged
var.worker_resourcesandvar.worker_revisionremain top-level (shared across all workers)provides/requiresoutputs unchangedapp_namesoutput now dynamically includes whichever workers are deployedContext
Testing Instructions
Upgrade Notes