Spring Gumball CI/CD Lab 10

This lab demonstrates the following two GitHub Workflows.

Build Dependencies

  • Gradle 5.6
  • JDK 11

CI Workflow (Part 1)

Using the Gradle Starter Workflow

1- gradle yml file

Committed code changes to main branch to trigger the following workflow:

1- github workflow

1- github workflow 2

1- github workflow 3

CD Workflow (Part 2)

This section goes over deploying to Google Kubernetes Engine.

Creating GKE Cluster

A standard cluster was built with the following conifgurations:

  • GCP Project: cmpe172
  • GKE Cluster Name: cmpe172
  • GKE Cluster Zone: us-central1-c

2- creating GKE cluster

Enabling the APIs

2- enable APIs

2- enable APIs 2

Setting up secrets in your Workspace

Step 1. Locate your GKE Project ID

2- find GKE project ID

Step 2. Create a Service Account for GitHub Access

2- create spring-gumball service account

Step 3. Add the following Cloud IAM roles to your service account for your GKE Cluster:

  • Cloud IAM roles added:
    • Kubernetes Engine Developer - Full access to Kubernetes API objects inside Kubernetes Clusters.
    • Storage Admin - Full control of GCS resources.

2- adding IAM Roles

2- adding IAM roles 2

Step 4. Create a JSON service account key for the service account.

2- create JSON service acc key

2- create JSON service acc key 2

2- create JSON service acc key 3

Step 5. Configure GitHub Secrets

  • Add the following secrets to your repository's secrets:
    • GKE_PROJECT: Google Cloud project ID
    • GKE_SA_KEY: The content of the service account JSON file

2- configure github secrets

2- configure github secrets 2

2- configure github secrets 3

2- configure github secrets 4

Configuring Kustomize along with other YML files

Kustomize is an optional tool used for managing YAML specs. After creating a kustomization file, the workflow below can be used to dynamically set fields of the image and pipe in the result to kubectl. 2- configuring kustomize 2- configuring kustomize 2 2- configuring kustomize 3 2- configuring kustomize 4

Trigger and Deployment to GKE

2- Trigger and Deployment to GKE

2- Trigger and Deployment to GKE 2

2- Trigger and Deployment to GKE 3

2- Trigger and Deployment to GKE 4

2- Trigger and Deployment to GKE 5

Confirm the Pods and Service have been Deployed to your GKE Cluster

2- Trigger and Deployment to GKE 6

2- Trigger and Deployment to GKE 7

Set up a External Facing Load Balancer and Test the Gumball Spring App

2- Trigger and Deployment to GKE 8

2- Trigger and Deployment to GKE 9

Web UI on Load Balancer's External IP

2- Trigger and Deployment to GKE 10

2- Trigger and Deployment to GKE 11