Skip to content

[terraform] Add k3s setup for tests #12794

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

Merged
merged 1 commit into from
Sep 27, 2022
Merged

[terraform] Add k3s setup for tests #12794

merged 1 commit into from
Sep 27, 2022

Conversation

nandajavarma
Copy link
Contributor

@nandajavarma nandajavarma commented Sep 9, 2022

Description

This PR adds a very rough single-cluster setup for k3s. We are adding this for consistency with Azure, AWS and GCP setups so we can consistently run the tests. We do not recommend users to use this because the underlying module still make use of k3sup and we have plans to move to k3s before suggesting this as a solution. Hence we have not included a Readme with this directory.

Related Issue(s)

Fixes #12866

How to test

  • Go to the directory install/infra/single-cluster/k3s.
  • Edit main.tf to have the right bucket name.
  • Edit terraform.tfvars to right parameters for the cluster.
    Then run:
make init
make plan
make apply
# After testing, make sure you cleanup with:
make destroy

Release Notes

NONE

Documentation

Werft options:

  • /werft with-preview

@nandajavarma nandajavarma force-pushed the nvn/azure-tf-mod branch 2 times, most recently from d249e8c to 8e1c991 Compare September 14, 2022 10:03
Base automatically changed from nvn/azure-tf-mod to main September 14, 2022 21:15
@roboquat roboquat added size/XXL and removed size/XL labels Sep 14, 2022
@nandajavarma nandajavarma marked this pull request as ready for review September 15, 2022 08:46
@nandajavarma nandajavarma requested a review from a team September 15, 2022 08:46
@github-actions github-actions bot added the team: delivery Issue belongs to the self-hosted team label Sep 15, 2022
@nandajavarma nandajavarma changed the base branch from main to nvn/gcp-use-ref-arch September 15, 2022 08:50
@nandajavarma nandajavarma changed the base branch from nvn/gcp-use-ref-arch to main September 15, 2022 10:40
@roboquat roboquat added size/XXL and removed size/XL labels Sep 15, 2022
@nandajavarma nandajavarma changed the base branch from main to nvn/gcp-use-ref-arch September 15, 2022 10:40
@roboquat roboquat added size/XL and removed size/XXL labels Sep 15, 2022
@github-actions github-actions bot added team: IDE team: devx team: webapp Issue belongs to the WebApp team team: workspace Issue belongs to the Workspace team labels Sep 16, 2022
@roboquat roboquat removed the size/XL label Sep 16, 2022
@nandajavarma nandajavarma changed the base branch from nvn/gcp-use-ref-arch to main September 16, 2022 14:07
@nandajavarma nandajavarma removed request for a team September 16, 2022 14:07
@github-actions
Copy link
Contributor

⚠️ Hey reviewer! BE CAREFUL ⚠️
Review the code before opening in your Gitpod. .gitpod.yml was changed and it might be harmful.

@easyCZ easyCZ removed the team: webapp Issue belongs to the WebApp team label Sep 20, 2022
@nandajavarma nandajavarma removed team: workspace Issue belongs to the Workspace team team: IDE team: devx labels Sep 22, 2022
Copy link
Contributor

@adrienthebo adrienthebo left a comment

Choose a reason for hiding this comment

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

Ack, didn't submit this review! Sorry for the delay!

The only major change is switching a couple of cases from var.credentials to local.credentials_path. Also it seems like switching these variables around to pass credentials as a variable while introducing credentials_path is incurring more pain than I expected; if it continues to hurt we can just revert that change and pass around a file path.

There's some touch ups we can land around make output but we can address that in another PR.

Since this has been taking longer to review/merge than I like I'm approving this now, amend as you see fit. Thanks for your patience!

/hold for above, merge at your discretion

Comment on lines +8 to +10
credentials = var.credentials_path
kubeconfig = var.kubeconfig
dns_sa_creds = var.credentials_path
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
credentials = var.credentials_path
kubeconfig = var.kubeconfig
dns_sa_creds = var.credentials_path
credentials = local.credentials
kubeconfig = var.kubeconfig
dns_sa_creds = local.credentials

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The k3s module expects the file path and not the JSON content itself. This change would break the module

@@ -0,0 +1,20 @@
terraform {
backend "gcs" {
Copy link
Contributor

Choose a reason for hiding this comment

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

thought: We should look into using terraform init -backend-config so that the GCS backend can be adjusted without having to amend a version controlled file.

No action needed.

@nandajavarma
Copy link
Contributor Author

/unhold

@roboquat roboquat merged commit ac6c5a3 into main Sep 27, 2022
@roboquat roboquat deleted the nvn/k3s-tf-mod branch September 27, 2022 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none size/XL team: delivery Issue belongs to the self-hosted team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[terraform] Move k3s module to reference architecture section
4 participants