Review GKE Network Policy enforcement

Check how GKE enforces network policies and which workload connections are allowed.

Description

If an older GKE template omits networkPolicy, check which networking implementation the cluster uses. Dataplane V2 has built-in enforcement. Calico on Standard needs both the control-plane add-on and node enforcement.

Potential impact

A missing policy can leave unnecessary connections open. A policy that omits required traffic can break DNS or service calls.

Remediation

Schedule maintenance before enabling Calico on an existing Standard cluster because GKE recreates its nodes. Apply NetworkPolicy resources allowing required service traffic. After node recreation finishes, check that DNS and required connections succeed and that a connection meant to be blocked fails.

Examples

These historical GKE request excerpts omit node settings and NetworkPolicy resources. Standard support for Deployment Manager has ended. Use a supported tool for new deployments.

Before

yaml
name: cluster
description: my-cluster

After

yaml
name: cluster
description: my-cluster
networkPolicy:
  enabled: true
  provider: CALICO
addonsConfig:
  networkPolicyConfig:
    disabled: false

The second excerpt sets provider: CALICO, enabled: true and networkPolicyConfig.disabled: false together for a Standard cluster.

References