- Lab
- A Cloud Guru
Installing and Testing the Components of a Kubernetes Cluster
In this lab, you will build a cluster from scratch, as well as test the components of the cluster (including the deployments, pods, port forwarding, and services) and execute a command from within a pod. In order to build the Kubernetes cluster, we need to install the container runtime, as well as kubeadm, kubectl, and kubelet. We will then initialize the cluster, add our CNI, and add the nodes to the cluster.
Path Info
Table of Contents
-
Challenge
Install a Three Node Cluster
- Get the gpg keys for containerd and Kubernetes and add it to your repository
- Install containerd, kubelet, kubeadm, and kubectl
- Initialize the cluster with the pod CIDR address
10.244.0.0/16
- Setup the local kubeconfig
- Apply the Calico CNI plugin
- Join the worker nodes to the cluster
-
Challenge
Create a Deployment
- On the master node, create a deployment named
ngnix
, using thenginx
image
- On the master node, create a deployment named
-
Challenge
Expose Port 80 on the Pod
- On the master node, forward the container port
80
to8081
- Open a new shell to the Kubernetes master and
curl
port8081
on localhost
- On the master node, forward the container port
-
Challenge
Get the NGINX version running on the pod
- In the original master node terminal, run the
nginx -v
command from inside the pod
- In the original master node terminal, run the
-
Challenge
Create a service, and verify connectivity on the node port
- In the original master node terminal, run the commands to expose the deployment and create a NodePort service
- Get the name of the node that the pod resides on
- Run the
curl
command to that node, using the port from the service, and verify connectivity
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.