Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Labs

Deploying to a Google Kubernetes Engine Cluster

The strength and flexibility of Kubernetes is built around the concept of containerized applications, which are deployed differently from non-containerized apps. In this hands-on lab, you’ll complete all the steps from creating a Kubernetes cluster to confirming the deployed application, including creating the Docker image of your application, pushing that image to Container Registry, deploying the workload, and then configuring a load balancer to expose it.

Labs

Path Info

Level
Clock icon Beginner
Duration
Clock icon 30m
Published
Clock icon Mar 01, 2019

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Create the Kubernetes Engine cluster.

    1. From the Kubernetes Engine Clusters page, click Create cluster.
    2. Configure the new cluster:
    • Name the cluster
    • Change the number of nodes to 4
    • Under Nodes, Machine Configuration, General-Purpose, change the Series to "N1" and the Machine type to "n1-standard-1".
    • Leave all other settings at their default
    1. Click Create.
  2. Challenge

    Get the files.

    1. Clone the GitHub repository: git clone https://github.com/linuxacademy/content-gcpro-developer
    2. Change directory with the following command: cd content-gcpro-developer/kubernetes-engine-lab
  3. Challenge

    Configure the `config.yaml` file.

    1. In the Cloud Shell Editor, open the config.yaml file.
    2. On line 32, replace [PROJECT_ID] with your project ID.
    3. Choose the file and then select Save.
  4. Challenge

    Build the containerized Docker image.

    In the Cloud Shell, execute the following command:

    docker build -t la-container-image .
    
  5. Challenge

    Push the containerized app into the Container Registry.

    1. In the Cloud Shell, configure Docker to use the gcloud command: gcloud auth configure-docker
    2. Tag the image with the registry name: docker tag la-container-image gcr.io/[PROJECT_ID]/la-container-image:v1
    3. Push the image to the Container Registry: docker push gcr.io/[PROJECT_ID]/la-container-image:v1
  6. Challenge

    Confirm the operation.

    1. Navigate to Container Registry Images.
    2. Confirm the existence of la-container-image.
  7. Challenge

    Deploy the workload.

    1. Navigate to Kubernetes Engine > Workloads.
    2. Click Deploy.
    3. Choose the existing container image.
    4. Click Deploy.
  8. Challenge

    Increase the number of pods.

    1. Navigate to the YAML tab.
    2. Click Edit.
    3. Change the number of replicas to 4.
    4. Click Save.
    5. Confirm the operation.
  9. Challenge

    Expose the deployment.

    1. From the Deployment Details page, click Expose.
    2. Set the Service type to Load balancer.
    3. Click Expose.
    4. Confirm by clicking the External IP link.

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans