Difficulty: beginner
Estimated Time: 30 minutes

U2U Kubernetes Lab

In this lab, you will set up your first Kubernetes cluster. You will learn about

  • Creating and Deploying Pods
  • Using kubectl and YAML files
  • Using Deployments for Scaling
  • Setting up communication with Services
  • Updating versions of your app

Before you start

The online terminal is a pre-configured Linux environment that can be used as a regular console (you can type commands). Clicking on the blocks of code will execute that command in the terminal.

You will use a sample node application called u2utraining/nodejs-http-server. you can find the docker image here The application consists out of a single container which is a node HTTP server, which responds with its version and the machine it's running on.

What you learned

  • Creating and Deploying Pods
  • Using kubectl and YAML files
  • Using Deployments for Scaling
  • Setting up communication with Services
  • Updating versions of your app

Well done. you deserve some coffee.

Don’t stop now! The next scenario will only take about 10 minutes to complete.

U2U Kubernetes Lab

Step 1 of 5

Step 1 - Getting Things Up and Running

If the server hasn't started yet, start the Kubernetes cluster with the following command:

minikube start

Minikube is a minimalistic Kubernetes implementation, which is great for learning. It is not meant to be used in production.

Wait until Kubernetes is done loading. Then use the following command to verify that kubectl is installed:

kubectl version

You should be able to see both the version of the client(kubectl version) as well as the server(Kubernetes version).

Let's take a look at the cluster itself. The following command should give you some basic information, like where the master is running.

kubectl cluster-info

Finally let's see how many nodes we have available:

kubectl get nodes

Just one for now. Notice the name, it sould be minikube or host01, these are aliases. You can use this name to talk to this node directly from within the cluster.

pod.yaml
deployment.yaml
service.yaml