Skip to content

Commit 5188b84

Browse files
authored
Merge pull request #400 from Dev25/node-metadata-v1
Allow overriding node_metadata in node pools
2 parents 68cae2b + 5e0d49c commit 5188b84

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

autogen/main/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ The node_pools variable takes the following parameters:
172172
| node_count | The number of nodes in the nodepool when autoscaling is false. Otherwise defaults to 1. Only valid for non-autoscaling clusers | | Required |
173173
{% if beta_cluster %}
174174
| node_locations | The list of zones in which the cluster's nodes are located. Nodes must be in the region of their regional cluster or in the same region as their cluster's zone for zonal clusters. Defaults to cluster level node locations if nothing is specified | " " | Optional |
175-
| node_metadata | Options to expose the node metadata to the workload running on the node | | Required |
175+
| node_metadata | Options to expose the node metadata to the workload running on the node | | Optional |
176176
{% endif %}
177177
| preemptible | A boolean that represents whether or not the underlying node VMs are preemptible | false | Optional |
178178
{% if beta_cluster %}

autogen/main/cluster.tf.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ resource "google_container_node_pool" "pools" {
451451
for_each = local.cluster_node_metadata_config
452452

453453
content {
454-
node_metadata = workload_metadata_config.value.node_metadata
454+
node_metadata = lookup(var.node_pools[count.index], "node_metadata", workload_metadata_config.value.node_metadata)
455455
}
456456
}
457457

modules/beta-private-cluster-update-variant/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ The node_pools variable takes the following parameters:
259259
| name | The name of the node pool | | Required |
260260
| node_count | The number of nodes in the nodepool when autoscaling is false. Otherwise defaults to 1. Only valid for non-autoscaling clusers | | Required |
261261
| node_locations | The list of zones in which the cluster's nodes are located. Nodes must be in the region of their regional cluster or in the same region as their cluster's zone for zonal clusters. Defaults to cluster level node locations if nothing is specified | " " | Optional |
262-
| node_metadata | Options to expose the node metadata to the workload running on the node | | Required |
262+
| node_metadata | Options to expose the node metadata to the workload running on the node | | Optional |
263263
| preemptible | A boolean that represents whether or not the underlying node VMs are preemptible | false | Optional |
264264
| sandbox_type | Sandbox to use for pods in the node pool | | Required |
265265
| service_account | The service account to be used by the Node VMs | " " | Optional |

modules/beta-private-cluster-update-variant/cluster.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ resource "google_container_node_pool" "pools" {
412412
for_each = local.cluster_node_metadata_config
413413

414414
content {
415-
node_metadata = workload_metadata_config.value.node_metadata
415+
node_metadata = lookup(var.node_pools[count.index], "node_metadata", workload_metadata_config.value.node_metadata)
416416
}
417417
}
418418

modules/beta-private-cluster/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ The node_pools variable takes the following parameters:
259259
| name | The name of the node pool | | Required |
260260
| node_count | The number of nodes in the nodepool when autoscaling is false. Otherwise defaults to 1. Only valid for non-autoscaling clusers | | Required |
261261
| node_locations | The list of zones in which the cluster's nodes are located. Nodes must be in the region of their regional cluster or in the same region as their cluster's zone for zonal clusters. Defaults to cluster level node locations if nothing is specified | " " | Optional |
262-
| node_metadata | Options to expose the node metadata to the workload running on the node | | Required |
262+
| node_metadata | Options to expose the node metadata to the workload running on the node | | Optional |
263263
| preemptible | A boolean that represents whether or not the underlying node VMs are preemptible | false | Optional |
264264
| sandbox_type | Sandbox to use for pods in the node pool | | Required |
265265
| service_account | The service account to be used by the Node VMs | " " | Optional |

modules/beta-private-cluster/cluster.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ resource "google_container_node_pool" "pools" {
340340
for_each = local.cluster_node_metadata_config
341341

342342
content {
343-
node_metadata = workload_metadata_config.value.node_metadata
343+
node_metadata = lookup(var.node_pools[count.index], "node_metadata", workload_metadata_config.value.node_metadata)
344344
}
345345
}
346346

modules/beta-public-cluster/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ The node_pools variable takes the following parameters:
237237
| name | The name of the node pool | | Required |
238238
| node_count | The number of nodes in the nodepool when autoscaling is false. Otherwise defaults to 1. Only valid for non-autoscaling clusers | | Required |
239239
| node_locations | The list of zones in which the cluster's nodes are located. Nodes must be in the region of their regional cluster or in the same region as their cluster's zone for zonal clusters. Defaults to cluster level node locations if nothing is specified | " " | Optional |
240-
| node_metadata | Options to expose the node metadata to the workload running on the node | | Required |
240+
| node_metadata | Options to expose the node metadata to the workload running on the node | | Optional |
241241
| preemptible | A boolean that represents whether or not the underlying node VMs are preemptible | false | Optional |
242242
| sandbox_type | Sandbox to use for pods in the node pool | | Required |
243243
| service_account | The service account to be used by the Node VMs | " " | Optional |

modules/beta-public-cluster/cluster.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ resource "google_container_node_pool" "pools" {
327327
for_each = local.cluster_node_metadata_config
328328

329329
content {
330-
node_metadata = workload_metadata_config.value.node_metadata
330+
node_metadata = lookup(var.node_pools[count.index], "node_metadata", workload_metadata_config.value.node_metadata)
331331
}
332332
}
333333

0 commit comments

Comments
 (0)