Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
addyess committed Jan 16, 2025
1 parent a69b722 commit 09759c9
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions docs/src/charm/howto/install/install-terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,35 +36,33 @@ Example `main.tf`:
```hcl
provider "juju" {}
resource "juju_model" "this" {
name = "juju-myk8s" # name of the juju model
resource "juju_model" "my_model" {
name = "juju-myk8s"
}
variable "k8s" {
description = "K8s deployment shared configuration"
channel = string
default = "1.xx/stable"
type = string
}
module "k8s" {
source = "git::https://github.com/canonical/k8s-operator//charms/worker/k8s/terraform?ref=main"
source = "git::https://github.com/canonical/k8s-operator//charms/worker/k8s/terraform?ref=main"
model = juju_model.this.name
model = juju_model.my_model.name
channel = var.k8s.channel
units = 3
}
module "k8s-worker" {
source = "git::https://github.com/canonical/k8s-operator//charms/worker/terraform?ref=main"
model = juju_model.this.name
source = "git::https://github.com/canonical/k8s-operator//charms/worker/terraform?ref=main"
model = juju_model.my_model.name
channel = var.k8s.channel
units = 2
}
```

```{note}
Please ensure that the root module references the correct source path for the `k8s` and `k8s-worker` modules.
Also, ensure you replace the k8s.channel with {{version}}/stable
```

Example `versions.tf`:
Expand Down Expand Up @@ -116,10 +114,18 @@ commands:

```bash
terraform init
export TF_VAR_channel=<charm channel>
terraform plan
terraform apply
```

```{note}
Make sure the deployment [channel] is set with:
&ensp;export TF_VAR_channel={{channel}}
```


The `terraform apply` command will deploy the k8s and k8s-worker charms to the
Juju model. Watch the deployment progress by running:

Expand All @@ -130,5 +136,6 @@ juju status --watch 5s
<!-- LINKS -->
[juju-provider-tf]: https://github.com/juju/terraform-provider-juju/
[auth]: https://registry.terraform.io/providers/juju/juju/latest/docs#authentication
[channel]: ../../explanation/channels.md
[terraform]: https://snapcraft.io/terraform

0 comments on commit 09759c9

Please sign in to comment.