正在将GKE节点池设置为auto_upgrade



我正在GKE上运行一个kubernetes集群。我想为每个节点池启用auto_upgrade,并且我想在terraform中这样做。我不知道怎么做。

节点池是用类似的地形定义的

module "main-gke-cluster" {
source = "../modules/gke-cluster"
cluster_name = local.stage_main_cluster_name
// SNIP...
node_pools = {
default-pool = {
machine_type = "e2-standard-2"
image_type = "UBUNTU"
initial_node_count = 1
min_nodes = 0
max_nodes = 10
preemptible = true
node_locations = [
"europe-west4-a"
]
labels = {}
taints = []
oauth_scopes = local.default_pool_scopes
has_gpu = false
}

我试图像那样在节点池上设置auto_upgrade

module "main-gke-cluster" {
source = "../modules/gke-cluster"
cluster_name = local.stage_main_cluster_name
// SNIP...
node_pools = {
default-pool = {
machine_type = "e2-standard-2"
image_type = "UBUNTU"
initial_node_count = 1
min_nodes = 0
max_nodes = 10
auto_upgrade = true
preemptible = true
node_locations = [
"europe-west4-a"
]
labels = {}
taints = []
oauth_scopes = local.default_pool_scopes
has_gpu = false
}

即我添加了一个auto_upgrade参数。

这似乎对terraform plan没有影响。

知道我在这里错过了什么吗?

假设您使用的是Jetstack gke模块,那么默认情况下,节点池将设置为使用自动升级。但如果你想显式地启用自动升级,那么我相信你想要使用的参数是"management_auto_upgrade";。

最新更新