简体   繁体   English

将 GKE 节点池设置为 auto_upgrade

[英]Setting GKE node pool to auto_upgrade

I'm running a kubernetes cluster on GKE.我在 GKE 上运行 kubernetes 集群。 I'd like to enable auto_upgrade for each node pool and I'd like to do this in terraform.我想为每个节点池启用auto_upgrade ,我想在 terraform 中执行此操作。 I'm not sure how.我不确定如何。

The node pools are defined with terraform like this节点池使用 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
    }

I attempted to set auto_upgrade on the node pool like so我试图像这样在节点池上设置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
    }

ie I added an auto_upgrade parameter.即我添加了一个auto_upgrade参数。

This appears to have no effect on the terraform plan .这似乎对terraform plan没有影响。

Any idea what I'm missing here?知道我在这里缺少什么吗?

Assuming you are using the Jetstack gke-module , then by default node pools will be set to use auto-upgrade.假设您使用的是Jetstack gke-module ,那么默认情况下节点池将设置为使用自动升级。 But if you want to explicitly enable auto-upgrade, then I believe the parameter you want to use is " management_auto_upgrade ".但是如果你想明确启用自动升级,那么我相信你要使用的参数是“ management_auto_upgrade ”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM