Cloud / Google Kubernetes Engine (GKE) Interview questions
Last updated
1. What is Google Kubernetes Engine (GKE)?
Google Kubernetes Engine (GKE) is Google Cloud's managed Kubernetes service. You describe workloads with standard Kubernetes objects, and Google runs, patches and scales the control plane for you.
On top of upstream Kubernetes you get:
- A managed control plane (API server, etcd, scheduler, controller manager)
- Node pools backed by Compute Engine VMs, or fully managed nodes in Autopilot
- Built-in integration with Cloud IAM, VPC, Cloud Load Balancing, Cloud Logging and Cloud Monitoring
- Automatic upgrades, node auto-repair and autoscaling
Since GKE is a certified Kubernetes distribution, the same manifests and kubectl commands you use elsewhere work unchanged.
Take quiz
The customer, using Compute Engine VMs they patch
A node pool owned by the application team
Cloud Build, triggered on each deploy
Google Cloud
A GKE-only proprietary manifest language
Standard Kubernetes YAML applied with kubectl
gsutil bucket configuration files
Terraform state files only
2. What are the main components of a GKE cluster?
A GKE cluster has two parts: the control plane and the nodes.
| Control plane | Nodes |
| kube-apiserver, etcd, kube-scheduler, kube-controller-manager, cloud-controller-manager | kubelet, container runtime (containerd), networking agent (kube-proxy or Dataplane V2) |
| Runs in a Google-managed project and is not visible as VMs in yours | Compute Engine VMs in your project (managed by Google in Autopilot) |
| Exposes the Kubernetes API endpoint | Run your Pods, grouped into node pools |
Add-ons such as CoreDNS, the metrics agent and the logging agent run as Pods on the nodes, so they consume some node capacity.
Take quiz
kubelet and the container runtime
etcd and kube-scheduler
Only the kube-apiserver
The Cloud Build worker
On a dedicated node pool you must size yourself
On Pods inside the default namespace
In a Google-managed project, not as VMs in your project
On your on-premises data center
3. What are the two operation modes in GKE?
GKE offers Autopilot and Standard modes.
In Autopilot, Google manages the control plane and the nodes. You deploy Pods and are billed for the resources the Pods request. Node sizing, scaling and upgrades are handled for you, and security defaults are locked down.
In Standard, Google manages only the control plane. You choose machine types, create node pools, tune autoscaling and pay for the VMs whether or not Pods fill them.
Pick Autopilot for least operational work and Standard when you need node-level control, such as custom kernel settings or privileged workloads.
Take quiz
Standard
Autopilot
Both, using the same node-based billing
Neither, billing is flat per cluster
Google, automatically and without input
Cloud Armor
The Kubernetes scheduler
You do
4. What is GKE Autopilot?
GKE Autopilot is a mode where Google provisions, scales, upgrades and secures the nodes for you. You only define Pods, and capacity appears based on what they request.
Key characteristics:
- Billing is based on the vCPU, memory and ephemeral storage requested by running Pods (in the default model)
- Clusters are regional, VPC-native and use Workload Identity Federation by default
- Hardened defaults: no privileged containers and limited host access
- Resource requests are mandatory in practice, because Autopilot sizes capacity from them
Because node access is restricted, DaemonSets that need host-level privileges or SSH-based debugging may not work.
Take quiz
The node pool maximum you set at cluster creation
The number of namespaces
The resource requests in your Pod specs
The size of your container images
Privileged containers
Deployments with three replicas
Services of type ClusterIP
ConfigMaps mounted as volumes
5. What is a node pool in GKE?
A node pool is a group of nodes in a cluster that share the same configuration: machine type, disk, labels, taints, image type and Kubernetes version.
A cluster can have several pools, which lets you mix workloads. For example, a general-purpose pool for web Pods, a high-memory pool for caches, and a GPU pool for training jobs.
Each pool can be autoscaled, upgraded and repaired independently. You steer Pods to a pool with nodeSelector, node affinity or taints and tolerations.
gcloud container node-pools create highmem-pool \ --cluster=demo --region=us-central1 \ --machine-type=n2-highmem-4 --num-nodes=1
Take quiz
The same namespace
The same container image
The same Pod IP only
The same configuration such as machine type and labels
By renaming the Service
nodeSelector, node affinity or taints with tolerations
By editing the control plane flags
By changing the cluster name
6. What are GKE release channels?
Release channels control how quickly your cluster receives new Kubernetes versions and patches. You subscribe a cluster to a channel and GKE upgrades it automatically within that channel's rules.
| Channel | Intended for |
| Rapid | Earliest access to new versions, best for testing features |
| Regular | Balanced default for most production clusters |
| Stable | Most conservative, versions that have run longest elsewhere |
| Extended | Longer support window for teams that upgrade less often |
A common pattern is Rapid for a sandbox, Regular for staging and Stable for production, so version problems surface early.
Take quiz
Rapid
Stable
Extended
Legacy
Rapid
A static no-channel cluster with auto-upgrade disabled forever
Stable
Regular for staging only, never production
7. How do you create a GKE cluster using gcloud?
Use gcloud container clusters create-auto for Autopilot or gcloud container clusters create for Standard.
# Autopilot gcloud container clusters create-auto demo-auto \ --region=us-central1 # Standard, regional, 1 node per zone gcloud container clusters create demo-std \ --region=us-central1 --num-nodes=1 \ --release-channel=regular
Make sure the Kubernetes Engine API is enabled in the project first (gcloud services enable container.googleapis.com). Passing --zone instead of --region creates a zonal cluster.
Autopilot clusters are always regional, so create-auto takes a region. Add --network and --subnetwork to place the cluster in an existing VPC instead of the default network.
Take quiz
gcloud compute instances create-auto
gcloud container clusters create-auto
gcloud container pods create
gcloud kubernetes autopilot start
A multi-cluster fleet
A private cluster automatically
An Autopilot cluster
A zonal cluster
8. How do you connect kubectl to a GKE cluster?
Run gcloud container clusters get-credentials. It writes a context for the cluster into your kubeconfig, and kubectl uses it from then on.
gcloud container clusters get-credentials demo-std \ --region=us-central1 --project=my-project kubectl get nodes
Authentication is handled by the gke-gcloud-auth-plugin, which turns your gcloud identity into a short-lived token. If kubectl complains about a missing plugin, install it with gcloud components install gke-gcloud-auth-plugin.
For private clusters your IP must also be allowed by the control plane's authorized networks, or you must connect from inside the VPC.
Use kubectl config get-contexts to list the clusters in your kubeconfig and kubectl config use-context to switch between them. The token is refreshed automatically, so there is no long-lived password to manage.
Take quiz
kubectl cluster-add gke
gcloud auth cluster-login
gcloud container clusters get-credentials
docker login gke
gke-gcloud-auth-plugin
gke-ssh-agent
kube-token-sidecar
iam-proxy-helper
9. What is a VPC-native GKE cluster?
A VPC-native cluster uses alias IP ranges: Pod IPs and Service IPs come from secondary ranges on the cluster's subnet, so they are real, routable addresses inside your VPC.
Benefits:
- Pod IPs are natively routable, with no custom routes needed
- Pods can be reached by other VPC resources and over VPN or Interconnect
- Enables container-native load balancing with NEGs
- VPC firewall rules and flow logs apply cleanly to Pod traffic
It is the default for new clusters, and Autopilot is always VPC-native. The older routes-based mode relied on custom routes and is limited by route quotas.
Take quiz
The node's ephemeral public IP
Google-owned ranges unrelated to your VPC
An on-prem DHCP server
A secondary range on the cluster subnet
kubectl get pods
Container-native load balancing
ConfigMaps
Namespaces
10. What are the Service types available in GKE?
GKE supports the standard Kubernetes Service types, and each maps to specific Google Cloud behavior.
| Type | What it does on GKE |
| ClusterIP | Internal virtual IP reachable only inside the cluster |
| NodePort | Opens a port on every node, usually fronted by a load balancer |
| LoadBalancer | Provisions a Google Cloud passthrough Network Load Balancer with an external IP |
| LoadBalancer (internal) | Same, but an internal load balancer, enabled with an annotation |
| ExternalName | DNS CNAME to an outside hostname |
For HTTP(S) routing, use Ingress or the Gateway API instead of one LoadBalancer Service per app.
Take quiz
A Google Cloud network load balancer with an external IP
A Cloud SQL instance
A new node pool
A Cloud Storage bucket
LoadBalancer
NodePort exposed to the internet
ClusterIP
Ingress
11. What is GKE Ingress?
GKE Ingress is the built-in controller that turns a Kubernetes Ingress resource into a Google Cloud Application Load Balancer (Layer 7). The controller runs in the Google-managed control plane, so you do not install anything.
Creating an Ingress provisions a forwarding rule, target proxy, URL map and backend services. Host and path rules in the Ingress become URL map entries.
Customize behavior with:
- BackendConfig for health checks, timeouts, Cloud CDN, IAP and Cloud Armor
- FrontendConfig for HTTPS redirects and SSL policies
- ManagedCertificate for Google-managed TLS certificates
Take quiz
A Compute Engine VM running NGINX
A Google Cloud Application Load Balancer
A VPN gateway
A Pub/Sub topic
FrontendConfig
ConfigMap
ResourceQuota
BackendConfig
12. What is the Gateway API in GKE?
The Gateway API is the newer, role-oriented successor to Ingress. GKE implements it with a Gateway controller that creates Google Cloud load balancers.
It splits responsibilities across resources:
- GatewayClass - the load balancer type, such as
gke-l7-global-external-managed - Gateway - the listener and address, owned by the platform team
- HTTPRoute - host, path and header rules, owned by app teams
Compared with Ingress it supports traffic splitting, header-based routing, cross-namespace routes and multi-cluster Gateways without vendor annotations.
In practice, a platform team defines one shared Gateway with HTTPS listeners, and each application team attaches its own HTTPRoute, so teams can ship routing changes without touching shared load balancer settings.
Take quiz
GatewayClass
PodDisruptionBudget
HTTPRoute
StorageClass
GatewayClass
HTTPRoute
Namespace
ServiceAccount
A replacement for Pods
A Cloud SQL proxy
A more expressive, role-oriented successor to Ingress
A node image format
13. What is container-native load balancing in GKE?
Container-native load balancing lets a Google Cloud load balancer send traffic straight to Pod IPs using Network Endpoint Groups (NEGs), instead of sending it to nodes first.
Without it, traffic hits a node's NodePort and kube-proxy may forward it to a Pod on a different node, adding a hop and obscuring the client IP. With NEGs, the load balancer health-checks each Pod and balances evenly across them.
You enable it per Service with the annotation below. It requires a VPC-native cluster.
metadata: annotations: cloud.google.com/neg: '{"ingress": true}'
Take quiz
To the control plane first
Only to the first node in the pool
To Cloud Storage
Directly to Pod IPs through NEGs
The need for container images
The extra hop through kube-proxy to another node
Pod restarts
Namespace isolation
14. What is Workload Identity Federation for GKE?
Workload Identity Federation for GKE (formerly Workload Identity) lets Pods call Google Cloud APIs using their Kubernetes identity, with no exported service account keys.
You grant IAM roles directly to the Kubernetes ServiceAccount principal, or let the KSA impersonate a Google service account. Credentials are short-lived tokens issued at runtime.
It beats key files because there is nothing to leak, rotate or mount as a Secret, and each Pod can have its own least-privilege identity instead of inheriting the node's service account.
Take quiz
Downloaded service account key files
Kubernetes namespaces
Container registries
Node pools
The default root user of the node
The developer's personal gcloud login
Their Kubernetes ServiceAccount mapped to IAM
A shared key in a ConfigMap
15. What are the storage options for GKE workloads?
GKE supports several storage back ends, mostly through CSI drivers.
| Option | Best for |
| Persistent Disk / Hyperdisk | Block storage for databases and single-Pod volumes (ReadWriteOnce) |
| Filestore | Shared NFS volumes across many Pods (ReadWriteMany) |
| Cloud Storage FUSE CSI | Mounting buckets for ML data and artifacts |
| Local SSD | Fast scratch space that disappears with the node |
Persistent Disks are zonal (or regional for replicated disks), so a Pod using one must schedule in the disk's zone. Use volumeBindingMode: WaitForFirstConsumer to avoid zone mismatches.
Take quiz
Local SSD
Filestore
A single Persistent Disk
Container image layers
It is copied to Cloud SQL
It is retained in the control plane
It moves to the next node automatically
It is lost
16. What is a private cluster in GKE?
In a private cluster, nodes get only internal IP addresses, so they are not reachable from the internet. Pods that need outbound access, such as pulling public images, go through Cloud NAT, or use Private Google Access for Google APIs.
The control plane endpoint can be public (restricted by authorized networks), or private only. With a private endpoint, you reach it from inside the VPC, over VPN or through a bastion.
It reduces attack surface because the nodes cannot be probed directly. The trade-off is added networking setup for egress and admin access.
Take quiz
Public only
A shared global anycast IP
Internal only
No IP at all
Through Cloud NAT
Through Cloud Storage
Directly via their own public IPs
They cannot ever make outbound requests
17. What are Shielded GKE Nodes?
Shielded GKE Nodes run on Shielded VMs with three protections:
- Secure Boot - only signed boot components load
- vTPM - a virtual trusted module that records boot measurements
- Integrity monitoring - compares boot state against a known-good baseline
They also help GKE verify that a node requesting cluster credentials is a genuine node of that cluster, which limits the damage from a stolen bootstrap credential. They are enabled by default on current clusters.
The integrity results appear in Cloud Logging and Monitoring, so you can alert when a node fails its integrity check.
Take quiz
Cloud NAT
Pod Security Admission
Horizontal Pod Autoscaler
Secure Boot
Pod scheduling delays
Rootkit-style tampering and node impersonation
Image tag overwrites
DNS lookups
18. What is Binary Authorization in GKE?
Binary Authorization is a deploy-time control that lets only trusted container images run in a cluster. A policy decides which images are allowed, and GKE's admission control enforces it.
Typical flow: your CI pipeline builds an image, scans it, and an attestor signs an attestation. At deploy time the policy checks for the required attestations, and rejects the Pod otherwise.
It also supports a dry-run mode that logs violations without blocking, and a break-glass annotation for emergencies. It protects the supply chain by ensuring images came through your approved pipeline.
Take quiz
That the image has the required attestations
That the node has enough CPU
That the Service has an external IP
That the namespace has a quota
Autopilot
Break-glass only
Dry-run
Private endpoint
19. What is the difference between zonal and regional GKE clusters?
A zonal cluster has one control plane in one zone. A regional cluster runs three control plane replicas across three zones and spreads nodes across them too.
| Aspect | Zonal | Regional |
| Control plane | Single replica | Three replicas in different zones |
| API during upgrades | Unavailable briefly | Stays available |
| Zone outage | Cluster management lost | Survives loss of one zone |
| Node cost | Nodes in one zone | Node count multiplies by zones used |
Choose regional for production. Note that --num-nodes=3 on a regional cluster means three nodes per zone, so nine in total.
Take quiz
One
Three, in different zones
Two in the same zone
One per node
Three
Six
One
Nine
Zonal
Regional
Both are always offline during upgrades
Neither supports upgrades
20. What is the difference between Autopilot and Standard mode?
The core difference is who owns the nodes. In Autopilot Google does; in Standard you do.
| Aspect | Autopilot | Standard |
| Node management | Fully managed by Google | You create and size node pools |
| Billing | Per Pod resource requests | Per node VM, used or idle |
| Node access | Restricted, no SSH | SSH and custom configuration allowed |
| Privileged Pods | Blocked by default | Allowed |
| Best for | Low-ops teams, variable load | Special hardware or tuning needs |
Autopilot avoids paying for idle node capacity, while Standard can be cheaper when you keep nodes densely packed or use committed use discounts well.
Take quiz
Only the Pod requests
Only API calls
The node VMs, whether or not they are full
Nothing until you exceed a free tier
Standard
Autopilot
Both identically
Neither
21. How does the GKE cluster autoscaler work?
The cluster autoscaler adds or removes nodes in a node pool based on Pod demand, within the pool's minimum and maximum size.
Scale up: when the scheduler cannot place a Pod because no node has enough requested CPU or memory, the Pod stays Pending and the autoscaler adds a node that would fit it.
Scale down: when a node's requested resources stay below a threshold for a period, the autoscaler drains it, respecting Pod Disruption Budgets, and deletes it.
Decisions use requests, not actual usage, so unrealistic requests lead to waste or stuck Pending Pods. The optimize-utilization profile scales down more aggressively than balanced.
flowchart LR
A["Pod Pending: no node fits"] --> B["Autoscaler simulates new node"]
B --> C["Node added to pool"]
C --> D["Pod scheduled"]
D --> E{Node underused for a while?}
E -- Yes --> F["Drain and delete node"]
E -- No --> D
Take quiz
Live CPU graphs only
Container image size
Number of Services
Pod resource requests
A new namespace being created
Pending Pods that cannot fit on existing nodes
A kubectl get command
Idle nodes
22. What is the difference between HPA and VPA in GKE?
HPA changes the number of Pod replicas. VPA changes the size (CPU and memory requests) of each Pod.
| Aspect | HPA | VPA |
| Scales | Replica count (out) | Resource requests (up) |
| Typical metric | CPU, memory, custom or external metrics | Observed usage history |
| Pod restart | No | Usually yes, to apply new requests |
| Good for | Stateless, spiky web traffic | Right-sizing steady or hard-to-split workloads |
Do not let HPA and VPA both act on the same CPU or memory metric, as they will fight. A common safe pairing is VPA in recommendation mode with HPA doing the actual scaling.
Take quiz
The number of Pod replicas
The node machine type
The container image
The namespace
It breaks DNS
It deletes node pools
They can conflict and keep resizing against each other
It disables Ingress
23. What is node auto-provisioning in GKE?
Node auto-provisioning (NAP) lets Standard clusters create and delete entire node pools automatically, choosing machine shapes that fit pending Pods.
The regular cluster autoscaler only resizes pools that already exist. NAP goes further: if a Pod requests a GPU or a large amount of memory that no existing pool can serve, it creates a suitable pool, then removes it when empty.
You set cluster-wide limits (total CPU, memory, accelerators) so cost cannot run away. Autopilot behaves similarly by design, since it always provisions nodes to match Pods.
Take quiz
New namespaces
New node pools
New control planes
New VPCs
Nothing, it is unlimited
The Pod's image tag
The Ingress class
Cluster-wide resource limits you configure
24. How do GKE node auto-upgrade and auto-repair work?
Auto-upgrade keeps nodes on the version allowed by the cluster's release channel. When the control plane upgrades, nodes follow in a rolling manner, within your maintenance window.
Auto-repair checks node health. If a node reports NotReady (or fails checks) for about 10 minutes, GKE drains and recreates it.
You can steer timing with maintenance windows (when upgrades may start) and maintenance exclusions (periods like a holiday freeze when they must not). Both are on by default in Autopilot and recommended in Standard.
Take quiz
Exactly 1 second
24 hours
About 10 minutes
One week
A maintenance exclusion
A larger machine type
Cloud NAT
A ConfigMap
25. What is the difference between surge and blue-green upgrades?
Both are node pool upgrade strategies. They differ in how replacement nodes are rolled in.
Surge upgrade (default) upgrades nodes in a rolling fashion. maxSurge adds extra nodes temporarily and maxUnavailable limits how many can be down at once. Defaults are surge 1, unavailable 0.
Blue-green upgrade creates a full second ("green") set of nodes, cordons the old ("blue") set, drains it gradually, and keeps blue for a soak period so you can roll back.
Blue-green gives safer rollback but temporarily needs about double the capacity, so it costs more and needs quota headroom.
Take quiz
Surge
Neither keeps old nodes
Both delete old nodes instantly
Blue-green
maxReplicas
maxSurge
minAvailable
nodeSelector
26. How does Cloud IAM work together with Kubernetes RBAC in GKE?
They are two permission layers, and GKE checks both. Cloud IAM controls who can manage the cluster itself and, via roles such as roles/container.developer, can also grant access to Kubernetes objects. Kubernetes RBAC controls what a user or ServiceAccount can do inside the cluster, per namespace.
Authorization is additive: a request is allowed if either IAM or RBAC permits it. That means a broad IAM role can quietly override a tight RBAC setup.
Good practice is to give people minimal IAM (for example roles/container.clusterViewer so they can fetch credentials) and grant day-to-day permissions through RoleBindings, ideally bound to Google Groups.
Take quiz
The action is allowed, because either layer can grant it
It is denied, since both must agree
It is denied only on Autopilot
It is allowed only for 5 minutes
Who can create Cloud NAT
Billing accounts
What identities can do inside the cluster, per namespace
Compute Engine disk snapshots
27. How do you enforce network policies in GKE?
Kubernetes NetworkPolicy objects only take effect if the cluster has a policy engine enabled. On GKE you get one by using Dataplane V2 (Cilium-based, always on in Autopilot) or by enabling Calico network policy.
A good starting pattern is a default-deny rule for a namespace, then explicit allows:
apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: default-deny-ingress namespace: payments spec: podSelector: {} policyTypes: - Ingress
Without an enforcing engine the object is accepted but silently does nothing, which is a common audit finding.
Take quiz
It is enforced by kube-proxy automatically
It is accepted but not enforced
The API server rejects it
It becomes a firewall rule on the VPC
Routes-based networking
Cloud VPN
Local SSD
Dataplane V2
28. What is GKE Dataplane V2?
Dataplane V2 is GKE's eBPF-based networking dataplane built on Cilium. It replaces the kube-proxy and iptables approach for Service routing and brings policy enforcement into the same layer.
What you gain:
- Built-in Kubernetes NetworkPolicy enforcement, no Calico add-on
- Network policy logging to see allowed and denied connections
- Better scaling with many Services, since eBPF maps replace long iptables chains
It is always enabled on Autopilot. On Standard it is chosen at cluster creation, and an existing cluster generally cannot switch to it, so decide early.
Take quiz
Only iptables chains
Cloud Functions
eBPF through Cilium
BigQuery
Slow iptables rules when there are many Services
Slow container image pulls
Large etcd backups
Slow node boot disks
29. When should you use Spot VMs in GKE?
Use Spot VMs for fault-tolerant, interruptible work such as batch jobs, CI runners, rendering and stateless workers that can retry. They are heavily discounted, but Compute Engine can reclaim them at any time with only about 30 seconds' notice.
Avoid them for single-replica databases or anything that cannot tolerate sudden loss.
Practical setup: create a separate Spot node pool, then schedule Pods onto it with the built-in label:
nodeSelector: cloud.google.com/gke-spot: "true" terminationGracePeriodSeconds: 25
Keep a regular on-demand pool for critical Pods, and use Pod Disruption Budgets plus replicas so a reclaimed node does not take a service down.
Take quiz
Several hours
None, ever
7 days
About 30 seconds
A single-replica primary database
Retryable batch jobs
The control plane
Billing ledger writes with no retry
cloud.google.com/free-tier
kubernetes.io/spot-only
gke.io/cheap
cloud.google.com/gke-spot
30. How do you run GPU workloads on GKE?
Create a node pool with an accelerator attached, make sure the NVIDIA driver is installed, and request the GPU in the Pod spec.
gcloud container node-pools create gpu-pool \ --cluster=demo --region=us-central1 \ --machine-type=g2-standard-8 \ --accelerator=type=nvidia-l4,count=1,gpu-driver-version=default
Then ask for it in the container:
resources: limits: nvidia.com/gpu: 1
GKE taints GPU nodes so only Pods requesting GPUs land there. To share expensive GPUs, use time-sharing or multi-instance GPU (MIG) on supported cards. On Autopilot you request GPUs through Pod specs and node selectors instead of managing pools.
Take quiz
With nvidia.com/gpu in resource limits
With a Service of type GPU
By naming the namespace gpu
With an Ingress annotation
To hide them from kubectl
To stop Spot reclaim
So only Pods that request GPUs get scheduled there
To reduce disk size
31. How do you expose a GKE app over HTTPS with managed certificates?
Reserve a global static IP, create a ManagedCertificate, then reference both from an Ingress.
apiVersion: networking.gke.io/v1 kind: ManagedCertificate metadata: name: web-cert spec: domains: - www.example.com --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: web annotations: kubernetes.io/ingress.global-static-ip-name: web-ip networking.gke.io/managed-certificates: web-cert
Point your DNS A record at the static IP. Google provisions the certificate only after DNS resolves to the load balancer, which can take several minutes up to an hour. For Gateway API setups, use Certificate Manager instead.
Check progress with kubectl describe managedcertificate web-cert. The status moves from Provisioning to Active, and a Failed status usually means the DNS record is wrong.
Take quiz
Immediately, before any DNS
After the domain's DNS points to the load balancer IP
Only when the Pod restarts
After you upload a PFX file
cloud.google.com/tls-auto
kubernetes.io/cert-bot
gke.io/https-on
networking.gke.io/managed-certificates
32. How do you monitor a GKE cluster?
GKE integrates with Google Cloud's observability stack out of the box.
- Cloud Logging collects system logs and, if enabled, workload stdout and stderr
- Cloud Monitoring shows cluster, node and Pod metrics in prebuilt GKE dashboards
- Managed Service for Prometheus scrapes Prometheus-format metrics using PodMonitoring resources, with PromQL queries
- Kubernetes events and Cloud Audit Logs track API activity
Set alerting policies on symptoms like Pod restarts, node memory pressure and pending Pods. Use the kubectl top command for a quick check, but rely on Monitoring for history.
Take quiz
Cloud Scheduler
Secret Manager
Managed Service for Prometheus
Cloud DNS
Cloud Logging
Cloud Spanner
Artifact Registry
BigQuery ML
33. How do you troubleshoot pods stuck in Pending on GKE?
Start with the scheduler's explanation:
kubectl describe pod web-7d9f --namespace=prod
Read the Events section. Common causes on GKE:
- Insufficient CPU or memory - requests exceed any node, or the autoscaler hit its pool maximum
- Compute Engine quota - the autoscaler cannot add VMs (check quotas and the autoscaler events)
- Taints or selectors - Pod lacks a toleration, or no node matches the label
- Volume zone mismatch - a PersistentVolume lives in a zone with no free nodes
- IP exhaustion - the Pod range has no free addresses
If events mention NotTriggerScaleUp, the autoscaler explains why it did not add a node.
Take quiz
The node's BIOS settings
The Docker Hub page
Cloud Storage access logs
The Events section of kubectl describe pod
ImagePullBackOff
NotTriggerScaleUp
CrashLoopBackOff
NodeReady
34. How do you troubleshoot ImagePullBackOff on GKE?
Run kubectl describe pod and read the exact pull error. Then check the usual suspects:
- Wrong path or tag - verify the Artifact Registry URL, repository region and tag
- Missing permission - the node service account (or Workload Identity principal) needs
roles/artifactregistry.reader - Registry in another project - grant the reader role on that project's repository
- No egress in a private cluster - enable Private Google Access or Cloud NAT so nodes can reach the registry
- Image pull secret - required for third-party private registries
A 403 or denied message points at permissions, while not found points at the path or tag.
Take quiz
A permission problem on the registry
The Pod needs more memory
The Service has no endpoints
The node is out of disk
roles/compute.admin
roles/viewer on billing
roles/artifactregistry.reader
roles/logging.writer
35. Which is better and why: GKE or Cloud Run?
Neither is universally better. It depends on how much control and Kubernetes compatibility you need.
| Factor | GKE | Cloud Run |
| Model | Full Kubernetes | Serverless containers |
| Scale to zero | Not by default | Yes, built in |
| Control | Networking, scheduling, operators, StatefulSets | Limited, simple request-driven model |
| Ops effort | Higher, even with Autopilot | Very low |
Choose Cloud Run for stateless HTTP services, event handlers and jobs where simplicity and scale-to-zero matter. Choose GKE for complex microservice platforms, StatefulSets, custom controllers, GPUs at scale, or when you must stay portable across Kubernetes environments.
Take quiz
A Standard GKE node pool
Cloud Run
A StatefulSet
A DaemonSet
A tiny stateless webhook
A simple scheduled HTTP job
A static site backend
A StatefulSet with a custom operator
36. How do you store secrets securely in GKE?
Plain Kubernetes Secrets are only base64-encoded, so add layers around them.
- Secret Manager add-on - mounts secrets from Google Secret Manager into Pods using a CSI driver, so the source of truth stays outside the cluster
- Application-layer secrets encryption - encrypts etcd-stored Secrets with a Cloud KMS key you control
- Workload Identity Federation - gives each Pod IAM access to only the secrets it needs
- RBAC - restrict who can
getorlistSecrets
Avoid putting secrets in environment variables baked into images or in Git. If you use Secrets directly, rotate them and restrict namespace access.
Take quiz
They are deleted after one hour
They cannot be mounted
They are only base64-encoded
They are limited to one Pod
Secret Manager
Cloud CDN
Pub/Sub
Cloud Build triggers
37. What happens when a GKE node becomes NotReady?
The node controller notices missed heartbeats and marks the node NotReady, then adds the taints node.kubernetes.io/not-ready or unreachable.
Pods tolerate those taints for 300 seconds by default (tolerationSeconds). After that they are evicted and recreated on healthy nodes by their controllers (Deployments, StatefulSets).
In parallel, node auto-repair will drain and recreate the node if it stays unhealthy for about 10 minutes.
Watch out for StatefulSets with zonal disks: replacements must schedule in the same zone as the volume. Lower tolerationSeconds if you need faster failover.
flowchart TD A["Heartbeats stop"] --> B["Node marked NotReady and tainted"] B --> C["Wait tolerationSeconds, default 300"] C --> D["Pods evicted and rescheduled"] B --> E["Unhealthy about 10 min"] E --> F["Auto-repair recreates node"]
Take quiz
5 seconds
1 hour
24 hours
300 seconds
Vertical Pod Autoscaler
Node auto-repair
Gateway API
Binary Authorization
38. How do Pod Disruption Budgets affect GKE upgrades?
A PodDisruptionBudget (PDB) limits how many replicas of an app can be voluntarily evicted at once. During node upgrades, GKE drains nodes through the eviction API, so PDBs are honored.
For surge upgrades GKE respects a PDB for up to about one hour per node. After that it proceeds anyway, so a badly set PDB delays upgrades but cannot block them forever.
apiVersion: policy/v1 kind: PodDisruptionBudget metadata: name: web-pdb spec: minAvailable: 2 selector: matchLabels: app: web
Avoid minAvailable equal to the replica count, since that leaves no room to drain a node. PDBs do not protect against involuntary failures such as a node crash.
Take quiz
The eviction API
The ConfigMap API
The DNS API
The Metrics API
It deletes the Deployment
It disables autoscaling forever
No Pod can be evicted, which stalls draining
It encrypts etcd
39. Explain the lifecycle of a Pod on GKE Autopilot?
On Autopilot, capacity is created on demand from the Pod's requests, so the lifecycle has an extra provisioning phase.
- You apply the manifest and the API server stores the Pod as Pending.
- Autopilot checks the requests (and compute class, if set), adjusting them to allowed minimums and ratios.
- If no node has room, Autopilot provisions a new node. This is why first-time scheduling can take a minute or more.
- The scheduler binds the Pod to the node and the kubelet pulls the image.
- Init containers run, then app containers start and probes mark the Pod Ready.
- On delete, SIGTERM is sent, the grace period elapses, and empty nodes are later removed.
flowchart LR
A["Pod created: Pending"] --> B["Requests validated and adjusted"]
B --> C{Node with room?}
C -- No --> D["New node provisioned"]
C -- Yes --> E[Scheduled]
D --> E
E --> F["Image pulled, containers start"]
F --> G["Ready probes pass"]
G --> H["Running, then terminated and node reclaimed"]
Take quiz
The cluster is recreated
A new node is provisioned to fit its requests
A new VPC is made
The image is rebuilt
Pods wait for a human approval
kubectl throttles requests
Images are compiled at start
Capacity may need to be provisioned first
40. Explain the execution flow of a request through GKE Ingress?
A client request travels through Google's edge and load balancer before it reaches a Pod.
- DNS resolves the hostname to the load balancer's global anycast IP.
- The request enters Google's edge and the forwarding rule hands it to the target HTTPS proxy, which terminates TLS.
- The URL map matches host and path to a backend service.
- The backend service picks a healthy endpoint in a NEG (container-native) or a node (instance groups).
- The request reaches the Pod, which answers back along the same path.
Health checks run per backend, so a Pod failing its readiness probe is removed from rotation before users see errors.
sequenceDiagram participant C as Client participant LB as Application Load Balancer participant U as URL map participant N as NEG participant P as Pod C->>LB: HTTPS request LB->>U: Match host and path U->>N: Choose backend service N->>P: Send to healthy Pod IP P-->>C: Response
Take quiz
The kubelet
etcd
The target HTTPS proxy
kube-scheduler
The URL map
The NEG health check
The PersistentVolume
The node taint
41. Explain the internal working of Workload Identity Federation?
The mechanism relies on a node-level metadata server that stands in for the normal Compute Engine one.
- The Pod's client library asks the GKE metadata server on the node for a token.
- The server identifies the calling Pod and its Kubernetes ServiceAccount.
- It requests a KSA token and exchanges it through the Security Token Service against the cluster's workload identity pool (
PROJECT_ID.svc.id.goog). - If IAM has a binding for that principal, a short-lived federated token is returned, optionally used to impersonate a Google service account.
- The library uses the token to call the Google API.
The principal looks like principal://iam.googleapis.com/projects/NUM/locations/global/workloadIdentityPools/PROJECT_ID.svc.id.goog/subject/ns/NAMESPACE/sa/KSA.
sequenceDiagram participant Pod participant MS as GKE metadata server participant STS as Security Token Service participant API as Google API Pod->>MS: Request token MS->>STS: Exchange KSA token STS-->>MS: Federated access token MS-->>Pod: Short-lived token Pod->>API: Call with token
Take quiz
kube-proxy
The container registry
Cloud DNS
The GKE metadata server
Cloud Scheduler
Security Token Service
Cloud Build
Compute Engine snapshots
42. How do you run multi-cluster services in GKE?
Register clusters to a fleet, then use fleet features to connect them.
- Multi-cluster Services (MCS) - exports a Service with
ServiceExportso other clusters resolve it asname.namespace.svc.clusterset.local - Multi-cluster Gateway - one Google Cloud load balancer spreads external traffic across backends in several clusters and regions
- Config Sync - applies the same configuration to every cluster from Git
Typical reasons are regional failover, data residency and blast-radius reduction. Clusters should share a VPC (or have routable Pod ranges) so cross-cluster traffic works, and you must keep Namespace names consistent because services are matched by namespace.
Take quiz
ServiceExport
ServiceMonitor
IngressClass
PodTemplate
A shared etcd across clusters
Automatic code review
One load balancer over backends in several clusters
Free Pod storage
43. How do you implement GitOps on GKE with Config Sync?
Config Sync continuously pulls Kubernetes manifests from a Git repository (or OCI image) and applies them to your clusters, treating Git as the source of truth.
- Enable the feature on a fleet-registered cluster.
- Create a
RootSync(cluster-wide) orRepoSync(namespace-scoped) pointing at the repo, branch and directory. - Authenticate with a token, SSH key or Workload Identity Federation.
- Commit changes. Config Sync reconciles and reverts manual drift.
apiVersion: configsync.gke.io/v1beta1 kind: RootSync metadata: name: root-sync namespace: config-management-system spec: sourceFormat: unstructured git: repo: https://github.com/example/platform-config branch: main dir: clusters/prod auth: none
Pair it with Policy Controller to block non-compliant resources before they land.
Take quiz
RepoSecret
RootSync
SyncPolicy
FleetPod
Ignores them forever
Deletes the repository
Copies them to Cloud Storage
Reverts them back to the Git state
44. How do you design a highly available workload on GKE?
Remove single points of failure at every layer: zone, node and Pod.
- Use a regional cluster so the control plane and nodes span three zones.
- Run at least three replicas and spread them with
topologySpreadConstraintsontopology.kubernetes.io/zone. - Add readiness and liveness probes so traffic reaches only healthy Pods.
- Set a PodDisruptionBudget so upgrades and drains never remove too many replicas.
- Set realistic resource requests and enable HPA for load spikes.
- Keep state in regional storage, such as regional persistent disks or managed databases.
topologySpreadConstraints: - maxSkew: 1 topologyKey: topology.kubernetes.io/zone whenUnsatisfiable: DoNotSchedule labelSelector: matchLabels: app: web
Take quiz
terminationGracePeriodSeconds
imagePullPolicy
topologySpreadConstraints
serviceAccountName
Regional
Zonal with one node
A cluster with one replica
A cluster with no probes
45. Why is IP address planning important for GKE clusters?
Because Pod and Service ranges are set at creation and are hard to change, running out of IPs is one of the most common scaling failures.
Each node reserves a Pod CIDR block. In Standard, the default is 110 Pods per node with a /24 block (256 IPs). Autopilot allows up to 32 Pods per node, using a smaller block.
| Range | Used for | Planning tip |
| Node (primary subnet) | Node VM IPs | Size for max node count |
| Pod secondary range | Pod IPs | Largest, nodes x per-node block |
| Service secondary range | ClusterIP Services | Usually modest, /20 or similar |
Avoid overlap with on-premises ranges you will connect through VPN. If space is tight, lower max Pods per node so each node uses a smaller block, and consider adding additional Pod ranges later.
Take quiz
8
32 only
1000
110
The Service range
The Pod secondary range
The control plane range
The DNS suffix range
Pods stop restarting
The image cache is cleared
etcd refuses writes
Routing over VPN or Interconnect breaks or becomes ambiguous
46. How can you optimize GKE costs?
Cost mostly follows requested capacity, so start by making requests honest.
- Right-size requests using VPA recommendations and Monitoring data, since Autopilot bills and the autoscaler decides on requests.
- Autoscale Pods with HPA and nodes with the cluster autoscaler, using the
optimize-utilizationprofile where tolerable. - Use Spot VMs for fault-tolerant workloads.
- Commit with committed use discounts for steady baseline capacity.
- Turn off idle clusters and scale dev and test namespaces to zero outside working hours.
- Track spend with cost allocation by namespace and label.
Also compare Autopilot and Standard for each workload, since the cheaper model depends on how well nodes are packed.
Take quiz
Billing and autoscaling decisions follow requested resources
It shortens DNS queries
It removes the need for nodes
It reduces image size
Shielded VMs
Private nodes
Spot VMs
Sole-tenant nodes only
47. How do you perform a zero-downtime GKE version upgrade?
Upgrade in order: control plane first, then node pools, with safeguards on the workload side.
- Check the deprecation insights and release notes for removed APIs.
- Test the target version in a staging cluster, ideally on a faster release channel.
- Use a regional cluster so the API stays available while control plane replicas upgrade one at a time.
- Confirm every critical app has multiple replicas, readiness probes and a PDB.
- Upgrade node pools with surge settings (for example maxSurge 1 and maxUnavailable 0), or use blue-green for fast rollback.
- Watch metrics and error rates, and pause if they degrade.
Remember the version skew rule: nodes cannot run a newer version than the control plane.
Take quiz
Every node simultaneously
The control plane
Only the Ingress
The container registry
Nodes must always be two versions ahead
Nodes must match the Pod count
Nodes must be private
Nodes cannot be newer than the control plane
48. What is the difference between GKE Standard and Enterprise editions?
GKE has two editions that sit on top of the Autopilot and Standard operation modes.
| Aspect | Standard edition | Enterprise edition |
| Focus | Managed Kubernetes for individual clusters | Fleet-wide platform management |
| Multi-cluster features | Basic | Multi-cluster Services, Multi-cluster Gateway |
| Governance | Standard security tooling | Config Sync, Policy Controller, Service Mesh |
| Billing | Cluster management fee | Per vCPU fleet pricing |
Pick Enterprise when many teams and clusters need consistent policy, configuration and traffic management. A single team with one or two clusters is usually fine on Standard edition. Check current pricing and feature lists, since packaging changes over time.
Take quiz
Standard edition
Free-tier only
Enterprise edition
Zonal edition
No, editions are a separate layer on top of the modes
Yes, they are identical
Editions replace the control plane
Editions only apply to nodes
49. How do you restrict access to the GKE control plane?
Combine network restrictions with identity controls.
- Authorized networks - allow only specific CIDR ranges to reach the public endpoint
- Private endpoint - disable the public endpoint so the API is reachable only from within the VPC, VPN or Interconnect
- DNS-based endpoint - access the control plane through a Google-managed DNS name protected by IAM, avoiding IP allowlists
- IAM and RBAC - restrict who can fetch credentials and what they can do
gcloud container clusters update demo --region=us-central1 \ --enable-master-authorized-networks \ --master-authorized-networks=203.0.113.0/24
If your CI runners have changing IPs, prefer the DNS-based endpoint or run them inside the VPC.
Take quiz
Encrypts Pod volumes
Assigns Pod IPs
Schedules GPUs
Limits which CIDR ranges can reach the control plane endpoint
Routes-based cluster
DNS-based endpoint
NodePort Service
Local SSD
Any public internet address
Only the cluster's Pods
Only Cloud Shell on the public internet
Inside the VPC, VPN or Interconnect
50. How does GKE Autopilot pricing work?
In the default Autopilot model you pay for the resources your Pods request (vCPU, memory and ephemeral storage) for the time they run, plus a cluster management fee. Each billing account gets a free-tier credit that offsets the fee for one cluster.
You do not pay for idle nodes, system overhead or unscheduled capacity. Specialized compute classes and accelerators can be billed differently, so check the current rate card.
| Item | Autopilot | Standard |
| Compute billing | Pod requests | Node VMs |
| Idle capacity | Not charged | Charged |
| Control plane fee | Yes, with free-tier credit | Yes, with free-tier credit |
Because requests drive the bill, set accurate values. Over-requesting wastes money, and Autopilot also enforces minimum request sizes and CPU-to-memory ratios.