Doc: Update cos-lite terraform with custom storage#256
Open
MoonC432 wants to merge 6 commits intocanonical:mainfrom
Open
Doc: Update cos-lite terraform with custom storage#256MoonC432 wants to merge 6 commits intocanonical:mainfrom
MoonC432 wants to merge 6 commits intocanonical:mainfrom
Conversation
sed-i
reviewed
Apr 16, 2026
Comment on lines
+197
to
+226
| ### Add cloud credentials | ||
| Reference your cloud and credentials in the base terraform plan. First, see what cloud and credentials are stored using: | ||
| ``` | ||
| $ juju clouds | ||
| $ juju credentials | ||
| ``` | ||
| For example: | ||
| ``` | ||
| Clouds available on the controller: | ||
| Cloud Regions Default Type | ||
| k8s-cloud 1 default k8s | ||
|
|
||
| Controller Credentials: | ||
| Cloud Credentials | ||
| k8s-cloud k8s-cloud | ||
| ``` | ||
| Add a `cloud` block and a `credential` reference in the main `cos-lite-microk8s-sandbox.tf` file within the `juju_model` resource: | ||
| ``` | ||
| resource "juju_model" "cos" { | ||
| name = "cos" | ||
| config = { logging-config = "<root>=WARNING; unit=DEBUG" } | ||
|
|
||
| # Add this block | ||
| cloud { | ||
| name = "k8s-cloud" | ||
| region = "default" | ||
| } | ||
| credential = "k8s-cloud" | ||
| } | ||
| ``` |
Contributor
There was a problem hiding this comment.
I think this could become its own how-to document under how-to/install-and-upgrade, referencing the provider doc:
| credential = "k8s-cloud" | ||
| } | ||
| ``` | ||
| ### Configure custom storage class |
Contributor
There was a problem hiding this comment.
This section and the next are also great how-tos.
Contributor
|
@copilot implement PR comments. |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the COS Lite MicroK8s + Terraform tutorial to document how to customize storage (storage class + PVC sizing) and how to explicitly set Juju cloud/credential details in the Terraform plan.
Changes:
- Added guidance for specifying
cloud/credentialon thejuju_modelresource. - Added instructions for setting a default storage class via
workload-storage. - Added examples and a reference table for per-application
storage_directivessizing.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: MoonC432 <67495015+MoonC432@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: MoonC432 <67495015+MoonC432@users.noreply.github.com>
Signed-off-by: MoonC432 <67495015+MoonC432@users.noreply.github.com>
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.
Issue
Added more information on customizing storage options when deploying cos-lite using terraform.
Solution
The changes were specifying global storage class for the PVCs, adding custom size for those PVCs and a table for quick reference regarding storage name for those
storage_directive. I also added a section to update cloud credentials to avoid targeting ghost clouds, potentially causing errors mid-deployment.Checklist
Context
I tested these configs locally and verified it in kubernetes. All PVCs reflected the correct configured storage class and sizes that were configured.
Testing Instructions
Simply go through the process top to bottom. Once its fully deployed, you can verify using:
Upgrade Notes