GKE地形的标签更改导致整个集群崩溃

时间:2019-12-20 23:30:29

标签: google-kubernetes-engine terraform-cloud

我对GKE上的节点池的terraform代码进行了更改,在该代码中,我仅更改了与该节点池关联的标签,并且它拆除了整个群集(包括主群集)并重新创建了它。现在,每次我尝试对群集进行更改时,无论大小,terraform都希望拆除并重新创建整个群集。

我们使用Terraform Cloud管理集群。

我在一些实例组的提交中做了这样的事情:

labels = {
-       role = "nodes"
+       "kops.k8s.io/instancegroup" = "nodes"

以下是相应的地形计划的第一行:

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
-/+ destroy and then create replacement

Terraform will perform the following actions:

  # module.kubernetes.google_container_cluster.master must be replaced
-/+ resource "google_container_cluster" "master" {

我能想到的唯一可能导致此问题的原因是,较早的一些提交我修改了实例组的作用域,以便它们可以从Google Storage进行读写,但是这些更改已应用于所有实例集群中的组。

找到解决方案:

上面描述的与此人类似的问题: https://github.com/gruntwork-io/terraform-google-gke/issues/59

解决方案是将ignore_changes添加到我们的主配置中,如下所示: https://github.com/gruntwork-io/terraform-google-gke/pull/60/files

1 个答案:

答案 0 :(得分:0)

我在此答案中添加了编辑内容

上面描述的与此人类似的问题:https://github.com/gruntwork-io/terraform-google-gke/issues/59

解决方案是像这样https://github.com/gruntwork-io/terraform-google-gke/pull/60/files

向我们的主配置添加ignore_changes