> 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
