Skip to content

Doc: Update cos-lite terraform with custom storage#256

Open
MoonC432 wants to merge 6 commits intocanonical:mainfrom
MoonC432:doc-cos-lite-terraform
Open

Doc: Update cos-lite terraform with custom storage#256
MoonC432 wants to merge 6 commits intocanonical:mainfrom
MoonC432:doc-cos-lite-terraform

Conversation

@MoonC432
Copy link
Copy Markdown
Contributor

@MoonC432 MoonC432 commented Apr 14, 2026

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

  • I have added or updated relevant documentation.
  • PR title makes an appropriate release note and follows conventional commits syntax.
  • Merge target is the correct branch, and relevant tandem backport PRs opened.

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:

kubectl get pvc -n cos

Upgrade Notes

Copy link
Copy Markdown
Contributor

@sed-i sed-i left a comment

Choose a reason for hiding this comment

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

Thanks @MoonC432 this is awesome!
Mainly requesting to refactor under how-to instead of tutorial.

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"
}
```
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.

I think this could become its own how-to document under how-to/install-and-upgrade, referencing the provider doc:

https://documentation.ubuntu.com/terraform-provider-juju/latest/howto/manage-clouds/#add-a-kubernetes-cloud

credential = "k8s-cloud"
}
```
### Configure custom storage class
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.

This section and the next are also great how-tos.

@sed-i
Copy link
Copy Markdown
Contributor

sed-i commented Apr 16, 2026

@copilot implement PR comments.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 / credential on the juju_model resource.
  • Added instructions for setting a default storage class via workload-storage.
  • Added examples and a reference table for per-application storage_directives sizing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/tutorial/cos-lite-microk8s-sandbox.md
Comment thread docs/tutorial/cos-lite-microk8s-sandbox.md Outdated
Comment thread docs/tutorial/cos-lite-microk8s-sandbox.md
Comment thread docs/tutorial/cos-lite-microk8s-sandbox.md Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: MoonC432 <67495015+MoonC432@users.noreply.github.com>
@MoonC432 MoonC432 requested a review from a team as a code owner April 16, 2026 20:12
MoonC432 and others added 2 commits April 16, 2026 16:14
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants