Difficulty: Basic Understanding of Kubernetes
Estimated Time: 15 minutes

Objective

The objective of this scenario is to demonstrate how to create a Kubernetes cluster using Kubernetes in Docker and then run a simple multi-pod application in the cluster.

Executing command line instructions

This scenario is completely interactive. The instructions you'll be given will be executed directly in the terminal window that is embedded directly in the Katacoda interactive learning environment. In the steps to come, when you see a command line instruction with a black background and check mark at the end, like so:

Katacoda command line

just click on it and the command will execute in the interative terminal window.

What you need to know to start

In order to get full benefit from taking this scenario, you need to have basic understanding of following Kubernetetes concepts:

This video describes the basics of Kubernetes you need to know:

What is KinD?

Typically a Kubernetes cluster is a collection of computers in which each computer is usually a virtual machine (VM). In Kubernetes's parlance, a machine is called a node.

While clusters based on VMs are commonplace in staging and production environments, for developers using VM based clusters can be a hindrance. It takes time to configure and deploy the VMs. And, if something goes wrong, replenishing them can take time too.

Instead of using VMs, KinD allows developers to create a cluster in which each node is a Linux container. Thus, developers can enjoy the benefit of working with a fully functional multiple node cluster without having to go through the pain of creating a number of VMs and then configuring them for the cluster. If something goes wrong, all the developer needs to do is destroy the cluster and create a new one. The ease and time-savings is significant.

Contents

This scenario is divided into the following steps.

  • Step 1 - Install kubectl
  • Step 2 - Install KinD
  • Step 3 - Create a K8S cluster using KinD
  • Step 4 - Install and run a K8S Application

Executing command line instructions

This scenario is completely interactive. The instructions you'll be given will be executed directly in the terminal window that is embedded directly in the Katacoda interactive learning environment. In the steps to come, when you see a command line instruction with a black background and check mark at the end, like so:

Katacoda command line

just click on it and the command will execute in the interative terminal window.

Click the START SCENARIO button to start.

Congratulations! You've completed the scenario, Understanding KinD.

In this scenario you learned basics of Kubernetes in Docker.

The interactive scenario demonstrated how to:

  • Install kubectl
  • Install KinD
  • Create a Kubernetes cluster using KinD
  • Run a simple K8S in the cluster

Go to the Kubernetes web site to learn moare about Kubernetes.

Go the the Kubernetes in Docker web site to learn more about KinD.

Intro to Kubernetes in Docker (KinD)

Step 1 of 4

Installing kubectl

Objective

The objective of this lesson is demonstrate how to install the Kubernetes command line client kubectl.

kubectl is the tool you'll use to execute commands against the Kubernetes cluster you are going to create using KinD.

To learn more about kubectl go here.

Steps

Step 1: Download the binary using curl

curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"

Step 2: Change the permissions to make the binary executable

chmod +x ./kubectl

Step 3: Add the binary to the system's path by moving it to the directory, /kubectl /usr/local/bin/kubectl.

sudo mv ./kubectl /usr/local/bin/kubectl

Step 4: Confirm kubectl is properly installed by getting the version number.

kubectl version --client

You'll get output similar to the following:

Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.3", GitCommit:"1e11e4a2108024935ecfcb2912226cedeafd99df", GitTreeState:"clean", BuildDate:"2020-10-14T12:50:19Z", GoVersion:"go1.15.2", Compiler:"gc", Platform:"linux/amd64"}

Next: Installing KinD