mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-07-22 06:16:31 +00:00
GCP quotas are fairly limited (on my account, I can only use 8 public IP addresses per zone, which means that I cannot deploy many public clusters in a single zone). I tried to use private clusters, but that causes other problems. This refactoring makes it possible to spread clusters across multiple zones. Since I have access to 20+ zones in Europe and 20+ zones in the US, this lets me create a lot of public clusters and simplifies the module quite a bit.
18 lines
486 B
HCL
18 lines
486 B
HCL
resource "digitalocean_kubernetes_cluster" "_" {
|
|
name = var.cluster_name
|
|
tags = var.common_tags
|
|
# Region is mandatory, so let's provide a default value.
|
|
region = var.location != null ? var.location : "nyc1"
|
|
version = var.k8s_version
|
|
|
|
node_pool {
|
|
name = "x86"
|
|
tags = var.common_tags
|
|
size = local.node_type
|
|
auto_scale = true
|
|
min_nodes = var.min_nodes_per_pool
|
|
max_nodes = max(var.min_nodes_per_pool, var.max_nodes_per_pool)
|
|
}
|
|
|
|
}
|