> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/compute/appsec-gcp-123.md).

# GKE NodePool configuration managed at cluster level misconfiguration detected in code

## Rule Details

|                        |                                  |
| ---------------------- | -------------------------------- |
| Cortex AppSec Rule ID  | APPSEC\_GCP\_123                 |
| Category - Subcategory | Kubernetes - Resource Management |
| Provider               | GCP                              |
| Severity               | LOW                              |
| Framework              | Terraform, Terraform Plan        |

## Impact

This rule checks whether Google Kubernetes Engine (GKE) clusters uses NodePools within their configuration. The reason for this check is that using NodePools in the cluster configuration can unnecessarily complicate cluster management.

When NodePools are used at the cluster level, modifying the node configuration creates a new NodePool, increasing operational complexity. Additionally, failing to delete older NodePools after creating new ones can lead to excess resource consumption. It is recommended to manage node configurations separately from the cluster to prevent these issues.

## How to Fix

*Resource:* google\_container\_cluster

* *Arguments:* node\_pool

## To fix the issue, separate the node pool configuration from your cluster configuration. By doing so, you can manage and scale your node pools independently from the cluster. This approach makes it easier to manage resources and make changes to your cluster without affecting your applications. Additionally, it prevents the reuse of the default node pool, which could lead to unintended consequences. Here's an example of how you can achieve this in your configuration \[source,go]

resource "google\_container\_cluster" "my\_cluster" { name = "my-cluster" location = "us-central1" initial\_node\_count = 1

master\_auth { username = "" password = ""

client\_certificate\_config { issue\_client\_certificate = false } } }

resource "google\_container\_node\_pool" "my\_nodes" { name = "my-nodes" location = "us-central1" cluster = google\_container\_cluster.my\_cluster.name node\_count = 1

node\_config { oauth\_scopes = \[ "<https://www.googleapis.com/auth/logging.write>", "<https://www.googleapis.com/auth/monitoring>", ]

labels = { my-label = "my-label-value" }

## tags = \["my-tag"] } }


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/compute/appsec-gcp-123.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
