Default nodepool creation fix (#999)

* Default nodepool creation fix

* Removed comments and fixded formatting with fmt

* Refactored per PR comment

Co-authored-by: Astian Seb <sgrabski@google.com>
Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
This commit is contained in:
astianseb 2022-11-22 19:17:57 +01:00 committed by GitHub
parent cb9a87dee4
commit 345cb4b7fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -48,7 +48,18 @@ resource "google_container_cluster" "cluster" {
enable_autopilot = var.enable_features.autopilot ? true : null
# the default nodepool is deleted here, use the gke-nodepool module instead
# node_config {}
# default nodepool configuration based on a shielded_nodes variable
node_config {
dynamic "shielded_instance_config" {
for_each = var.enable_features.shielded_nodes ? [""] : []
content {
enable_secure_boot = true
enable_integrity_monitoring = true
}
}
}
addons_config {
dynamic "dns_cache_config" {