-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
GKE Standard Clusters with AutoProvisioned NodePools not adding the Firewall target_tags
#2104
Labels
bug
Something isn't working
Comments
Seems like #1817 added this support in a narrower way for autopilot. High level, I think this plus an example based on your snippet could work, and I can open a draft PR, but may take a bit to get the tests working, and I'm not super familiar personally with the use case. Guessing the fix is something like this? diff --git a/autogen/main/cluster.tf.tmpl b/autogen/main/cluster.tf.tmpl
index 80200fe7..4223db7d 100644
--- a/autogen/main/cluster.tf.tmpl
+++ b/autogen/main/cluster.tf.tmpl
@@ -281,10 +281,10 @@ resource "google_container_cluster" "primary" {
{% if autopilot_cluster != true %}
dynamic "node_pool_auto_config" {
- for_each = var.cluster_autoscaling.enabled && length(var.network_tags) > 0 ? [1] : []
+ for_each = var.cluster_autoscaling.enabled && (length(var.network_tags) > 0 || var.add_cluster_firewall_rules) ? [1] : []
content {
network_tags {
- tags = var.network_tags
+ tags = var.add_cluster_firewall_rules ? (concat(var.network_tags, [local.cluster_network_tag])) : var.network_tags
}
}
} |
wyardley
added a commit
to wyardley/terraform-google-kubernetes-engine
that referenced
this issue
Sep 26, 2024
While terraform-google-modules#1817 added autopilot support for adding tags to `node_pool_auto_config` when `add_cluster_firewall_rules` is set to `true`, the same change did not apply for standard (non-autopilot) clusters with cluster level autoscaling (nodepool autoprovisioning) in place, Fixes terraform-google-modules#2104 Signed-off-by: William Yardley <[email protected]>
wyardley
added a commit
to wyardley/terraform-google-kubernetes-engine
that referenced
this issue
Sep 26, 2024
While terraform-google-modules#1817 added autopilot support for adding tags to `node_pool_auto_config` when `add_cluster_firewall_rules` is set to `true`, the same change did not apply for standard (non-autopilot) clusters with cluster level autoscaling (nodepool autoprovisioning) in place, Fixes terraform-google-modules#2104 Signed-off-by: William Yardley <[email protected]>
wyardley
added a commit
to wyardley/terraform-google-kubernetes-engine
that referenced
this issue
Sep 26, 2024
While terraform-google-modules#1817 added autopilot support for adding tags to `node_pool_auto_config` when `add_cluster_firewall_rules` is set to `true`, the same change did not apply for standard (non-autopilot) clusters with cluster level autoscaling (nodepool autoprovisioning) in place, Fixes terraform-google-modules#2104 Signed-off-by: William Yardley <[email protected]>
wyardley
added a commit
to wyardley/terraform-google-kubernetes-engine
that referenced
this issue
Sep 27, 2024
While terraform-google-modules#1817 added autopilot support for adding tags to `node_pool_auto_config` when `add_cluster_firewall_rules` is set to `true`, the same change did not apply for standard (non-autopilot) clusters with cluster level autoscaling (nodepool autoprovisioning) in place, Fixes terraform-google-modules#2104 Signed-off-by: William Yardley <[email protected]>
wyardley
added a commit
to wyardley/terraform-google-kubernetes-engine
that referenced
this issue
Sep 27, 2024
While terraform-google-modules#1817 added autopilot support for adding tags to `node_pool_auto_config` when `add_cluster_firewall_rules` is set to `true`, the same change did not apply for standard (non-autopilot) clusters with cluster level autoscaling (nodepool autoprovisioning) in place, Fixes terraform-google-modules#2104 Signed-off-by: William Yardley <[email protected]>
wyardley
added a commit
to wyardley/terraform-google-kubernetes-engine
that referenced
this issue
Sep 27, 2024
While terraform-google-modules#1817 added autopilot support for adding tags to `node_pool_auto_config` when `add_cluster_firewall_rules` is set to `true`, the same change did not apply for standard (non-autopilot) clusters with cluster level autoscaling (nodepool autoprovisioning) in place, Fixes terraform-google-modules#2104 Signed-off-by: William Yardley <[email protected]>
wyardley
added a commit
to wyardley/terraform-google-kubernetes-engine
that referenced
this issue
Oct 9, 2024
While terraform-google-modules#1817 added autopilot support for adding tags to `node_pool_auto_config` when `add_cluster_firewall_rules` is set to `true`, the same change did not apply for standard (non-autopilot) clusters with cluster level autoscaling (nodepool autoprovisioning) in place, Fixes terraform-google-modules#2104 Signed-off-by: William Yardley <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TL;DR
The firewall rules created with
target_tags = [local.cluster_network_tag]
have an expectation that the nodepools will have this tag ("gke-${var.name}"
) applied.This tag should be added to
network_tags
to ensure it is set innode_pool_auto_config
for AutoProvisioned NodePools also.Expected behavior
The generated tags used by the firewall rules should be added to the
network_tags
for autoprovisioned nodepools the same as manual nodepoolsObserved behavior
Firewall rules for allowing admission webhook etc aren't applying to the autoprovisioned nodepools as targets
Terraform Configuration
The text was updated successfully, but these errors were encountered: