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

docs: add Terraform module #2560

Merged
merged 11 commits into from
Nov 16, 2023
Merged

docs: add Terraform module #2560

merged 11 commits into from
Nov 16, 2023

Conversation

elchead
Copy link
Contributor

@elchead elchead commented Nov 7, 2023

Still waiting for all TF modules to be merged and not sure yet about the exact release path. Is on hold until then.

Context

This adds user-facing docs on how to use the Terraform module.

Proposed change(s)

  • make image variable optional in high level CSP modules

Additional info

Checklist

  • Update docs
  • Add labels (e.g., for changelog category)
  • Is PR title adequate for changelog?
  • Link to Milestone

Copy link

netlify bot commented Nov 7, 2023

Deploy Preview for constellation-docs ready!

Name Link
🔨 Latest commit 9566552
🔍 Latest deploy log https://app.netlify.com/sites/constellation-docs/deploys/655636e2647fda000829f98c
😎 Deploy Preview https://deploy-preview-2560--constellation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@elchead elchead requested a review from m1ghtym0 November 7, 2023 14:53
@elchead elchead marked this pull request as ready for review November 7, 2023 14:56
@elchead elchead requested a review from thomasten as a code owner November 7, 2023 14:56
@elchead elchead force-pushed the doc/cli/terraform-module branch from 0d79aa2 to d436d28 Compare November 7, 2023 18:29
docs/sidebars.js Outdated Show resolved Hide resolved
docs/sidebars.js Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
@elchead elchead force-pushed the doc/cli/terraform-module branch 2 times, most recently from 5590366 to b01e13a Compare November 9, 2023 15:42
@elchead elchead requested review from thomasten and msanft November 9, 2023 15:45
@elchead elchead added the hold This cannot be merged right now label Nov 9, 2023
@m1ghtym0
Copy link
Member

Preview: https://deploy-preview-86--edgeless-docs.netlify.app/constellation/reference/terraform

@elchead
Copy link
Contributor Author

elchead commented Nov 10, 2023

Copy link
Member

@m1ghtym0 m1ghtym0 left a comment

Choose a reason for hiding this comment

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

Just from reading over everything, I'd say we could be a bit more elaborate on the steps. I'll test the module myself. Duo to vacation will only be able to do so in 2 weeks, if there is someone quicker than me @thomasten, please don't see this as a blocker.
Ideally someone with low terraform knowledge (like me) would do this as a rubber duck debugging.

docs/docs/workflows/create.md Show resolved Hide resolved
docs/docs/workflows/create.md Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
- `infrastructure/iam/{csp}`: contains the resources to set up IAM

## Cluster upgrades
Using the remote URL of the terraform-module zip as source, the instructions inside your `main.tf` file are as follows:
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand this sentence

Copy link
Contributor Author

Choose a reason for hiding this comment

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

tried to make it more clear

docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
Comment on lines 114 to 124
2. (Optional) Update the image version.

`image` is a mandatory field and needs to be updated to `$NEW_VERSION` to perform a node image upgrade.

3. (Optional) Update the Kubernetes version.

If `kubernetes_version` isn't set, the latest version default on the newer Constellation release will be used, which might imply a Kubernetes upgrade. If you want to avoid implicit upgrades, explicitly set the field. For the supported versions, refer to [Kubernetes support policy](../architecture/versions.md#kubernetes-support-policy).

#TODO should we add the info from /dev-docs/workflows/versions-support.md on the official page to provide info on image / microservice support too?

4. (Optional) Update the microservice version.

If `microservice_version` isn't set, the new version of the Constellation release will be used. This is a reasonable default, but you might want to prevent implicit upgrades by explicitly setting the field.
Copy link
Member

Choose a reason for hiding this comment

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

It's hard to understand for users when they should do what. For upgrading with the CLI, we just say that skipping one of these is only for "advanced users." Maybe we should limit this workflow to the default case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What's a good way to explain this fields then to the user since they are exposed as variables in the module. Should we add "ADVANCED USAGE:" to the description of the terraform variable to advise the user to not touch it?

Copy link
Member

Choose a reason for hiding this comment

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

We could add this hint to microservice_version.
For image, I'd just describe it as a non-optional step.
kubernetes_version might be easy enough to be understandable.

What do you think?
Did I forget something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moritz was against adding the hint. I went with limiting the workflow to the default case and removed the config steps.

Copy link
Contributor

Choose a reason for hiding this comment

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

In my opinion, we should not have such "hints" in the variable descriptions, as we currently don't have these in the config either, which could create uncertainty on what is "correct". We already say that there are defaults in the variable descriptions, which is enough in my opinion.

docs/docs/workflows/create.md Show resolved Hide resolved
docs/docs/workflows/create.md Show resolved Hide resolved
docs/docs/workflows/create.md Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
@elchead elchead force-pushed the doc/cli/terraform-module branch 2 times, most recently from 3b72eb6 to a9b275c Compare November 13, 2023 15:57
@elchead elchead requested a review from malt3 as a code owner November 13, 2023 15:57
@elchead elchead changed the base branch from main to feat/terraform/azure-tf-module November 13, 2023 15:58
@elchead elchead force-pushed the doc/cli/terraform-module branch 3 times, most recently from 2d79819 to c7228a8 Compare November 13, 2023 16:11
@elchead elchead requested review from thomasten and msanft November 13, 2023 16:11
@elchead elchead dismissed m1ghtym0’s stale review November 13, 2023 16:12

we need to address any other improvements in a future PR to not block the release

.github/workflows/release.yml Outdated Show resolved Hide resolved
@@ -266,7 +68,7 @@ management tooling of your choice. You need to keep the essential functionality

Make sure all necessary resources are created, e.g., through checking your CSP's portal and retrieve the necessary values, aligned with the outputs (specified in `outputs.tf`) of the base configuration.

Fill these outputs into the corresponding fields of the `constellation-state.yaml` file. For example, fill the IP or DNS name your cluster can be reached at into the `.Infrastructure.ClusterEndpoint` field.
Fill these outputs into the corresponding fields of the `Infrastructure` block inside the `constellation-state.yaml` file. For example, fill the IP or DNS name your cluster can be reached at into the `.Infrastructure.ClusterEndpoint` field.
Copy link
Contributor

Choose a reason for hiding this comment

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

Idea for making it less "handwavy":

Move the bash snippets from above here and say that they'll work for the default but have to be adjusted accordingly if the outputs are changed by the modifications made by the user. Just as an idea, does not have to be implemented here necessarily. We could keep track of it while linking this PR if we want to do it at some point though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tracked it in the docs ticket AB#3532

docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
@msanft msanft force-pushed the feat/terraform/azure-tf-module branch from d1debde to b85c11a Compare November 13, 2023 16:37
@elchead elchead force-pushed the doc/cli/terraform-module branch from 9aae855 to ddff944 Compare November 13, 2023 17:40
Base automatically changed from feat/terraform/azure-tf-module to main November 13, 2023 17:46
@elchead elchead force-pushed the doc/cli/terraform-module branch from c42f11d to 408fa83 Compare November 13, 2023 17:53
@elchead elchead force-pushed the doc/cli/terraform-module branch from 408fa83 to a983942 Compare November 13, 2023 18:04
@elchead elchead requested a review from msanft November 13, 2023 18:05
@elchead elchead removed the hold This cannot be merged right now label Nov 13, 2023
@elchead elchead added this to the v2.13.0 milestone Nov 13, 2023
@elchead elchead added the no changelog Change won't be listed in release changelog label Nov 13, 2023
Copy link
Contributor

@msanft msanft left a comment

Choose a reason for hiding this comment

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

2 small nits. Other than that, the content looks okay to me, under the premise of the follow-up ticket. Can't say much regarding wording, etc., which should probably be checked by @thomasten

docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
@elchead elchead requested review from thomasten and msanft November 14, 2023 09:58
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved

:::caution

The current module still relies on the Constellation CLI. Consequently, `terraform apply` creates files such as `constellation.conf.yaml`, `constellation-state.yaml` , `constellation-admin.conf`, `constellation-mastersecret.json` and a directory `constellation-terraform"` containing backups. Make sure to check in these files in your version control when using GitOps.
Copy link
Member

Choose a reason for hiding this comment

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

Do all of these files have to be kept?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, but most of them. constellation.conf.yaml could be reconstructed, but the rest contains cluster information from the apply command.

docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
docs/docs/workflows/terraform-module.md Outdated Show resolved Hide resolved
@elchead elchead force-pushed the doc/cli/terraform-module branch from 2e93c2e to 257ade0 Compare November 16, 2023 12:09

```
module "azure-constellation" {
source = "https://github.com/edgelesssys/constellation/releases/download/<version>/terraform-module.zip//terraform-module/azure-constellation" // insert Constellation version here.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
source = "https://github.com/edgelesssys/constellation/releases/download/<version>/terraform-module.zip//terraform-module/azure-constellation" // insert Constellation version here.
// replace <version> with a Constellation version, e.g., v2.13.0
source = "https://github.com/edgelesssys/constellation/releases/download/<version>/terraform-module.zip//terraform-module/azure-constellation"
  • The comment at the end of the line can easily be overlooked.
  • We should give a hint on the format of the version number.

@elchead elchead merged commit a88a731 into main Nov 16, 2023
5 of 6 checks passed
@elchead elchead deleted the doc/cli/terraform-module branch November 16, 2023 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog Change won't be listed in release changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants