GKE cluster with ‘GKE Dataplane V2’ deploy via cmd line
GKE Dataplane V2
GKE Dataplane V2 is a new eBPF-based dataplane that replaces iptables. Previously GKE used Calico but this v2 dataplane uses Cilium.
You must enable this when deploying a cluster. This setting is immutable; cannot enable/disable this after cluster deployment.
Create VPC Network and GKE cluster
- In the example below, I have already authenticated with gcloud cli
#SET VARIABLES
REGION=us-east1
CLUSTERNAME=mycluster
NETWORK=myvpcnetwork
SUBNETWORK=myvpcsubnet
RANGE='10.0.0.0/24'
#CREATE VPC NETWORK
gcloud compute networks create $NETWORK --subnet-mode=custom
gcloud compute networks subnets create $SUBNETWORK --region $REGION --range $RANGE --network $NETWORK
#CREATE CLUSTER
gcloud container clusters create $CLUSTERNAME --region $REGION --network $NETWORK --subnetwork $SUBNETWORK --enable-dataplane-v2
Confirm that GKE Dataplane V2 is enabled
kubectl -n kube-system get pods -l k8s-app=cilium -o wide
Delete GKE cluster and VPC Network
#DELETE CLUSTER
gcloud container clusters delete $CLUSTERNAME --region $REGION
gcloud compute networks subnets delete $SUBNETWORK
gcloud compute networks delete $NETWORK