Skip to content

NAP not setting linux_node_config for cgroup_mode #2321

@davidholsgrove

Description

@davidholsgrove

I'm encountering the same issue Originally posted by @mqmr in #2271, where I have GKE clusters configured with NAP that have been set to CGROUP_MODE_V2 by following the guide and running gcloud container clusters update CLUSTER_NAME --autoprovisioning-cgroup-mode=v2

This sets the linux_node_config for the NAP pools accordingly, but https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/blob/main/modules/beta-private-cluster-update-variant/cluster.tf#L237-L244 does not include the config, and therefore terraform wants to remove it (which it fails to do on apply)

...
09:45:07.410 STDOUT terraform:   ~ update in-place
09:45:07.410 STDOUT terraform: Terraform will perform the following actions:
09:45:07.410 STDOUT terraform:   # module.beta-private-cluster[0].google_container_cluster.primary will be updated in-place
09:45:07.410 STDOUT terraform:   ~ resource "google_container_cluster" "primary" {
09:45:07.410 STDOUT terraform:         id                                       = "..."
09:45:07.410 STDOUT terraform:         name                                     = "..."
09:45:07.410 STDOUT terraform:         # (32 unchanged attributes hidden)
09:45:07.410 STDOUT terraform:       ~ node_pool_auto_config {
09:45:07.410 STDOUT terraform:             # (1 unchanged attribute hidden)
09:45:07.410 STDOUT terraform:           - linux_node_config {
09:45:07.410 STDOUT terraform:               - cgroup_mode = "CGROUP_MODE_V2" -> null
09:45:07.411 STDOUT terraform:             }
09:45:07.411 STDOUT terraform:             # (1 unchanged block hidden)
09:45:07.411 STDOUT terraform:         }
09:45:07.411 STDOUT terraform:         # (36 unchanged blocks hidden)
09:45:07.411 STDOUT terraform:     }
09:45:07.411 STDOUT terraform: Plan: 0 to add, 1 to change, 0 to destroy.
...
09:47:20.289 STDOUT terraform: module.beta-private-cluster[0].google_container_cluster.primary: Modifying... [id=...]
09:47:21.191 STDERR terraform: ╷
09:47:21.191 STDERR terraform: │ Error: googleapi: Error 400: Must specify a field to update.
09:47:21.191 STDERR terraform: │ Details:
09:47:21.191 STDERR terraform: │ [
09:47:21.191 STDERR terraform: │   {
09:47:21.191 STDERR terraform: │     "@type": "type.googleapis.com/google.rpc.RequestInfo",
09:47:21.191 STDERR terraform: │     "requestId": "0xe3c37cb1014465d6"
09:47:21.191 STDERR terraform: │   }
09:47:21.191 STDERR terraform: │ ]
09:47:21.191 STDERR terraform: │ , badRequest
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions