mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-07-28 09:11:18 +00:00
🏭️ Refactor prepare-tf
- fix tags so that they don't contain '=' - install metrics-server only if necessary - set a maximum size to GKE node pool - change tags to be shorter
This commit is contained in:
@@ -5,7 +5,7 @@ resource "digitalocean_kubernetes_cluster" "_" {
|
||||
version = var.k8s_version
|
||||
|
||||
node_pool {
|
||||
name = "dok-x86"
|
||||
name = "x86"
|
||||
tags = local.common_tags
|
||||
size = local.node_type
|
||||
auto_scale = true
|
||||
|
||||
@@ -3,14 +3,18 @@ resource "google_container_cluster" "_" {
|
||||
project = "prepare-tf"
|
||||
location = "europe-north1-a"
|
||||
min_master_version = var.k8s_version
|
||||
initial_node_count = var.min_nodes_per_pool
|
||||
#max_size = max(var.min_nodes_per_pool, var.max_nodes_per_pool)
|
||||
#autoscaling = true
|
||||
#autohealing = true
|
||||
|
||||
node_config {
|
||||
tags = var.common_tags
|
||||
machine_type = local.node_type
|
||||
node_pool {
|
||||
name = "x86"
|
||||
node_config {
|
||||
tags = var.common_tags
|
||||
machine_type = local.node_type
|
||||
}
|
||||
initial_node_count = var.min_nodes_per_pool
|
||||
autoscaling {
|
||||
min_node_count = var.min_nodes_per_pool
|
||||
max_node_count = max(var.min_nodes_per_pool, var.max_nodes_per_pool)
|
||||
}
|
||||
}
|
||||
|
||||
# This is not strictly necessary.
|
||||
@@ -23,3 +27,4 @@ resource "google_container_cluster" "_" {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,3 +29,7 @@ output "kubeconfig" {
|
||||
output "cluster_id" {
|
||||
value = google_container_cluster._.id
|
||||
}
|
||||
|
||||
output "has_metrics_server" {
|
||||
value = true
|
||||
}
|
||||
|
||||
@@ -5,3 +5,7 @@ output "kubeconfig" {
|
||||
output "cluster_id" {
|
||||
value = linode_lke_cluster._.id
|
||||
}
|
||||
|
||||
output "has_metrics_server" {
|
||||
value = false
|
||||
}
|
||||
|
||||
@@ -9,3 +9,7 @@ output "kubeconfig" {
|
||||
output "cluster_id" {
|
||||
value = oci_containerengine_cluster._.id
|
||||
}
|
||||
|
||||
output "has_metrics_server" {
|
||||
value = false
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ resource "scaleway_k8s_cluster" "_" {
|
||||
|
||||
resource "scaleway_k8s_pool" "_" {
|
||||
cluster_id = scaleway_k8s_cluster._.id
|
||||
name = "scw-x86"
|
||||
name = "x86"
|
||||
tags = var.common_tags
|
||||
node_type = local.node_type
|
||||
size = var.min_nodes_per_pool
|
||||
|
||||
@@ -5,3 +5,7 @@ output "kubeconfig" {
|
||||
output "cluster_id" {
|
||||
value = scaleway_k8s_cluster._.id
|
||||
}
|
||||
|
||||
output "has_metrics_server" {
|
||||
value = var.k8s_version >= 1.22
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user