kbst / terraform-kubestack

Kubestack is a framework for Kubernetes platform engineering teams to define the entire cloud native stack in one Terraform code base and continuously evolve the platform safely through GitOps.
https://www.kubestack.com
Apache License 2.0
645 stars 92 forks source link

AKS: Adding labels to node_pool requires delete and recreate of the cluster #172

Open pst opened 3 years ago

pst commented 3 years ago

Adding node_labels to the default node pool forces a destroy and recreate plan.

  # module.aks_zero.module.cluster.azurerm_kubernetes_cluster.current must be replaced
-/+ resource "azurerm_kubernetes_cluster" "current" {
     [...]

      ~ default_node_pool {
          - availability_zones    = [] -> null
          - enable_node_public_ip = false -> null
          ~ max_pods              = 110 -> (known after apply)
            name                  = "default"
          ~ node_count            = 1 -> (known after apply)
          ~ node_labels           = { # forces replacement
              + "kubestack.com-cluster_domain"          = "azure.infra.serverwolken.de"
              + "kubestack.com-cluster_fqdn"            = "kbstacctest-ops-westeurope.azure.infra.serverwolken.de"
              + "kubestack.com-cluster_name"            = "kbstacctest-ops-westeurope"
              + "kubestack.com-cluster_provider_name"   = "azure"
              + "kubestack.com-cluster_provider_region" = "westeurope"
              + "kubestack.com-cluster_workspace"       = "ops"
            }
          - node_taints           = [] -> null
          ~ orchestrator_version  = "1.18.14" -> (known after apply)
          - tags                  = {} -> null
            # (7 unchanged attributes hidden)
        }
    }
pst commented 3 years ago

FYI @to266, unfortunately I had to revert this part of your contribution from this release. Part of revamping the node pools support will be migrating from the default_node_pool block to the azurerm_kubernetes_cluster_node_pool resource. I prefer to tackle the node_labels together with that change, so I can handle both with a single transitional release to avoid downtime for users.