Skip to main content
In this guide, you’ll continue enhancing your development workflow on Google Kubernetes Engine (GKE). We’ll cover cluster access, namespace isolation, manifest updates, automated builds, and deployment verification.

Prerequisites

  • A GCP project with a running GKE cluster
  • gcloud CLI and kubectl installed and configured
  • A GitHub repository connected to Cloud Build triggers

1. Connect to the Cluster and Create a Namespace

1.1 Launch Cloud Shell

  1. Navigate to Google Cloud Console > Kubernetes Engine > Clusters.
  2. Select your cluster and click Connect to open Cloud Shell.
  3. Press Enter to run the pre-populated kubectl authentication command.
The image shows a Google Cloud Platform (GCP) Kubernetes Engine console displaying details of a cluster named "gcp-devops-project," including cluster basics, automation, and networking settings.
Make sure your Google Cloud SDK is up to date to avoid authentication issues:

1.2 Create and Verify the Development Namespace

2. Update the gke.yaml Manifest

Open your gke.yaml file. This manifest defines both the Service and Deployment for your application. Modify it to point at the development namespace and use your development Docker image.

2.1 Resource Overview

2.2 Updated Manifest Snippet

Save your changes and push to the development branch:
This push will trigger your Cloud Build configuration.

3. Verify the Cloud Build Trigger

After pushing, open your GitHub repository to confirm that a Cloud Build trigger has started on the development branch.
This image shows a GitHub repository page for a project named "gcp-devops-project" under the user "learnwithraghu." The repository contains files like Dockerfile, README.md, and app.py, and it mentions a Docker Flask application written in Python.

4. Review Build and Deployment Logs

Go back to the GCP Console and navigate to Cloud Build. You’ll see logs for steps including:
  • Building the Docker image
  • Pushing to Container Registry
  • Deploying to GKE
The image shows a Google Cloud Build interface displaying the details of a successful build process, including steps and logs related to deploying a project using Docker and GKE.
All steps should complete without errors.

5. Inspect the Deployment in GKE

  1. In the GCP Console, go to Kubernetes Engine > Workloads and filter by the development namespace.
    • Workload: gcp-devops-gke
  2. Then select Services & Ingress, keeping the development filter applied.
  3. Copy the external LoadBalancer IP and open it in your browser to verify your app is running.
The image shows the Google Cloud Console interface, specifically the Kubernetes Engine section, with a focus on Services & Ingress. A filter dropdown for selecting namespaces is open.

You’ve successfully set up a dedicated development namespace, updated your Kubernetes manifests for development artifacts, and confirmed an automated CI/CD pipeline. Future commits to the development branch will automatically build and deploy your application to GKE.

Watch Video