Professional Cloud Network Engineer
GKE Dataplane V2 is a high-performance networking system for Google Kubernetes Engine (GKE) that uses a technology called eBPF running inside the Linux kernel. It replaces the older kube-proxy and iptables system, which struggled in large clusters. Instead of managing complex iptables rules, Dataplane V2 installs small eBPF programs directly into the kernel on each node. These programs make fast routing decisions using Kubernetes information like Pod labels, enabling better performance, built-in security, and consistent tools for monitoring.
The control of this system is handled by special system Pods, like anetd, which have high-level permissions. These Pods read the cluster's desired network state from the Kubernetes API and program it into the node's kernel. When a network packet arrives, the kernel's eBPF programs process it immediately—checking policies, resolving service addresses, and tracking the connection—all before the data is delivered to the destination Pod. This design removes the need for the separate kube-proxy component.
Enabling Dataplane V2 is a decision made when you create a cluster. You use the gcloud command-line tool or the Cloud Console to set the dataplane to the V2 version. Once running, you can verify it is active by checking for the absence of kube-proxy Pods and the presence of Dataplane V2 components. For deep visibility, the observability feature integrates with tools like a private Hubble endpoint, allowing you to inspect live traffic flows and export metrics to Google Cloud Managed Service for Prometheus for dashboards and alerts.
GKE Dataplane V2 provides native enforcement of Kubernetes NetworkPolicy rules directly within the Linux kernel, creating a zero-trust environment for Pod communication. It does this without needing any third-party networking add-ons. The kernel's eBPF programs use Kubernetes metadata to filter traffic, meaning security policies are applied instantly as packets arrive at a node.
The specialized anetd Pod translates network policies written in YAML into eBPF bytecode and loads them into the kernel. When a policy selects a Pod, all traffic not explicitly allowed is automatically denied. If multiple policies apply to the same workload, their rules are combined. To design secure multi-tier applications, you must create specific egress (outbound) rules. For example, Pods need rules to talk to cluster DNS, access Google Cloud APIs via specific IP ranges, retrieve metadata, or communicate with Pods in other namespaces.
For governance across many clusters, you can use GKE Enterprise Policy Controller (based on the open-source Gatekeeper). It can enforce rules, such as requiring every namespace to have a network policy, and can run in an audit mode to find problems without blocking deployments. Policy Controller can also enforce security bundles that prevent Pods from running with excessive privileges, which stops compromised containers from bypassing the kernel's network filters.
Network policy logging in GKE Dataplane V2 captures events when connections are allowed or denied by your policies. This logging is built-in when you create a cluster with Dataplane V2, but you must configure a logging Custom Resource Definition (CRD) to send these events to Cloud Logging. This gives you a clear audit trail to verify policies are working and to troubleshoot unexpected traffic.
GKE Dataplane V2 observability is a suite of tools that provide deep insight into cluster network traffic. The eBPF programs in the kernel report traffic metadata to user-space tools. You enable this observability with Google Cloud Managed Service for Prometheus. You can then visualize metrics like ingress and egress flow counts using Cloud Monitoring Metrics Explorer or build custom dashboards in tools like Grafana.
For a visual map of service dependencies and live traffic, you can use the Hubble UI. It shows source and destination services, ports, policy verdicts (allow/deny), and timestamps. To inspect traffic directly from the command line, you use the hubble-cli plugin via kubectl commands on the hubble-relay deployment. Running hubble observe shows historical traffic, while hubble observe -f follows traffic in real time, which is invaluable for troubleshooting.
gcloud or the Cloud Console.hubble-cli for real-time flow inspection.The main advantage is that Dataplane V2 processes packets using eBPF programs directly in the Linux kernel, which is much more efficient than the older method of managing long chains of iptables rules. This allows for better scalability and lower latency in large clusters.
No. GKE Dataplane V2 provides native enforcement of Kubernetes Network Policies directly within the kernel, so you do not need to install any additional Container Network Interface (CNI) plugins.
You configure the built-in network policy logging to send events to Cloud Logging. You can also use the observability tools, like running hubble observe -f, to watch live traffic and see the "allow" or "deny" verdicts for each connection in real time.
No. The observability endpoint (like the Hubble relay) is exposed on a private internal IP address. It is only accessible from within the Kubernetes cluster itself and the VPC network where the cluster resides, ensuring traffic data does not leave your private network.
Prepare and test your skills
Prepare and test your skills