Skip to content

Commit

Permalink
feat: add configurable node pools
Browse files Browse the repository at this point in the history
Signed-off-by: Mateusz Urbanek <[email protected]>
  • Loading branch information
shanduur committed Dec 4, 2024
1 parent 172a5e6 commit 8a254d5
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 6 deletions.
9 changes: 6 additions & 3 deletions terraform/linode/modules/lke/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ resource "linode_lke_cluster" "lke" {
"prod",
]

pool {
type = "g6-standard-2"
count = 3
dynamic "pool" {
for_each = var.node_pools
content {
type = pool.value.type
count = pool.value.count
}
}
}

Expand Down
35 changes: 32 additions & 3 deletions terraform/linode/modules/lke/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,42 @@ variable "flux" {
}

variable "github_repo" {
type = string
type = string
nullable = false

validation {
condition = !(var.flux && (var.github_repo == null || var.github_repo == ""))
error_message = "'github_repo' must be set when 'flux' is true."
}
}

variable "github_token" {
type = string
type = string
nullable = false

validation {
condition = !(var.flux && (var.github_token == null || var.github_token == ""))
error_message = "'github_token' must be set when 'flux' is true."
}
}

variable "bitwarden_token" {
type = string
type = string
nullable = false

validation {
condition = !(var.flux && (var.bitwarden_token == null || var.bitwarden_token == ""))
error_message = "'bitwarden_token' must be set when 'flux' is true."
}
}

variable "node_pools" {
type = list(object({
type = string
count = number
}))

default = [
{ type = "g6-standard-2", count = 3 },
]
}

0 comments on commit 8a254d5

Please sign in to comment.