Use kubectl with a Kubernetes Cluster

30 minutes
  • 5 Learning Objectives

About this Hands-on Lab

In this hands-on lab, you are provided two servers with Kubernetes and containerd installed and configured. You will need to add a Node to the cluster using the information provided and then you will need to create a deployment file. This file will start three replicas of an Nginx image. You will use the relevant commands to scale up the number of replicas to five and then back down to one.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Log In to the Provided Server

Log in to the server as cloud_user with the provided password to ensure you can log in. When the file SERVER-READY is visible in the /home/cloud_user folder, then you can follow along with the objectives.

Add Your Worker Node to the Cluster

Add your worker Node knode1 to the cluster using the information provided in the cluster-info text file, and check if it is ready for use.

Create a Deployment File That Runs the Nginx Image

You will create a deployment file that runs the Nginx image; use port 8080 for its output.

Call the file deployment-nginx.yml, and start the three replicas.

Use the kubectl Command and Run the Deployment

Use kubectl to create the deployment, and check if the three replicas have started.

Scale the Number of Replicas

Scale the number of replicas using the relevant commands: firstly to five replicas then down to one replica.

Additional Resources

Are you ready to dive into the exciting world of Kubernetes?

Your manager has assigned you the important task of exploring how to run multiple Pods using deployments. But don't worry, you're not alone!

You've been given a partially configured cluster to help you along the way and you will use the kubectl command to perform the tasks in the cluster.

With Kubernetes, managing containerized applications has never been easier. By using deployments, you can quickly and easily scale your applications to meet the demands of your users. So, let's get started, and see how Kubernetes can help your team work smarter, not harder.

What are Hands-on Labs

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.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?