GKE (Google Kubernetes Engine)

 

GKE (Google Kubernetes Engine) - Easy Notes & Interview Summary

What is GKE?

Google Kubernetes Engine (GKE) is Google's fully managed Kubernetes service that allows you to deploy, manage, and scale containerized applications on Google Cloud without managing the underlying Kubernetes infrastructure.


Remember the difference:

  • Kubernetes: The system that manages containerized applications.

  • GKE: Google Cloud's service that helps you run Kubernetes without having to manage all the underlying infrastructure yourself.

Real-world example

Suppose you have a Java Spring Boot application with a PostgreSQL database, and you want to deploy it to the cloud.

Without GKE, you might need to install and maintain Kubernetes yourself, manage cluster machines, handle upgrades, and configure recovery.

With GKE, Google manages many of these infrastructure and Kubernetes operations for you, depending on the operating mode you select.


Why GKE?

Imagine you're running Kubernetes yourself:

  • Need to create and manage VMs
  • Install Kubernetes
  • Upgrade clusters
  • Monitor node health
  • Replace failed nodes
  • Handle scaling

This creates significant operational overhead.

GKE removes this burden by managing Kubernetes for you.


Key Features of GKE

1. Fully Managed Kubernetes

Google manages:

  • Kubernetes control plane
  • Cluster setup
  • Infrastructure maintenance
  • Upgrades
  • High availability

Benefit: Focus on applications, not infrastructure.


2. Container-Optimized OS

GKE nodes run a Google-maintained:

Container-Optimized Operating System (COS)

Characteristics:

  • Lightweight
  • Secure
  • Minimal resource usage
  • Fast startup time
  • Optimized for containers

3. GKE Autopilot

Autopilot is a hands-off mode where Google manages:

  • Nodes
  • Scaling
  • Security settings
  • Cluster configuration
  • Best practices

Traditional Kubernetes

You manage:
✓ Nodes
✓ Scaling
✓ Patching
✓ Security
✓ Upgrades

GKE Autopilot
Google manages:
✓ Nodes
✓ Scaling
✓ Security
✓ Upgrades

You manage:
✓ Applications

Interview One-Liner:

GKE Autopilot is a fully managed Kubernetes mode where Google handles infrastructure operations and developers focus only on deploying workloads.


4. Nodes

A Node is a VM that runs containers.

GKE Cluster

 ├── Node 1

 │    ├── Pod A

 │    └── Pod B

 ├── Node 2

 │    └── Pod C

 └── Node 3

      └── Pod D 


5. Auto-Repair

GKE continuously monitors node health.

If a node becomes unhealthy:

  1. Detect failure
  2. Drain workloads gracefully
  3. Create a replacement node
  4. Reschedule workloads
Node Failure
      ↓
GKE Detects
      ↓
Drain Pods
      ↓
Create New Node
      ↓
Restore Workloads

Benefit: Higher availability with minimal manual intervention.


6. Auto-Upgrade

GKE can automatically upgrade:

  • Kubernetes versions
  • Security patches
  • Cluster components

This ensures clusters remain on supported and stable versions.


7. Cluster Autoscaling

Just like Kubernetes scales applications, GKE can scale infrastructure.

Workload Scaling

10 Users
  ↓
1000 Users
  ↓
More Pods Created

Cluster Scaling
No space for new pods
          ↓
GKE adds new nodes
          ↓
Pods get scheduled

8. IAM Integration

GKE integrates with Google Cloud Identity and Access Management (IAM).

Examples:

UserPermission
DeveloperDeploy applications
AdminManage cluster
ViewerRead-only access

This provides secure access control.


9. Monitoring and Observability

GKE integrates with:

Google Cloud Monitoring

You can monitor:

  • CPU utilization
  • Memory usage
  • Application health
  • Error rates
  • Pod performance

This helps identify and troubleshoot performance issues.


10. Networking Integration

GKE works seamlessly with:

  • Google VPC
  • Load Balancers
  • Firewalls
  • Internal networking

Result:

pplication

    ↓

GKE

    ↓

Google Network

    ↓

Internet/Users


11. CI/CD Integration

GKE integrates with:

Cloud Build

Build Docker images automatically.

Artifact Registry

Store container images securely.

Flow:

Code Commit

      ↓

Cloud Build

      ↓

Docker Image

      ↓

Artifact Registry

      ↓

Deploy to GKE


This enables automated deployments.


12. Google Cloud Console Dashboard

Open-source Kubernetes provides a dashboard, but:

  • Requires installation
  • Requires security configuration
  • Requires maintenance

GKE provides an integrated dashboard through the Google Cloud Console where you can:

  • View clusters
  • Inspect nodes
  • Monitor pods
  • Deploy workloads
  • Delete resources

without maintaining a separate Kubernetes dashboard.


Kubernetes vs GKE

FeatureKubernetesGKE
Cluster SetupManualManaged by Google
UpgradesManualAuto-upgrade
Node HealthManualAuto-repair
ScalingManual setupBuilt-in
MonitoringConfigure separatelyIntegrated
SecuritySelf-managedGoogle-managed options
DashboardSelf-hostedCloud Console

.....

Comments

Popular posts from this blog

Async/await

Valid Parentheses

kafka