Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for linux_node_config cgroupMode #12712

Closed
hanikesn opened this issue Oct 4, 2022 · 7 comments
Closed

Add support for linux_node_config cgroupMode #12712

hanikesn opened this issue Oct 4, 2022 · 7 comments

Comments

@hanikesn
Copy link

hanikesn commented Oct 4, 2022

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment. If the issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.

Description

Newer GKE release allow setting the cgroupMode for nodes,:
https://cloud.google.com/kubernetes-engine/docs/how-to/node-system-config#cgroup-mode-options

New or Affected Resource(s)

  • google_container_node_pool

Potential Terraform Configuration

resource "google_container_node_pool" "secondary-pools" {
  node_config {
    linux_node_config {
      cgroup_mode = "CGROUP_MODE_UNSPECIFIED"
    }
  }
}

References

b/288868203

@peter-mueller-viacom
Copy link

Please also add same to resource google_container_aws_node_pool TY.

@MatthieuStrullu
Copy link

Waiting Terraform configuration availability, is there any workaround to change cgroup mode ?

@DanTulovsky
Copy link

You can do this manually after the cluster is created, per node pool:

# put this into a file: config.txt
linuxConfig:
  cgroupMode: 'CGROUP_MODE_V1'

Then run:

gcloud container node-pools update <node_pool_name> --cluster=<cluster_name> --location <cluster_location> --system-config-from-file=./config.txt;

This does a normal node pool rolling update, recreating all the nodes.

@davicedraz
Copy link

Complementing @DanTulovsky's suggestion, you can perform this update via terraform using a null_resource by running a script that performs the gcloud container node-pools update on the desired node pools.

For example:

resource "null_resource" "update_cgroup" {
  triggers = {
    // whatever makes the most sense in your context
  }

  provisioner "local-exec" {
    command = "sh ../scripts/update-cgroup-mode.sh ${module.node_pool} ${module.cluster.name} ${var.metadata.region}"
  }

  depends_on = [module.node_pool] // your module of node pools, so it will only run after creating it
}

@NA2047
Copy link

NA2047 commented Oct 6, 2023

Suggest closing this as this was merged in GoogleCloudPlatform/magic-modules#8997

@melinath
Copy link
Collaborator

Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants