Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify the docs for installing via terraform #948

Merged
merged 3 commits into from
Jan 17, 2025

Conversation

addyess
Copy link
Contributor

@addyess addyess commented Jan 10, 2025

Overview

Ensure that the user provides a deployment channel for the charms rather than rely on a default in the charm modules.

Details

  • stop ignoring the channel field, and make the user provide one -- one that matches for both charms
  • source the tf modules from github rather than locally checked out modules
  • indicates one should run terraform plan before running apply

@addyess addyess requested a review from a team as a code owner January 10, 2025 22:00
Copy link
Contributor

@bschimke95 bschimke95 left a comment

Choose a reason for hiding this comment

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

LGTM, minor nit

docs/src/charm/howto/install-terraform.md Outdated Show resolved Hide resolved
Copy link
Contributor

@louiseschmidtgen louiseschmidtgen left a comment

Choose a reason for hiding this comment

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

Thanks for the improvement of my docs! Some questions here:

docs/src/charm/howto/install-terraform.md Outdated Show resolved Hide resolved
Comment on lines 43 to 46
variable "k8s" {
description = "K8s deployment shared configuration"
channel = string
default = "1.xx/stable"
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't quite like this variable declaration here. First it should be in an input file and second this should be closer to where it is set >> sub-module.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so, this channel likely should match both k8s and k8s-worker. We can eliminate this from the example if you think that's a good idea and have folks go read the individual tf modules to learn what variables are optional.

i was trying to use this variable as var.k8s.channel for both modules. Did i do this incorrectly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

another thing, i wish i could use {{channel}} here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@louiseschmidtgen did i close the gap here or are we still an open issue. I'm unsure how to resolve

Copy link
Contributor

@nhennigan nhennigan left a comment

Choose a reason for hiding this comment

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

From a docs perspective this looks fine. I'll let Louise give the final approval as the terraform expert

@addyess addyess force-pushed the KU-2416/simplify-terraform-install branch from cd3f75b to 3355e91 Compare January 15, 2025 14:09
Copy link
Contributor

@louiseschmidtgen louiseschmidtgen left a comment

Choose a reason for hiding this comment

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

A little tweak and then we should be good to go:

docs/src/charm/howto/install/install-terraform.md Outdated Show resolved Hide resolved
docs/src/charm/howto/install/install-terraform.md Outdated Show resolved Hide resolved
@addyess addyess force-pushed the KU-2416/simplify-terraform-install branch from 3355e91 to 09759c9 Compare January 16, 2025 18:35
Copy link
Contributor

@louiseschmidtgen louiseschmidtgen left a comment

Choose a reason for hiding this comment

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

Some final words, then we're good to go:

docs/src/charm/howto/install/install-terraform.md Outdated Show resolved Hide resolved
@@ -116,10 +114,18 @@ commands:

```bash
terraform init
export TF_VAR_channel=<charm channel>
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, this works!
We should also be able to do terraform apply -var k8s=1.xx/stable
Not sure which is the more terraformy way- you can choose.

@addyess addyess force-pushed the KU-2416/simplify-terraform-install branch from 3b4a3bb to 64ae3e0 Compare January 16, 2025 20:00
@addyess
Copy link
Contributor Author

addyess commented Jan 16, 2025

@louiseschmidtgen I included the charm relations as well. I'm glad I caught these before we released.

Here's a pb of the plan with these files specifically

@bschimke95 bschimke95 merged commit 32e3512 into main Jan 17, 2025
6 checks passed
@bschimke95 bschimke95 deleted the KU-2416/simplify-terraform-install branch January 17, 2025 08:40
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.

4 participants