पाठ 9 / 25
Google Kubernetes Engine and App Engine
Decide when you need Kubernetes and which GKE mode to use.
Managed Kubernetes in two modes
Google Kubernetes Engine (GKE) is managed Kubernetes; Google runs the control plane and handles upgrades through release channels. Autopilot mode also manages nodes: you deploy pods and pay for the CPU, memory and storage they request, with security hardening applied by default. Standard mode gives you control of node pools, machine types and node configuration, and you pay for the nodes. Use GKE when you need the Kubernetes API itself: many services with complex networking, custom operators, stateful workloads, GPUs or portability of Kubernetes manifests and Helm charts. App Engine is Google's older platform-as-a-service for web apps; it still runs, but new projects usually choose Cloud Run. Store images in Artifact Registry, the successor to Container Registry.
An Autopilot cluster and a deployment
Autopilot sizes nodes from pod requests, so set them deliberately.
gcloud container clusters create-auto shop-cluster --region=asia-south1
gcloud container clusters get-credentials shop-cluster --region=asia-south1
kubectl create deployment orders --image=asia-south1-docker.pkg.dev/shop-dev-123456/apps/orders:1.0
kubectl set resources deployment orders --requests=cpu=250m,memory=512Mi
kubectl expose deployment orders --port=80 --target-port=8080 --type=LoadBalancerCloud Run first, GKE when needed
Many teams adopt Kubernetes for a handful of stateless HTTP services and spend their time running clusters. Start with Cloud Run; move to GKE when you hit a concrete need it cannot meet.
त्वरित जाँच: In GKE Autopilot, what are you primarily billed for?
- The control plane only
- Each kubectl command
- The resources your pods request
- Node pools you create manually
Answer
The resources your pods request — Autopilot manages nodes and bills by pod resource requests.