Study guide

7.3 Deploying Containerized Applications to GKE

Google Cloud Associate Cloud Engineer ACE

Track your progress as you read

Finished sections get a check mark.

1 Chapter 1: Introduction & Exam Overview

1.1 About the GCP Associate Cloud Engineer Exam 1.2 How to Use This Study Guide & Build a Study Plan

2 Chapter 2: Resource Hierarchy, IAM Basics & Cloud Identity

2.1 The GCP Resource Hierarchy: Organizations, Folders & Projects 2.2 Organization Policies & Granting IAM Roles 2.3 Cloud Identity: Managing Users and Groups

3 Chapter 3: APIs, Quotas & Billing Configuration

3.1 Enabling APIs and Provisioning Cloud Operations Suite 3.2 Assessing and Requesting Quota Increases 3.3 Billing Accounts, Project Linking & Billing Exports 3.4 Billing Budgets and Alerts

4 Chapter 4: Planning Compute & Storage Resources

4.1 Choosing the Right Compute Option: GCE vs. GKE vs. Cloud Run vs. Cloud Functions 4.2 Spot VMs, Custom Machine Types & Cost-Optimized Compute Planning 4.3 Choosing a Data Storage Product: Cloud SQL, BigQuery, Firestore, Spanner & Bigtable 4.4 Cloud Storage Classes & Persistent Disk Types

5 Chapter 5: Planning Network Resources

5.1 Load Balancing Options and Use Cases 5.2 Regional Resource Placement & High Availability Planning 5.3 Network Service Tiers: Premium vs. Standard

6 Chapter 6: Deploying Compute Engine Workloads

6.1 Launching Compute Engine Instances: Disks, SSH Keys & Availability Policies 6.2 Managed Instance Groups, Instance Templates & Autoscaling 6.3 OS Login and VM Manager for Fleet Configuration

7 Chapter 7: Deploying Google Kubernetes Engine Workloads

7.1 Installing and Configuring kubectl 7.2 Deploying GKE Clusters: Autopilot, Regional, Private & GKE Enterprise 7.3 Deploying Containerized Applications to GKE

8 Chapter 8: Deploying Serverless & Event-Driven Applications

8.1 Deploying Applications to Cloud Run and Cloud Functions 8.2 Event-Driven Architectures: Pub/Sub, Cloud Storage Triggers & Eventarc

9 Chapter 9: Deploying Data Solutions

9.1 Deploying Data Products: Cloud SQL, Firestore, Spanner, BigQuery & AlloyDB 9.2 Deploying Pub/Sub, Dataflow & Loading Data into Google Cloud

10 Chapter 10: Deploying Networking Resources & Infrastructure as Code

10.1 Creating VPCs, Subnets & Shared VPC 10.2 Firewall Rules, Cloud VPN & VPC Network Peering 10.3 Infrastructure as Code: Terraform, Config Connector, Cloud Foundation Toolkit & Helm

11 Chapter 11: Managing Compute Engine & GKE in Production

11.1 Connecting to and Managing Running Compute Engine Instances 11.2 Working with Snapshots and Custom Images 11.3 Managing GKE Clusters: Node Pools, Workloads & Artifact Registry Access 11.4 Horizontal and Vertical Pod Autoscaling in GKE

12 Chapter 12: Managing Cloud Run, Storage & Database Operations

12.1 Managing Cloud Run Revisions, Traffic Splitting & Scaling 12.2 Managing and Securing Cloud Storage Objects & Lifecycle Policies 12.3 Querying, Estimating Costs, Backup & Job Monitoring for Databases (Cloud SQL, BigQuery, Spanner, Dataflow)

13 Chapter 13: Networking Operations, Monitoring & Logging

13.1 Networking Operations: Subnets, Static IPs, Cloud DNS & Cloud NAT 13.2 Cloud Monitoring: Alerts, Custom Metrics & Dashboards 13.3 Cloud Logging: Buckets, Log Analytics, Routers & Filtering 13.4 Diagnostics, Ops Agent, Managed Service for Prometheus & Audit Logs

14 Chapter 14: IAM Policies & Role Types

14.1 IAM Policies: Structure, Bindings & Policy Hierarchy 14.2 IAM Role Types: Basic, Predefined & Custom Roles

15 Chapter 15: Service Accounts & Security Configuration

15.1 Creating Service Accounts & Assigning Least-Privilege Permissions 15.2 Assigning Service Accounts to Resources & Managing SA IAM Policies 15.3 Service Account Impersonation & Short-Lived Credentials

16 Chapter 16: Exam Readiness — Scenarios & Test-Day Strategy

16.1 Common ACE Exam Scenarios & Decision Frameworks 16.2 Test-Day Logistics, Time Management & Final Review Checklist

7.3 Deploying Containerized Applications to GKE

Key Takeaways Explain This Topic AI

The practical object hierarchy is Deployment → ReplicaSet → Pod; Deployments provide rolling updates, rollback, and self-healing

kubectl apply -f (declarative) is preferred over one-off kubectl create commands for reproducible, version-controlled deployments

A Deployment is not automatically reachable — use kubectl expose with ClusterIP (internal), NodePort (30000–32767 on every node), or LoadBalancer (external GCP load balancer)

kubectl scale changes replica count instantly; kubectl set image triggers a rolling update; kubectl rollout undo reverts a bad rollout

ImagePullBackOff on GKE is most often a missing Artifact Registry Reader role on the node service account, not a network problem

Last updated: July 2026

Why This Is the Payoff Objective

Everything in the prior two sections — installing kubectl, choosing a cluster configuration — exists to support this exam bullet: "Deploying a containerized application to Google Kubernetes Engine." This is where ACE questions get concrete: reading a kubectl command or short YAML snippet and predicting what happens, or diagnosing why a Pod never becomes reachable. You need working fluency with the core Kubernetes objects and the commands that create, expose, scale, and update them.

The Core Object Hierarchy

Object Role

Pod The smallest deployable unit — one or more tightly coupled containers sharing network/storage. You almost never create bare Pods directly in production.

Deployment Declares the desired state for a set of identical Pods (image, replica count, update strategy). Manages a hidden ReplicaSet , which in turn manages the Pods. Gives you rolling updates, rollback, and self-healing (a crashed Pod is automatically replaced).

Service A stable network endpoint that load-balances traffic across a changing set of Pods, decoupling clients from individual Pod IPs (which change every time a Pod restarts).

Ingress Layer-7 HTTP(S) routing in front of one or more Services — used when you need host/path-based routing or a single external endpoint for multiple apps.

Deploying an Application

Imperative (fast, exam-lab friendly): kubectl create deployment web --image=us-docker.pkg.dev/my-project/my-repo/web:v1

  • Declarative (recommended for production — version-controlled, repeatable): apiVersion: apps/v1
  • kind: Deployment

metadata:

name: web

spec:

replicas: 3

selector:

matchLabels:

app: web

template:

metadata:

labels:

app: web

spec:

containers:

  • name: web
  • image: us-docker.pkg.dev/my-project/my-repo/web:v1

ports:

- containerPort: 8080 kubectl apply -f deployment.yaml

kubectl apply -f is idempotent — re-running it against a modified file updates the live objects to match, which is why it is favored over one-off kubectl create commands whenever the manifest is checked into source control.

Sourcing the Container Image

Images deployed to GKE are normally pulled from Artifact Registry , Google Cloud's current image and package repository (the successor to the older Container Registry / gcr.io hostnames). A typical image path looks like: REGION-docker.pkg.dev/PROJECT_ID/REPOSITORY/IMAGE:TAG

GKE node service accounts need the Artifact Registry Reader role ( roles/artifactregistry.reader ) to pull images from a repository in the same or a different project. This single IAM permission is the source of a very common failure mode described below.

Exposing the Application

Creating a Deployment does not automatically make it reachable — you must create a Service : kubectl expose deployment web --type=LoadBalancer --port=80 --target-port=8080

  • Service Type Behavior
  • ClusterIP (default) Internal-only virtual IP, reachable only from inside the cluster
  • NodePort Opens the same static port (range 30000–32767 ) on every node's IP, in addition to a ClusterIP

LoadBalancer Provisions an external Google Cloud Network Load Balancer with a public IP, in addition to NodePort and ClusterIP behavior

Note the distinction between --port (the port clients connect to on the Service) and --target-port (the port the container actually listens on) — mixing these up is a common source of "connection refused" scenarios on the exam.

A newly created LoadBalancer Service typically shows EXTERNAL-IP: <pending> in kubectl get services output for a minute or two while Google Cloud provisions the load balancer — this is expected behavior, not a failure.

  • Scaling and Updating kubectl scale deployment web --replicas=5 # change replica count immediately
  • kubectl set image deployment/web web=us-docker.pkg.dev/my-project/my-repo/web:v2 # rolling update
  • kubectl rollout status deployment/web # watch the rollout progress
  • kubectl rollout undo deployment/web # roll back to the previous revision

kubectl set image triggers a rolling update by default: Kubernetes gradually replaces old Pods with new ones, keeping the application available throughout. kubectl rollout undo reverts to the prior ReplicaSet if the new version misbehaves — a much faster recovery path than manually redeploying the old image.

  • Verifying and Troubleshooting kubectl get pods # list Pods and their status
  • kubectl get pods --all-namespaces # across every namespace
  • kubectl describe pod POD_NAME # detailed events — the first stop when a Pod won't start
  • kubectl logs POD_NAME # container stdout/stderr

Exam scenario: A Pod's status is stuck at ImagePullBackOff . The image is confirmed to exist in Artifact Registry in the same project, and the cluster's network configuration is unchanged. The most likely cause on the exam is not networking — it is that the node's service account lacks the Artifact Registry Reader role on the repository, so every pull attempt is rejected as unauthorized.

Exam scenario 2: After running kubectl create deployment web --image=... , a candidate immediately tries to reach the application from a browser and it fails. kubectl get services shows only a default ClusterIP Service was never created at all — because kubectl create deployment does not create a Service automatically . The fix is kubectl expose deployment web --type=LoadBalancer ... .

Key Takeaways

The practical hierarchy is Deployment → ReplicaSet → Pod ; Deployments provide rolling updates, rollback, and self-healing that bare Pods do not.

kubectl apply -f (declarative) is preferred over one-off kubectl create commands for anything meant to be reproducible or version-controlled.

Creating a Deployment does not expose it — you need kubectl expose (or a Service manifest) with the right type: ClusterIP (internal only), NodePort (30000–32767 on every node), or LoadBalancer (external GCP load balancer).

kubectl scale changes replica count instantly; kubectl set image triggers a rolling update; kubectl rollout undo reverts a bad rollout.

ImagePullBackOff on GKE is most often an Artifact Registry IAM permission problem (missing roles/artifactregistry.reader on the node service account), not a network issue.