- A Cloud Guru
Setting up a Kubernetes Cluster with Docker
Docker works well for running single containers or small groups of containers on a single host. But what if you have more than a few containers, or want those containers to be spread across multiple servers, or even made highly available? For these scenarios, you'll need a container orchestrator. Kubernetes is a popular container orchestration framework that easily works with Docker. In this lab, you'll learn to set up a Kubernetes cluster with Docker.
Table of Contents
Inspect the Docker environment before you install Kubernetes, both to make sure it is installed, and to show what is currently running for comparison later.
- Add the Kubernetes yum repo to every host.
- Set SELinux to permissive mode.
- Install the Kubernetes utilities:
- Enable the kubelet service.
Set up the Kubernetes Cluster
Inspect the Docker environment again. See what has changed.
- Create a cluster on the Controller node.
- Join the cluster on the Worker nodes.
- Add a network fabric to the cluster.
Test the Cluster
Inspect the Docker environment again. What is running now that wasn't before?
- Create an Nginx pod and run it on the cluster.
- Create a NodePort service for the Nginx pod.
- View the Nginx pod in a browser.
Look at the Docker environment one more time. Notice that even though you started the pod with Kubernetes, it is running the containers using Docker. The worker node where the pod is running will have a container with a name that includes the name of your pod.
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.