Skip to content

Commit

Permalink
Declare kubelet_config with dynamic only when cpu_manager_policy is set
Browse files Browse the repository at this point in the history
  • Loading branch information
m10ev committed Dec 2, 2020
1 parent 5ba88a6 commit 4ff4931
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 10 deletions.
8 changes: 6 additions & 2 deletions autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,12 @@ resource "google_container_node_pool" "pools" {

boot_disk_kms_key = lookup(each.value, "boot_disk_kms_key", "")

kubelet_config {
cpu_manager_policy = lookup(each.value, "cpu_manager_policy", "none")
dynamic "kubelet_config" {
for_each = each.value.cpu_manager_policy[*]

content {
cpu_manager_policy = each.value.cpu_manager_policy
}
}
{% endif %}

Expand Down
8 changes: 6 additions & 2 deletions modules/beta-private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,12 @@ resource "google_container_node_pool" "pools" {

boot_disk_kms_key = lookup(each.value, "boot_disk_kms_key", "")

kubelet_config {
cpu_manager_policy = lookup(each.value, "cpu_manager_policy", "none")
dynamic "kubelet_config" {
for_each = each.value.cpu_manager_policy[*]

content {
cpu_manager_policy = each.value.cpu_manager_policy
}
}

shielded_instance_config {
Expand Down
8 changes: 6 additions & 2 deletions modules/beta-private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,12 @@ resource "google_container_node_pool" "pools" {

boot_disk_kms_key = lookup(each.value, "boot_disk_kms_key", "")

kubelet_config {
cpu_manager_policy = lookup(each.value, "cpu_manager_policy", "none")
dynamic "kubelet_config" {
for_each = each.value.cpu_manager_policy[*]

content {
cpu_manager_policy = each.value.cpu_manager_policy
}
}

shielded_instance_config {
Expand Down
8 changes: 6 additions & 2 deletions modules/beta-public-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,12 @@ resource "google_container_node_pool" "pools" {

boot_disk_kms_key = lookup(each.value, "boot_disk_kms_key", "")

kubelet_config {
cpu_manager_policy = lookup(each.value, "cpu_manager_policy", "none")
dynamic "kubelet_config" {
for_each = each.value.cpu_manager_policy[*]

content {
cpu_manager_policy = each.value.cpu_manager_policy
}
}

shielded_instance_config {
Expand Down
8 changes: 6 additions & 2 deletions modules/beta-public-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,12 @@ resource "google_container_node_pool" "pools" {

boot_disk_kms_key = lookup(each.value, "boot_disk_kms_key", "")

kubelet_config {
cpu_manager_policy = lookup(each.value, "cpu_manager_policy", "none")
dynamic "kubelet_config" {
for_each = each.value.cpu_manager_policy[*]

content {
cpu_manager_policy = each.value.cpu_manager_policy
}
}

shielded_instance_config {
Expand Down

0 comments on commit 4ff4931

Please sign in to comment.