Google Kubernetes Engine (GKE) in Google Cloud

Google Kubernetes Engine (GKE) in Google Cloud

A complete, plain-English guide to running containers at scale on Google Cloud. You will learn how GKE is built, how it works inside, how it stays fast, safe and online, and how real companies use it every day.

Imagine you run a busy restaurant that is open all day and all night. Customers keep walking in. Some hours are quiet, and some hours are so crowded that people wait outside the door. Cooks get sick. Ovens break. A new menu arrives every week. Now imagine you had a clever manager who watched every table, hired extra cooks the moment the line grew, replaced a broken oven before anyone noticed, and rolled out the new menu one table at a time so nobody was ever left hungry.

That manager is what Google Kubernetes Engine, or GKE, does for software. Your apps are the dishes. The computers are the kitchen. GKE is the manager that keeps everything running, even when things go wrong. In this guide you will learn what GKE is, how it is built, and how to think about it like a real cloud architect.

2015
Year GKE first became available to the public
2
Operating modes: Autopilot and Standard
99.95%
Published uptime target for a regional control plane

1What Is GKE and Why Does It Exist?

Before we talk about GKE, we need to understand the two ideas it is built on: containers and Kubernetes.

Start with the container

A container is a small, sealed package that holds one application and everything that application needs to run. That includes the program itself, its libraries, and its settings. Because everything is inside the package, the app behaves the same on your laptop, on a test server, and in a giant data center.

Why does this matter? Before containers, teams often heard the sentence, “It works on my machine!” An app would run perfectly for the developer and then fail on the production server because of one tiny difference, such as a missing library. Containers remove that problem by shipping the whole environment with the app.

Everyday analogy

A container is like a lunch box. Inside the box you pack the sandwich, the fork, the napkin, and the juice. You can carry that lunch box to school, to the park, or to an office, and your lunch is always complete. The place you open it does not change what is inside.

Then meet Kubernetes

One container is easy to manage. But a real product may have hundreds or thousands of containers. Someone has to decide where each one runs, restart the ones that crash, add more when traffic grows, and connect them to each other. Doing that by hand is impossible at scale.

Kubernetes (often shortened to K8s) is an open-source system that does this job automatically. Google created it, based on lessons learned from an internal system called Borg, which Google had used for more than ten years to run its own products. Google released Kubernetes to the world in 2014, and today it is the most widely used container manager on the planet.

And now, GKE

Kubernetes is powerful, but running it yourself is hard. You must install it, secure it, patch it, upgrade it, and keep its brain healthy at all times. GKE is Google Cloud’s managed Kubernetes service. Google runs the hard parts for you, and you focus on your applications.

GKE began life in 2015 under the name Google Container Engine. It was renamed Google Kubernetes Engine in 2017. Since then it has added many features, with the biggest change being Autopilot mode, introduced in 2021, where Google even manages the worker computers for you.

i
Tip

Think of the three words as layers. Containers package your app. Kubernetes manages many containers. GKE is Kubernetes that Google operates for you inside Google Cloud.

The problems GKE solves

  • Too much manual work. GKE automates placement, restarts, scaling and upgrades.
  • Fragile servers. If a machine dies, GKE moves your app somewhere else.
  • Slow releases. Rolling updates let you ship new versions without taking your site offline.
  • Wasted money. Autoscaling adds capacity only when you need it and removes it when you do not.
  • Security burden. Google patches the control plane and offers strong built-in protections.

2Core Kubernetes Concepts You Need First

GKE speaks the language of Kubernetes. Learn these building blocks once and the rest of this guide will feel easy.

Kubernetes has its own vocabulary. Each word names one simple idea. Here are the ones you will meet again and again.

Smallest unit

Pod

A pod is a small wrapper around one or more containers that always run together on the same machine. It is the smallest thing Kubernetes can run. Think of it as one seat in a rowing boat holding a small crew.

Computer

Node

A node is one worker computer, either physical or virtual, that runs pods. In GKE a node is usually a Compute Engine virtual machine. It is the kitchen station where cooking happens.

Group

Cluster

A cluster is a set of nodes plus the control plane that manages them. It is the whole restaurant, with its kitchen and its manager together.

Manager

Control Plane

The control plane is the brain of the cluster. It stores the plan, decides where pods go, and watches for trouble. In GKE, Google runs it for you.

Desired state

Deployment

A deployment says, “I want three copies of this app running at all times.” Kubernetes then works nonstop to make that true, even when pods crash.

Stable address

Service

Pods come and go, and their addresses change. A service gives a group of pods one steady address, like a restaurant phone number that always reaches whoever is on shift.

Door

Ingress and Gateway

These rules let outside visitors reach services inside the cluster. They are the front door and the host who points guests to the right table.

Settings

ConfigMap and Secret

A ConfigMap holds normal settings such as a language choice. A Secret holds private values such as passwords. Both keep settings outside the container package.

More objects worth knowing

  • ReplicaSet: A helper that makes sure the right number of identical pods exist. Deployments use it behind the scenes.
  • StatefulSet: Like a deployment, but for apps that must remember who they are, such as databases. Each pod keeps a steady name and its own storage.
  • DaemonSet: Runs one copy of a pod on every node, which is useful for log collectors and monitoring agents.
  • Job and CronJob: A job runs a task once until it finishes. A cron job runs a task on a schedule, like a nightly report.
  • Namespace: A named room inside a cluster that separates teams or projects, so the payments team and the search team do not trip over each other.
  • PersistentVolume and PersistentVolumeClaim: Storage that survives even when a pod disappears. The claim is a request, and the volume is the actual disk.
Everyday analogy

Picture a school. The cluster is the school building. The control plane is the principal’s office. Each node is a classroom. Each pod is a group of students working at one table. A deployment is the rule that says, “We need three tables of students studying math at all times.” If one student group goes home sick, the principal sends in another.

The most important idea: desired state

Kubernetes works on a simple principle. You tell it what you want, not how to do it. You say, “Keep five copies of the checkout app running.” Kubernetes compares what you asked for with what is actually happening, and it keeps fixing any gap. This loop of checking and fixing is called reconciliation, and it is the heart of everything Kubernetes does.

This is why Kubernetes feels almost alive. If a node loses power at three in the morning, nobody has to wake up. The system notices that only four copies are running, sees that it wanted five, and starts one more on a healthy node.

3GKE Architecture and Components

A GKE cluster has two big halves: a control plane that Google manages, and worker nodes that run your apps.

The control plane

The control plane is a group of programs that act as the cluster’s brain. In GKE, Google hosts and operates these programs in its own managed project. You never log in to those machines, and you are never charged for patching them. The important parts are:

  • API server: The front desk of the cluster. Every request, from you, from your tools, and from the nodes, goes through it. It checks who you are, checks what you are allowed to do, and records your wishes.
  • State store (etcd): A reliable database that remembers everything about the cluster, such as which deployments exist and what they should look like. If this memory were lost, the cluster would forget its own plan.
  • Scheduler: The matchmaker. When a new pod needs a home, the scheduler picks the best node based on free space, rules, and preferences.
  • Controller manager: A collection of small watchers. One watches deployments, another watches nodes, another watches services. Each one compares reality to the plan and fixes differences.
  • Cloud controller: The translator that talks to Google Cloud, for example asking for a load balancer or a disk when your app needs one.

The worker nodes

Nodes are the machines that actually run your containers. Every node has a few standard helpers:

  • Kubelet: The node’s own manager. It listens to the API server, starts the pods it was assigned, and reports back whether they are healthy.
  • Container runtime: The engine that unpacks container images and runs them. GKE uses containerd.
  • Networking agent: Sets up pod addresses and traffic rules on the node. In modern GKE clusters this is often Dataplane V2, which is based on eBPF and Cilium technology.
  • Node operating system: GKE nodes use a hardened, minimal system called Container-Optimized OS, built to run containers safely with little extra software.
flowchart TB
  Dev["Developer or CI/CD Pipeline"] --> API
  Users["End Users"] --> LB["Cloud Load Balancer"]
  subgraph CP["GKE Control Plane - managed by Google"]
    API["API Server"]
    ETCD["State Store"]
    SCH["Scheduler"]
    CM["Controller Manager"]
    API --- ETCD
    API --- SCH
    API --- CM
  end
  subgraph VPC["Your VPC Network"]
    subgraph N1["Node 1 in Zone A"]
      K1["Kubelet"]
      P1["Pods"]
    end
    subgraph N2["Node 2 in Zone B"]
      K2["Kubelet"]
      P2["Pods"]
    end
    subgraph N3["Node 3 in Zone C"]
      K3["Kubelet"]
      P3["Pods"]
    end
  end
  API --> K1
  API --> K2
  API --> K3
  LB --> P1
  LB --> P2
  LB --> P3
Figure 1: High-level GKE architecture. Google runs the control plane; your pods run on nodes spread across zones inside your own VPC network.

Read the figure from the top. A developer or an automated pipeline sends a request to the API server. The control plane records the plan and tells the kubelets on the nodes what to run. Meanwhile, real users arrive through a Google Cloud load balancer, which spreads their traffic across pods in different zones. A zone is one isolated data center area inside a Google Cloud region, so spreading across three zones protects you if one zone has trouble.

Where GKE connects to the rest of Google Cloud

NeedGoogle Cloud service GKE uses
Virtual machines for nodesCompute Engine
Private networkVirtual Private Cloud (VPC)
Public entry pointCloud Load Balancing
Container image storageArtifact Registry
Disks for dataPersistent Disk and Hyperdisk
Shared file storageFilestore
Logs and metricsCloud Logging and Cloud Monitoring
PermissionsCloud IAM
i
Good to know

A cluster can be zonal (one control plane in one zone) or regional (control plane copies spread across three zones). Regional is the choice for anything important, because losing a single zone will not take the brain offline.

4Autopilot vs Standard Mode

The first big decision when you create a cluster is who manages the worker nodes: you, or Google.

Standard mode

In Standard mode, Google manages the control plane, but you manage the nodes. You choose the machine type, the size of each group of nodes (called a node pool), the disk type, and how the pool scales. You get deep control, and you pay for the whole virtual machine whether it is busy or idle.

Autopilot mode

In Autopilot mode, Google manages both the control plane and the nodes. You simply describe your pods and how much CPU and memory each one needs. Google finds or creates the right capacity automatically, applies security best practices, and bills you for the resources your pods request rather than for entire machines.

Everyday analogy

Standard mode is like renting a car. You pick the model, you fill the tank, and you pay for the days you hold the keys, even if the car sits parked. Autopilot is like taking a taxi. You say where you want to go, someone else handles the car, and you pay for the trip you actually took.

TopicAutopilotStandard
Who manages nodesGoogleYou
Billing basisResources requested by podsWhole node virtual machines
Node upgrades and repairsAutomatic, built inConfigurable by you
Security defaultsHardened and enforcedMostly your choice
Custom machine choicesChosen through compute classesFull control of machine types
Special system access on nodesRestrictedAllowed where needed
Best forMost teams that want less operations workTeams with special hardware or tuning needs

Autopilot strengths

  • Much less operational work
  • Pay only for requested pod resources
  • Strong security defaults out of the box
  • Automatic capacity as pods appear

Autopilot limits

  • Some privileged and low-level node features are blocked
  • Less freedom to hand-pick every machine detail
  • Pods that request too much waste money
  • Some special workloads still fit Standard better

Google now recommends Autopilot as the starting point for most new clusters. Autopilot offers compute classes, which are ready-made choices for different jobs, such as general-purpose work, balanced work, scale-out work, and accelerated work for GPUs. You pick a class by label and Google supplies matching hardware.

!
Watch out

In Autopilot you pay for what your pods ask for, not what they actually use. If a pod asks for four CPUs and uses only half of one, you still pay for four. Right-sizing requests is the single most important cost habit in Autopilot.

5How GKE Works Internally

Let us follow what really happens from the moment you say “run my app” to the moment users can reach it.

Many people imagine that Kubernetes runs your app the instant you ask. In truth, it is a chain of small, polite conversations between separate programs. Nobody gives direct orders. Each piece watches the API server and acts when something changes. This design is called a watch and react model, and it is why Kubernetes is so resilient.

1

You declare your wish

You submit a deployment that says which container image to run and how many copies you want. The API server checks your identity and permissions, then saves your request in the state store.

2

The deployment controller reacts

A controller notices the new deployment, creates a ReplicaSet, and the ReplicaSet creates the pods. At this moment the pods exist on paper but have no home yet.

3

The scheduler picks a node

The scheduler sees pods without a node. It filters out nodes that are too full or break a rule, then scores the rest and picks the best fit. It writes its choice back to the API server.

4

The kubelet starts the pod

The kubelet on the chosen node sees a pod assigned to it. It pulls the container image from Artifact Registry, sets up networking and storage, and starts the containers.

5

Health checks begin

The kubelet runs probes, which are tiny checks asking the app, “Are you alive? Are you ready for visitors?” Only ready pods receive traffic.

6

Traffic is connected

The service and load balancer learn the pod’s address and start sending requests to it. Users now reach your app.

sequenceDiagram
  participant D as Developer
  participant A as API Server
  participant S as Scheduler
  participant K as Kubelet on Node
  participant R as Artifact Registry
  D->>A: Submit Deployment
  A->>A: Save desired state
  A->>S: New pods need a node
  S->>A: Assign pod to chosen node
  A->>K: Run this pod
  K->>R: Pull container image
  R-->>K: Image layers
  K->>A: Report pod is Running
Figure 2: The life of a deployment request, from the developer to a running pod.

What about when something breaks?

Because every part keeps watching, repair is automatic. If a container crashes, the kubelet restarts it. If a whole node stops reporting, the node controller marks it unhealthy after a short wait, and the pods that lived there are recreated on other nodes. On GKE, node auto-repair goes one step further: it replaces the broken machine itself so the cluster returns to full strength.

i
Tip

Always give your apps readiness probes. Without them, Kubernetes may send visitors to a pod that has started but is still warming up, and those visitors will see errors.

6Data Flow and Lifecycle

Two journeys matter: the journey of a pod from birth to retirement, and the journey of a user request from the internet to your code.

The life of a pod

A pod is not immortal. It is born, it works, and it eventually goes away. Understanding each stage helps you debug problems quickly.

Stage 1

Pending

The pod has been accepted but is not running yet. It may be waiting for a node, or waiting for its image to download. In Autopilot, this is also when Google may be creating new capacity.

Stage 2

Running

At least one container has started. Health probes decide whether the pod is also ready for traffic.

Stage 3

Succeeded or Failed

Pods that run a one-time task end here. Succeeded means every container finished cleanly. Failed means at least one stopped with an error.

Stage 4

Terminating

When a pod is told to stop, Kubernetes sends it a polite warning first. The app gets a short grace period to finish current work, and then it is removed.

!
Watch out

Pods are disposable. Never store important data only inside a pod’s own filesystem. When the pod goes away, that data goes with it. Use a persistent volume or an external database instead.

The life of a rolling update

When you release a new version, a deployment does not switch everything at once. It uses a rolling update. It starts a few new pods, waits until they are ready, then removes a few old pods, and repeats. At every moment, enough healthy pods are serving users. If the new version fails its health checks, the rollout pauses, and you can roll back to the previous version.

Everyday analogy

Changing the crew of a ferry while it is crossing the river would be silly. Instead, imagine a relay race: the new runner starts jogging beside the old runner, takes the baton, and only then does the old runner step off the track. The race never stops.

The journey of a request

Now follow a customer who opens your shopping website:

  1. The browser looks up your domain name and receives the address of a Google Cloud load balancer.
  2. The load balancer receives the request at one of Google’s edge locations and chooses a healthy backend.
  3. The request travels into your VPC network and reaches a pod, often directly, thanks to a feature called container-native load balancing.
  4. The web pod needs product data, so it calls an internal service by name. Cluster DNS turns that name into the service’s steady address.
  5. The service forwards the call to one of several healthy backend pods.
  6. The backend pod reads from a database, such as Cloud SQL or Spanner, and returns the answer along the same path.

Every step in this chain is designed so no single part is a single point of failure. That is the heart of reliable system design.

7Networking in GKE

Networking is where most beginners feel lost. We will take it one layer at a time.

Every pod gets its own address

Kubernetes has a simple rule: every pod gets its own IP address, and every pod can talk to every other pod without tricks. GKE clusters are VPC-native, which means pod addresses come from a special range inside your Google Cloud network called an alias IP range. Because the addresses are real VPC addresses, other Google Cloud services can reach pods directly, and firewall rules and routing work naturally.

When you create a cluster, you plan three address ranges: one for the nodes, one for the pods, and one for services. Planning these with enough room is important, because running out of addresses is painful to fix later.

Services: a steady phone number

Pod addresses change whenever pods are replaced. A Service solves that by giving a group of pods one fixed address and one DNS name. There are three common kinds:

  • ClusterIP: Reachable only inside the cluster. This is the default and is perfect for internal calls between microservices.
  • NodePort: Opens a port on every node. It is rarely used directly in GKE.
  • LoadBalancer: Asks Google Cloud to create a real load balancer with a public or private address that sends traffic to your pods.

Getting visitors in: Ingress and Gateway

For websites and APIs, you usually want smarter routing than one load balancer per service. You want rules such as “requests for /shop go to the shop service, and requests for /pay go to the payment service.” GKE offers two ways to describe such rules:

  • Ingress: The older, simpler standard. GKE turns it into a Google Cloud HTTP(S) load balancer.
  • Gateway API: The newer, more expressive standard that Kubernetes is moving toward. It separates the job of the platform team, who own the gateway, from the app teams, who own the routes. It also supports traffic splitting, which helps with gradual rollouts.

Container-native load balancing

Older load balancers sent traffic to a node, and then the node forwarded it again to a pod, which added an extra hop. With network endpoint groups (NEGs), the Google load balancer learns the pod addresses and sends traffic straight to the pod. This reduces delay and spreads load more evenly.

flowchart LR
  U["Internet Users"] --> GLB["Google Cloud Load Balancer"]
  GLB --> NEG1["NEG in Zone A"]
  GLB --> NEG2["NEG in Zone B"]
  NEG1 --> PA1["Web Pod A1"]
  NEG1 --> PA2["Web Pod A2"]
  NEG2 --> PB1["Web Pod B1"]
  NEG2 --> PB2["Web Pod B2"]
  PA1 --> SVC["Internal Service ClusterIP"]
  PA2 --> SVC
  PB1 --> SVC
  PB2 --> SVC
  SVC --> BE["Backend Pods"]
Figure 3: Traffic path using container-native load balancing. The load balancer sends requests straight to pods, and pods call internal services by a steady address.

Dataplane V2 and network policy

By default, any pod can talk to any other pod. That is convenient but risky. A network policy is a rule set that says which pods may talk to which. For example, only the checkout pods may talk to the payment pods. GKE’s Dataplane V2 enforces these rules using eBPF, a modern technology built into the operating system kernel that is fast and gives better visibility into traffic.

Private clusters and outbound traffic

In a private cluster, nodes have only internal addresses and cannot be reached from the public internet. If those nodes need to download things from outside, you use Cloud NAT, which lets machines make outbound requests without being reachable from outside. You can also limit who can reach the control plane by using authorized networks, which act like a guest list for the API server.

GoalFeature to use
Internal calls between appsClusterIP Service and cluster DNS
Public website or API with smart rulesGateway API or Ingress
Lower delay for load balancer trafficContainer-native load balancing with NEGs
Limit which pods can talkNetwork policy with Dataplane V2
Hide nodes from the internetPrivate cluster plus Cloud NAT
Protect the control plane addressAuthorized networks

8Storage and Stateful Workloads

Containers forget everything when they stop. To keep data, you need storage that lives outside the pod.

How storage is requested

Your app does not ask for a specific disk. Instead it creates a PersistentVolumeClaim, which is a polite request: “I need 100 gigabytes of fast storage.” A StorageClass describes the type of disk to create, and GKE’s CSI driver (a standard plug-in for storage) creates the real Google Cloud disk and attaches it to the right node. This is called dynamic provisioning, and it means no human has to create disks by hand.

Choices of storage

Block

Persistent Disk and Hyperdisk

Disks that behave like a hard drive plugged into one node. Good for databases and single-writer apps. Different types balance cost and speed.

File

Filestore

A shared network file system that many pods can read and write at the same time, like a shared office folder.

Object

Cloud Storage with FUSE

Lets pods see a Cloud Storage bucket as if it were a folder. Popular for machine learning data and large files.

Temporary

Local SSD and ephemeral volumes

Very fast scratch space that disappears when the pod or node goes away. Great for caches and temporary work.

Running databases on GKE

You can run databases inside GKE using a StatefulSet. Each pod keeps a stable name, such as db-0, db-1, and its own disk that follows it around. Many companies also use operators, which are special programs that know how to run a certain database, handling backups and failover automatically.

However, a very common design choice is to keep the cluster for stateless apps and use managed databases such as Cloud SQL, AlloyDB, Spanner, or Firestore for data. Then the cluster can be replaced or resized freely, and Google handles database backups and patches.

i
Tip

A disk lives in one zone. If you run a regional cluster, make sure a stateful pod can only be scheduled in the zone where its disk exists, and consider regional disks or replication for stronger protection.

Everyday analogy

A pod is like a hotel room guest, and a persistent disk is like a locker in the lobby. The guest can check out, and a new guest can check in, but the locker with your belongings stays safe and gets handed back to you when you return.

9Scaling: Pods, Nodes and Beyond

Scaling means adding or removing capacity to match demand. GKE can do it at two levels, and often both together.

Level one: scale the pods

  • Horizontal Pod Autoscaler (HPA): Adds or removes copies of a pod based on measurements such as CPU use, memory use, or a custom number like requests per second. More visitors means more copies.
  • Vertical Pod Autoscaler (VPA): Adjusts how much CPU and memory each pod asks for. It is helpful when you are unsure about the right size.

Level two: scale the nodes

  • Cluster Autoscaler (Standard mode): When pods cannot be scheduled because nodes are full, it adds nodes to a node pool. When nodes sit mostly empty, it removes them.
  • Node auto-provisioning: Goes further by creating whole new node pools with the right machine shape automatically.
  • Autopilot: You do not think about nodes at all. Google adds capacity when pods appear.
flowchart TD
  M["Metrics: CPU, memory, custom"] --> HPA["Horizontal Pod Autoscaler"]
  HPA -->|"adds pod copies"| PODS["More Pods Requested"]
  PODS -->|"nodes are full"| PEND["Pending Pods"]
  PEND --> CA["Cluster Autoscaler or Autopilot"]
  CA -->|"adds capacity"| NODES["New Nodes Ready"]
  NODES -->|"pods get scheduled"| RUN["Pods Running and Serving"]
Figure 4: The two-level scaling chain. Pod autoscaling asks for more copies, and node scaling makes room for them.
Everyday analogy

Think of a theater. When the crowd grows, the pod autoscaler is the ticket seller adding more people to the show. But if every seat is full, someone must open a new balcony. That is the node autoscaler. Both must work together, or guests will be left standing in the hall.

Other helpful scaling tools

  • Spot VMs: Discounted machines that Google may reclaim at short notice. Perfect for fault-tolerant jobs such as batch processing.
  • Pod disruption budgets: A promise that says, “During upgrades or scale-downs, never take away more than one of my web pods at a time.”
  • Multidimensional scaling: Combines horizontal and vertical ideas so apps can scale on more than one signal.
  • Pod topology spread: Tells the scheduler to spread copies across zones and nodes, so one failure cannot take them all.

Scaling for AI and heavy computing

GKE supports nodes with GPUs and Google’s own TPUs, which are chips built for machine learning. Teams use these for training models, running inference, and batch simulations. Features such as GPU sharing, queued capacity requests, and compact placement help use these expensive machines wisely.

!
Watch out

Autoscaling only works if pods declare their CPU and memory requests. Without requests, the scheduler and the autoscalers are blind, and the cluster can behave in surprising ways.

10High Availability, Reliability and Upgrades

A good cloud system is not one that never fails. It is one that keeps serving customers when parts of it fail.

Layers of protection

  • Regional control plane: Control plane copies live in three zones, so the brain survives a zone outage and can be upgraded without downtime.
  • Multi-zone nodes: Spread node pools over several zones so your app has hands in more than one building.
  • Node auto-repair: GKE checks node health and replaces unhealthy machines on its own.
  • Probes and restarts: Kubernetes restarts failed containers and stops sending traffic to pods that are not ready.
  • Multiple replicas: Running at least two or three copies of every important service avoids single points of failure.

Google publishes uptime commitments for GKE. At the time of writing, a regional cluster’s control plane carries a 99.95 percent monthly target, and a zonal cluster carries a lower one. Autopilot also has a commitment for pods spread across zones. These numbers can change, so always read the current service level agreement before you promise anything to your own customers.

Upgrades without drama

Kubernetes releases a new minor version about three times a year, and each version is supported for a limited time. Falling behind means losing security fixes. GKE helps through release channels:

ChannelWhat it meansGood for
RapidNewest versions firstTesting early and learning what is coming
RegularA balance of new features and proven stabilityMost production clusters
StableVersions that have been in use for longerRisk-averse workloads
ExtendedLonger support for a versionTeams that upgrade less often

Controlling when upgrades happen

You can set maintenance windows, which are preferred hours when upgrades may happen, such as Sunday at 2 AM. You can also set maintenance exclusions, which block upgrades during sensitive times like a holiday sales event. For node pools, GKE supports surge upgrades, which add a few extra nodes before replacing old ones, and blue-green upgrades, which build a full second set of nodes and switch over only when it is healthy, keeping the old set ready for a quick return.

Everyday analogy

Upgrading a cluster is like repainting an apartment building while people still live there. You do it floor by floor, at hours that suit the residents, and you keep an elevator running the whole time. Nobody should notice the building was painted until the work is done.

Designing for disaster

For very important systems, one region may not be enough. Teams run clusters in two or more regions and use a global load balancer to send users to the closest healthy one. Multi-cluster services and multi-cluster gateways help traffic cross clusters, and fleets let you manage many clusters as a group. Backups of cluster state and persistent data, such as Backup for GKE, protect against mistakes like an accidental delete.

11Security in GKE

Security works best in layers, like a castle with a moat, walls, guards, and locked rooms. GKE offers a layer for each part of that castle.

Who you are: identity and access

  • Cloud IAM: Controls who can create, change, or delete clusters in Google Cloud.
  • Kubernetes RBAC: Controls what a person or program can do inside a cluster, such as reading pods in one namespace but not another. Use the principle of least privilege, which means giving only the permissions that are truly needed.
  • Workload Identity Federation for GKE: Lets a pod act as a specific Google Cloud service account without storing any password or key file. The pod proves who it is, and Google hands it short-lived access. This replaces the risky habit of copying key files into pods.

The cluster itself

  • Private clusters and authorized networks: Keep nodes and the control plane away from the public internet.
  • Shielded GKE nodes: Use secure boot and integrity checks so nodes can prove they have not been tampered with.
  • Container-Optimized OS: A minimal, hardened operating system with a small attack surface.
  • GKE Sandbox: Uses gVisor to give extra isolation for untrusted code, like a thick glass wall between a risky workload and the node.

The software you run

  • Artifact Registry with vulnerability scanning: Checks container images for known security holes.
  • Binary Authorization: A gate that only lets signed and approved images run in your cluster, like a security guard checking badges at the door.
  • Pod Security Standards: Rules that stop dangerous pod settings, such as running as the all-powerful root user.
  • Secrets management: Store passwords in Secret Manager or encrypt Kubernetes Secrets with your own keys from Cloud KMS, instead of leaving them in plain files.

Watching for trouble

The security posture dashboard in GKE scans your workloads and clusters for common mistakes and known weaknesses, and gives plain recommendations. Audit logs record who did what, so you can investigate after something strange happens.

i
Shared responsibility

Google secures the control plane and the underlying data centers. You secure what you put on top: your images, your permissions, your network rules, and your secrets. Knowing where that line sits is one of the most common cloud interview topics.

Everyday analogy

Renting an apartment in a secure building is a good comparison. The landlord guards the front gate and maintains the walls. You still have to lock your own door and decide who gets a spare key.

12Monitoring, Logging and Metrics

You cannot fix what you cannot see. GKE connects to Google Cloud’s observability tools with very little setup.

The three pillars

Pillar 1

Logs

Written messages from your apps and from Kubernetes itself. GKE sends them to Cloud Logging, where you can search and filter across the whole cluster in one place.

Pillar 2

Metrics

Numbers over time, such as CPU use, memory, request count, and error rate. Cloud Monitoring collects them and draws dashboards.

Pillar 3

Traces

A trace follows one request as it hops across many services, showing where time is spent. Cloud Trace helps find slow spots.

Bonus

Managed Prometheus

Prometheus is a popular open-source metrics tool. Google Cloud Managed Service for Prometheus lets you use it without running the heavy storage yourself.

What to watch

  • The golden signals: latency (how slow), traffic (how much), errors (how often things fail), and saturation (how full things are).
  • Pod health: restart counts, pods stuck in Pending, and failing probes.
  • Node health: CPU and memory pressure, disk space, and node readiness.
  • Autoscaler activity: how often it scales, and whether any pods are waiting for capacity.
  • Control plane signals: API server latency and error rates, which tell you whether the brain is under stress.

Alerts that matter

Good alerts wake people up only for real customer pain. An alert like “error rate above two percent for five minutes” is useful. An alert like “one pod restarted once” is noise. Tie alerts to service level objectives (SLOs), which are clear targets such as “99.9 percent of requests succeed.” Cloud Monitoring can track SLOs and the error budget, which is the amount of failure you can still afford this month.

i
Tip

Use structured logs, where each log line carries labeled fields such as user, request ID, and status. They are far easier to search than free-form sentences.

13Pricing and Cost Control

The cloud is pay-as-you-go. That is a gift when you manage it well and a surprise bill when you do not.

What you pay for

  • Cluster management fee: At the time of writing, GKE charges a small hourly fee per cluster, about ten cents per hour, in both modes. Google also gives a monthly credit that covers this fee for one zonal or Autopilot cluster per billing account. Check the current pricing page for exact numbers.
  • Compute: In Standard mode, you pay for the virtual machines in your node pools. In Autopilot, you pay for the CPU, memory, and storage your pods request.
  • Storage: Disks, file shares, and buckets are billed separately.
  • Networking: Load balancers, data leaving Google Cloud, and traffic between zones can add up quietly.
  • Extras: Logging volume, managed Prometheus samples, and the GKE Enterprise edition, which adds multi-cluster management and extra security features and is priced per vCPU.
Savings

Right-size requests

Measure real usage and set CPU and memory requests close to it. Oversized requests are the largest source of waste.

Savings

Use Spot VMs

Run restartable and batch workloads on discounted machines that can be reclaimed at short notice.

Savings

Commit for steady load

Committed use discounts reduce the price when you know you will need a base amount of capacity for a year or more.

Savings

Scale to zero for tests

Development and test clusters do not need to run overnight. Shrink them or shut them down on a schedule.

Savings

Mind your logs

Verbose debug logs from thousands of pods become a large bill. Keep the useful lines and drop the noise.

Savings

Keep traffic local

Cross-zone and cross-region data transfer costs money. Place chatty services close together where safe.

i
Tip

Turn on cost allocation and label your namespaces and workloads by team. When every team can see its own share of the bill, spending becomes a shared habit and not a monthly mystery.

14Design Patterns and Anti-Patterns

Patterns are proven recipes. Anti-patterns are tempting shortcuts that hurt later.

Helpful patterns

Sidecar

Place a small helper container next to your main container inside the same pod. The helper may collect logs, handle encryption, or manage network traffic. Like a motorcycle sidecar, it rides along and shares the journey.

Init container

A short-lived container that runs and finishes before the main app starts. It might wait for a database or download configuration. It is like the stagehand who sets the stage before the actors walk on.

Operator

A custom controller that encodes the knowledge of a human expert. A database operator knows how to back up, fail over, and upgrade a database, so you do not have to do it by hand.

GitOps

Store the desired state of the cluster in a Git repository, and let an automated tool keep the cluster matching it. Every change has an author, a review, and a history, and rollback is as simple as going back one step in Git.

Canary and blue-green releases

Send a tiny share of traffic, say five percent, to the new version first. If metrics look good, grow the share. Blue-green keeps two full copies and switches all traffic at once. Both limit the damage of a bad release.

Service mesh

A layer, such as Cloud Service Mesh, that handles encryption between services, retries, timeouts, and traffic rules without changing the application code. It acts like a traffic-control system for service-to-service calls.

Namespace multi-tenancy

Give each team a namespace with its own quotas, permissions, and network rules, so many teams can safely share one cluster and one bill.

Common anti-patterns

ANTI-PATTERN 01Avoid
What it looks like

Pods run with no CPU or memory requests and no limits.

Why it hurts

The scheduler cannot place pods wisely, autoscalers cannot decide properly, and one greedy pod can starve its neighbors.

Better approach

Measure real usage, set requests close to it, and set sensible limits. Use the Vertical Pod Autoscaler to learn good values.

ANTI-PATTERN 02Avoid
What it looks like

Using the latest tag for container images in production.

Why it hurts

You cannot tell which version is running, rollbacks become guesswork, and two pods may run different code with the same tag.

Better approach

Use fixed version tags or, even better, image digests, which are unique fingerprints of an exact image.

ANTI-PATTERN 03Avoid
What it looks like

Storing service account key files inside images or Secrets.

Why it hurts

Long-lived keys leak easily and are hard to rotate. One leak can expose your whole project.

Better approach

Use Workload Identity Federation for GKE so pods receive short-lived access with no files to protect.

ANTI-PATTERN 04Avoid
What it looks like

One giant cluster and one giant namespace for everything, with everyone as an administrator.

Why it hurts

A single mistake can affect every team, and nobody knows who owns what or who caused a problem.

Better approach

Separate environments such as development, staging, and production. Use namespaces, quotas, and least-privilege RBAC inside each.

ANTI-PATTERN 05Avoid
What it looks like

Treating pods like pets: logging in to fix them by hand and keeping important files inside them.

Why it hurts

The next restart erases your changes, and nobody can repeat the setup.

Better approach

Treat pods like cattle: identical, replaceable, and created from a recipe. Fix the recipe, not the pod.

15Best Practices and Common Mistakes

These habits come from years of clusters that stayed up and clusters that did not.

Do this

  • Choose Autopilot unless you have a clear reason for Standard
  • Use regional clusters for production
  • Pick the Regular release channel and set maintenance windows
  • Run at least two or three replicas of each important service
  • Add readiness and liveness probes to every app
  • Set pod disruption budgets for critical services
  • Use private clusters, least-privilege RBAC and Workload Identity
  • Store configuration and manifests in Git
  • Define SLOs and alert on customer-facing symptoms

Do not do this

  • Run production in a single zone with a single replica
  • Expose the control plane to the whole internet
  • Ignore upgrades until a version is out of support
  • Skip resource requests
  • Give every developer cluster-admin rights
  • Pull images from random public sources without scanning
  • Keep state only inside pods
  • Plan address ranges too small and run out of IPs
  • Alert on every tiny event until nobody reads alerts

Mistakes that surprise beginners

  • Pods stuck in Pending. Usually the cause is requests that are larger than any node can offer, a missing quota, or a rule that no node satisfies. The pod’s event messages explain the reason in plain words.
  • CrashLoopBackOff. The container keeps starting and failing. Look at its logs and check that its settings and secrets are correct.
  • ImagePullBackOff. The node cannot download the image. Check the image name, the registry permissions, and whether a private node has a route to the registry.
  • Surprise bills. Often caused by oversized requests, forgotten test clusters, unused load balancers, or very chatty logs.
  • Zone-bound disks. A stateful pod cannot start in a zone that does not hold its disk.
  • Upgrade pain. Old API versions get removed in newer Kubernetes releases. Test upgrades in a staging cluster first and read deprecation warnings early.
i
Tip

Create a simple production readiness checklist for your team: replicas, probes, requests, budgets, alerts, backups, and a rollback plan. Run through it before any service goes live.

16Real-World and Industry Examples

Seeing how real teams use GKE makes the ideas stick.

Niantic and Pokémon GO

When Pokémon GO launched in 2016, far more people showed up than the team had planned for. Public accounts from Google and Niantic describe traffic reaching many times the original estimate. The game’s back end ran on Google’s container platform, whose ability to add capacity quickly helped the service survive that surge. The lesson: design for sudden, unpredictable growth, because success itself can be your biggest load test.

Spotify

Spotify has publicly described moving its many small back-end services to Kubernetes on Google Cloud, and it created the open-source developer portal Backstage to help hundreds of engineering teams find and manage their services. The lesson: when many teams share one platform, a standard way to build, deploy, and discover services matters as much as the cluster itself.

Google’s own services

Google has long said that it runs its products on containers at huge scale, and Kubernetes grew from that internal experience with Borg. GKE brings the same ideas, such as automatic placement, health-based restarts and fast scaling, to outside customers. The lesson: these are battle-tested ideas, not fashion.

Common industry patterns

IndustryTypical GKE useKey feature relied on
Online retailWeb storefronts that must survive holiday spikesHorizontal Pod Autoscaler and regional clusters
Media and gamingSession servers and matchmakingFast node scaling and global load balancing
FinancePayment APIs and risk checksPrivate clusters, network policy, Binary Authorization
Healthcare and scienceData pipelines and batch analysisJobs, Spot VMs, and GPU nodes
AI and machine learningModel training and servingGPUs, TPUs, and queued capacity
Software companiesInternal developer platformsNamespaces, GitOps, and fleets
The best platform is the one your engineers can forget about while it quietly keeps customers happy.

17Frequently Asked Questions

Quick answers to the questions people ask most.

Q1Is GKE the same as Kubernetes?
No. Kubernetes is the open-source software. GKE is Google Cloud’s managed service that runs Kubernetes for you and connects it to other Google Cloud products.
Q2Should I pick Autopilot or Standard?
Start with Autopilot for most apps. Choose Standard when you need deep control of machine types, special node settings, or software that needs privileged access to nodes.
Q3What is the difference between a pod and a container?
A container is one packaged app. A pod is a small wrapper that holds one or more containers sharing the same network address and storage. Kubernetes schedules pods, not bare containers.
Q4Who manages the control plane?
Google. It patches, scales, and repairs the control plane. You only decide things like the version channel and maintenance windows.
Q5What happens if a node fails?
Kubernetes notices the node stopped reporting and recreates its pods on healthy nodes. With node auto-repair, GKE also replaces the broken machine.
Q6Can GKE run databases?
Yes, using StatefulSets, persistent disks, and often operators. Many teams still prefer managed databases like Cloud SQL or Spanner so Google handles backups and patching.
Q7How do I make an app reachable from the internet?
Create a Service of type LoadBalancer for simple cases, or use Gateway API or Ingress for rule-based routing. GKE builds the Google Cloud load balancer for you.
Q8How does GKE keep upgrades safe?
Through release channels, maintenance windows and exclusions, rolling or blue-green node upgrades, and pod disruption budgets that protect your app during the process.
Q9Can I use GKE across several clouds or on-premises?
Through GKE Enterprise and fleet features, Google lets you manage clusters in several places with shared policies. The details depend on your edition and setup, so check the current documentation.
Q10How can I reduce my GKE bill?
Right-size pod requests, use Autopilot or autoscaling so you do not pay for idle machines, run fault-tolerant work on Spot VMs, commit to steady usage, and trim noisy logs.
Q11Is GKE secure by default?
It has strong defaults, especially in Autopilot, but security is shared. You still need to control permissions, scan images, restrict network access, and protect secrets.
Q12What is the best way to learn GKE?
Create a small Autopilot cluster, deploy a simple web app, expose it through a load balancer, break it on purpose, and watch how Kubernetes repairs it. Hands-on practice teaches faster than reading.

18Summary and Key Takeaways

You have now seen GKE from the first container to a multi-region platform. Here is the whole story in one place.

Key Takeaways

  • GKE is managed Kubernetes. Google runs the control plane, and in Autopilot mode it runs the nodes too, so you focus on your applications.
  • Desired state is the core idea. You describe what you want, and Kubernetes keeps comparing and fixing until reality matches your wish.
  • Choose the mode wisely. Autopilot gives less work and strong defaults, while Standard gives more control over machines.
  • Design for failure. Use regional clusters, several replicas, probes, auto-repair, and pod disruption budgets to survive problems quietly.
  • Scale at two levels. Pod autoscaling adds copies, and node scaling adds room, so both must be configured and requests must be set correctly.
  • Secure every layer. Use private clusters, least-privilege access, Workload Identity, image scanning, and network policy, and remember the shared responsibility line.
  • Watch and control cost. Observe golden signals, define SLOs, right-size requests, and use Spot VMs and commitments where they fit.