Skip to content

chore: add terraform for spinning up load test cluster #7504

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 26 commits into from
May 15, 2023

Conversation

johnstcn
Copy link
Member

@johnstcn johnstcn commented May 11, 2023

Adds terraform configs for spinning up a load test cluster.

@johnstcn johnstcn self-assigned this May 11, 2023
@johnstcn johnstcn changed the title Cj/loadtest terraform chore: add terraform for spinning up load test cluster May 11, 2023
@johnstcn johnstcn force-pushed the cj/loadtest-terraform branch from a2d6b0e to dbcfc64 Compare May 12, 2023 10:35
@johnstcn johnstcn requested a review from spikecurtis May 12, 2023 15:06
@johnstcn johnstcn marked this pull request as ready for review May 12, 2023 15:06
Copy link
Contributor

@spikecurtis spikecurtis left a comment

Choose a reason for hiding this comment

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

some suggestions inline, including a lot of places where i think we can shorten names, but I don't feel extremely strongly about them.

I think at some point soon we're going to have to add support for licenses, but that doesn't need to block this PR.

}

resource "google_compute_subnetwork" "subnet" {
name = "${var.name}-subnet"
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
name = "${var.name}-subnet"
name = var.name

@@ -0,0 +1,39 @@
resource "google_compute_network" "vpc" {
project = var.project_id
name = "${var.name}-vpc"
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
name = "${var.name}-vpc"
name = var.name

-vpc is redundant


data "google_compute_global_address" "sql_peering" {
name = "sql-ip-address"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this used for? I don't see any references to it

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice spot, this is stale copy-pasta. Removed.

}

resource "google_sql_database_instance" "db" {
name = "${var.name}-db"
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
name = "${var.name}-db"
name = var.name


database_flags {
name = "max_connections"
value = "500"
Copy link
Contributor

Choose a reason for hiding this comment

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

experience from v1 scale testing makes me think this should be a variable


depends_on = [
google_container_cluster.primary
]
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this redundant given line 41?

}

resource "google_container_node_pool" "misc" {
name = "${var.name}-node-pool-misc"
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
name = "${var.name}-node-pool-misc"
name = "${var.name}-misc"

// These variables control the Coder deployment.
variable "coder_replicas" {
description = "Number of Coder replicas to provision"
default = 1
Copy link
Contributor

Choose a reason for hiding this comment

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

more than one basically requires Coder Enterprise license or tailnet coordination won't work

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point -- we could possibly use the trial license in this case as I don't see one of these instances being up for more than 30 days.

match_expressions {
key = "app.kubernetes.io/name"
operator = "In"
values = ["coder-workspace"]
Copy link
Contributor

Choose a reason for hiding this comment

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

generally workspaces >> nodes, so I'm not sure this affinity term helps us

resources {
requests = {
"cpu" = "0.1"
"memory" = "128Mi"
Copy link
Contributor

Choose a reason for hiding this comment

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

is this what we observe the agent using in practice?

Copy link
Member Author

Choose a reason for hiding this comment

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

Close enough at idle, yes.

@johnstcn johnstcn merged commit 854e974 into main May 15, 2023
@johnstcn johnstcn deleted the cj/loadtest-terraform branch May 15, 2023 14:56
@github-actions github-actions bot locked and limited conversation to collaborators May 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants