The GCP_GKE_METADATA_SERVER_ENABLED monitor verifies whether the Google Kubernetes Engine (GKE) Metadata Server is enabled for your workloads and node pools. Enabling the metadata server improves security by allowing workloads to securely obtain metadata without directly accessing the node’s metadata server.
Passing Criteria
The monitor is considered passing when both of the following conditions are met:
1. Workload Identity is Enabled
The value of entity.metaData.workloadIdentityConfig.workloadPool must be defined (non-null and non-undefined).
2. All Node Pools Have Metadata Server Enabled
For every node pool in entity.metaData.nodePools, the value of pool.config.workloadMetadataConfig.mode must be either:
GKE_METADATA_SERVER, or
GKE_METADATA
Summary
Workload identity is configured.
Every node pool has workloadMetadataConfig.mode set to GKE_METADATA_SERVER or GKE_METADATA.
If either condition is not met, isMonitorPassing will be false.
How to Remediate
If the monitor fails, follow these steps:
1. Enable Workload Identity
Go to the Google Cloud Console.
Navigate to Kubernetes Engine → Clusters.
Select the target cluster.
Under Security, locate Workload Identity.
Enable it and specify the workload pool (for example, <PROJECT_ID>.svc.id.goog).
Save the configuration and redeploy the workloads if required.