GKE (Google Kubernetes Engine)


GKE (Google Kubernetes Engine) - Quick Study Notes

Why GKE?

Managing a Kubernetes cluster manually is complex:

  • You must set up control plane components.
  • Handle node failures and maintenance.
  • Manage upgrades, scaling, and repairs.

GKE is Google's managed Kubernetes service that automates much of this operational work.


GKE Modes

1. Autopilot Mode (Recommended)

Google manages:

  • Control plane
  • Nodes and node pools
  • Autoscaling
  • Auto-upgrades
  • Auto-repairs
  • Security baselines
  • Networking baselines

Benefits:

  • Less operational overhead
  • SRE-managed infrastructure
  • Optimized scaling and security
  • Focus on applications, not cluster maintenance

✅ Google's recommendation: Use Autopilot unless you need deep infrastructure control.


2. Standard Mode

You manage:

  • Node configuration
  • Node pools
  • Upgrades
  • Scaling decisions
  • Infrastructure optimization

Benefits:

  • More customization
  • Greater control over cluster behavior

Tradeoff:

  • More operational responsibility

How GKE Simplifies Kubernetes

In a self-managed cluster:

  • You provision and maintain the control plane.

In GKE:

  • Google manages all control plane components.
  • You still interact through the Kubernetes API endpoint.
  • Control plane infrastructure is hidden from you.

Nodes in GKE

What are Nodes?

Worker machines that run Pods.

In GKE:

  • Google automatically creates Compute Engine VMs.
  • Registers them as Kubernetes nodes.
  • Node settings can be managed through Google Cloud Console.

Pricing

You pay for:

  • Worker nodes (VMs)

You do not pay separately for control plane management in the context discussed.


Node Machine Types

Default:

  • e2-medium
    • 2 vCPUs
    • 4 GB RAM

You can customize:

  • CPU count
  • Memory
  • CPU platform generation

Minimum CPU Platform

You can specify a baseline CPU generation.

Benefit:

  • Improved and predictable performance.
  • GKE will never use an older CPU generation.

Node Pools

What is a Node Pool?

A group of nodes sharing the same configuration.

Examples:

  • Same memory size
  • Same CPU generation
  • Same machine type

Uses:

  • Separate workloads based on hardware needs.
  • Run specific applications on specialized nodes.

Node Pools are a GKE feature, not a native Kubernetes feature.

Features at Node Pool Level

  • Automatic upgrades
  • Automatic repairs
  • Cluster autoscaling

Resource Reservation

Not all node resources are available to Pods.

Some CPU and memory are reserved for:

  • Kubernetes components
  • GKE system services

Example:

  • A 15 GB node provides slightly less than 15 GB to workloads.

Default Cluster Configuration

A newly created cluster typically has:

  • Single zone
  • 3 identical nodes
  • 1 node pool

You can add or remove nodes later.


Improving Availability

More Nodes + More Replicas

Benefits:

  • Better fault tolerance
  • Better workload distribution

Problem:

  • Doesn't help if the entire zone fails.

Regional Clusters

What Are They?

A regional cluster spreads:

  • Control planes
  • Nodes

Across multiple zones within the same region.

Benefits

If one zone fails:

  • Applications remain running.
  • Control plane remains available.

Default layout:

  • 3 zones
  • 1 control plane per zone
  • 3 nodes per zone

Example:

  • 5 nodes/zone × 3 zones = 15 total nodes

⚠️ Important:

  • Zonal → Regional conversion is not supported.
  • Regional → Zonal conversion is not supported.

Choose carefully at creation time.


Private Clusters

A private cluster hides:

  • Control plane
  • Nodes

From the public internet.

Access Options

Internal Access

Google services can access through internal IPs:

  • Cloud Monitoring
  • Cloud Logging

Authorized Networks

External access is limited to trusted IP ranges.

These trusted ranges are called:

Authorized Networks


Private Google Access

Allows nodes without external IP addresses to communicate with Google services.

Example:

  • Pull container images from Google Container Registry.
  • Access Google Cloud services privately.

Interview Cheat Sheet

Q: Difference between Autopilot and Standard GKE?

  • Autopilot: Google manages infrastructure, scaling, upgrades, repairs.
  • Standard: Customer manages node infrastructure and configuration.

Q: What is a Node Pool?

  • A group of nodes with identical configuration.
  • Used to run workloads on specific hardware profiles.

Q: Why use Regional Clusters?

  • Higher availability.
  • Survives zone failures.
  • Control plane and nodes are spread across multiple zones.

Q: What is a Private Cluster?

  • Cluster components are not exposed publicly.
  • Access is restricted through internal networking and authorized IP ranges.

Q: Does all node memory go to Pods?

  • No. Some CPU and memory are reserved for Kubernetes and GKE system components.

One-Line Summary

GKE removes much of the operational burden of Kubernetes by managing the control plane and, in Autopilot mode, even the nodes, while providing advanced features such as node pools, autoscaling, regional high availability, and private networking.

Comments

Popular posts from this blog

Async/await

Valid Parentheses

kafka