Part-123: 🚀Create a GKE Autopilot Cluster and Deploy an Application

In this tutorial, we’ll walk through how to create a Google Kubernetes Engine (GKE) Autopilot cluster, deploy a sample application, and understand how GKE Autopilot manages infrastructure for you.

Autopilot mode lets you focus entirely on your workloa…


This content originally appeared on DEV Community and was authored by Latchu@DevOps

In this tutorial, we’ll walk through how to create a Google Kubernetes Engine (GKE) Autopilot cluster, deploy a sample application, and understand how GKE Autopilot manages infrastructure for you.

Autopilot mode lets you focus entirely on your workloads — while Google handles the node provisioning, scaling, and security patching automatically.

🧩 Step 01: Introduction

We’ll perform the following tasks:

  1. Create a GKE Autopilot Cluster
  2. Understand how Autopilot works under the hood
  3. Deploy a sample NGINX app and test it

What is GKE Autopilot?

  • A fully managed Kubernetes mode by Google.
  • You don’t manage nodes — GKE provisions, scales, and maintains them.
  • You only pay for running pods, not idle nodes.
  • It enforces best practices for security, networking, and reliability.

⚙️ Step 02: Create a GKE Autopilot Cluster

Navigate to:

Kubernetes Engine → Clusters → CREATE

Then choose:

GKE Autopilot → CONFIGURE

Cluster Basics

Setting Value
Name autopilot-cluster-public-1
Region us-central1

Leave the remaining fields as defaults.

Fleet Registration

✅ Leave to defaults.

Networking

Setting Value
Network default
Node subnet default
IPv4 Network Access Public cluster
Access control plane using external IP Checked (default)
Control plane IP range 172.18.0.0/28

Advanced Settings

Leave all to defaults and click CREATE.

a1

💻 Equivalent gcloud Command

gcloud container clusters create-auto "autopilot-cluster-public-1" \
  --region "us-central1" \
  --master-ipv4-cidr "172.18.0.0/28" \
  --network "default" \
  --subnetwork "default"

🧠 Step 03: Access the Autopilot Cluster from Cloud Shell

Once the cluster is created, configure your kubectl context.

# Configure kubeconfig
gcloud container clusters get-credentials autopilot-cluster-public-1 --region us-central1 --project gcp-zero-to-hero-468909

Verify Access

# List Nodes
kubectl get nodes

# List System Pods
kubectl get pods -n kube-system

a2

✅ You should see your system pods and automatically managed nodes listed.

📝 Step 04: Review Kubernetes Manifests

We’ll deploy a simple NGINX app to test the cluster.

📄 Step 04-01: Deployment (01-kubernetes-deployment.yaml)

apiVersion: apps/v1
kind: Deployment 
metadata:
  name: myapp1-deployment
spec:
  replicas: 5 
  selector:
    matchLabels:
      app: myapp1
  template:  
    metadata:
      labels:
        app: myapp1
    spec:
      containers:
        - name: myapp1-container
          image: ghcr.io/stacksimplify/kubenginx:1.0.0
          ports: 
            - containerPort: 80  
          resources:
            requests:
              memory: "128Mi"
              cpu: "200m"
            limits:
              memory: "256Mi"
              cpu: "400m"

📄 Step 04-02: Service (02-kubernetes-loadbalancer-service.yaml)

apiVersion: v1
kind: Service 
metadata:
  name: myapp1-lb-service
spec:
  type: LoadBalancer
  selector:
    app: myapp1
  ports: 
    - name: http
      port: 80
      targetPort: 80

🚀 Step 05: Deploy Kubernetes Manifests

# Deploy manifests
kubectl apply -f kube-manifests/

# List deployments
kubectl get deploy

# List pods
kubectl get pods

a2

🕒 Observation:

  1. Pods may take 2–3 minutes to move from Pending → Running.
  2. GKE Autopilot automatically provisions nodes as needed.

Verify Services

kubectl get svc

Verify Nodes

kubectl get nodes

Observation:

  • Nodes are dynamically created by GKE.
  • You can’t see these nodes under Compute Engine → VM Instances.
  • They’re fully managed by GKE.

🌐 Access the Application

Copy the External IP from the LoadBalancer service output and open in a browser:

http://<EXTERNAL-IP>

a3

You should see the NGINX welcome page.

📈 Step 06: Scale the Application

Autopilot clusters scale seamlessly as demand grows.

# Scale the deployment
kubectl scale --replicas=15 deployment/myapp1-deployment

# Verify pods
kubectl get pods

# Verify nodes
kubectl get nodes

✅ You’ll notice that GKE automatically provisions additional nodes to meet the workload requirements.

a4

🧹 Step 07: Clean-Up

When you’re done testing:

# Delete application resources
kubectl delete -f kube-manifests/

Verify Cluster Scaling Down

kubectl get nodes

Observation:

After 5–10 minutes, GKE will automatically de-provision unused nodes.

🎯 Summary

Step Description
1 Created an Autopilot GKE Cluster
2 Deployed a sample NGINX app
3 Observed automatic scaling and node management
4 Cleaned up resources and cluster

🧠 Key Takeaways

  • GKE Autopilot automates cluster operations, freeing you from node management.
  • You only pay for running pods, making it cost-efficient.
  • Resources like CPU/memory are automatically optimized.
  • Scaling and node provisioning are completely managed by Google.

🌟 Thanks for reading! If this post added value, a like ❤️, follow, or share would encourage me to keep creating more content.

— Latchu | Senior DevOps & Cloud Engineer

☁️ AWS | GCP | ☸️ Kubernetes | 🔐 Security | ⚡ Automation
📌 Sharing hands-on guides, best practices & real-world cloud solutions


This content originally appeared on DEV Community and was authored by Latchu@DevOps


Print Share Comment Cite Upload Translate Updates
APA

Latchu@DevOps | Sciencx (2025-10-12T05:27:00+00:00) Part-123: 🚀Create a GKE Autopilot Cluster and Deploy an Application. Retrieved from https://www.scien.cx/2025/10/12/part-123-%f0%9f%9a%80create-a-gke-autopilot-cluster-and-deploy-an-application/

MLA
" » Part-123: 🚀Create a GKE Autopilot Cluster and Deploy an Application." Latchu@DevOps | Sciencx - Sunday October 12, 2025, https://www.scien.cx/2025/10/12/part-123-%f0%9f%9a%80create-a-gke-autopilot-cluster-and-deploy-an-application/
HARVARD
Latchu@DevOps | Sciencx Sunday October 12, 2025 » Part-123: 🚀Create a GKE Autopilot Cluster and Deploy an Application., viewed ,<https://www.scien.cx/2025/10/12/part-123-%f0%9f%9a%80create-a-gke-autopilot-cluster-and-deploy-an-application/>
VANCOUVER
Latchu@DevOps | Sciencx - » Part-123: 🚀Create a GKE Autopilot Cluster and Deploy an Application. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/10/12/part-123-%f0%9f%9a%80create-a-gke-autopilot-cluster-and-deploy-an-application/
CHICAGO
" » Part-123: 🚀Create a GKE Autopilot Cluster and Deploy an Application." Latchu@DevOps | Sciencx - Accessed . https://www.scien.cx/2025/10/12/part-123-%f0%9f%9a%80create-a-gke-autopilot-cluster-and-deploy-an-application/
IEEE
" » Part-123: 🚀Create a GKE Autopilot Cluster and Deploy an Application." Latchu@DevOps | Sciencx [Online]. Available: https://www.scien.cx/2025/10/12/part-123-%f0%9f%9a%80create-a-gke-autopilot-cluster-and-deploy-an-application/. [Accessed: ]
rf:citation
» Part-123: 🚀Create a GKE Autopilot Cluster and Deploy an Application | Latchu@DevOps | Sciencx | https://www.scien.cx/2025/10/12/part-123-%f0%9f%9a%80create-a-gke-autopilot-cluster-and-deploy-an-application/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.