For those who have decided to take a leap of faith and dive into Kubernetes, many ask: How do I get started? Where can I play around and test examples? What training is available? This post provides a roadmap of resources to get you up and running with Kubernetes.
To begin, some vocabulary is necessary to define the components discussed in this blog. I will try to keep the definitions brief.
Image: Images are the definition and configuration of a container. Images are built and hosted either locally or remotely and their instantiation results in a running container. Images are defined in a Dockerfile.
Containers: Containers are lightweight packages that contain everything needed to run an application or microservice. Containers are an instantiation of an image. What makes containers lightweight is the OS kernel is extracted out, and by doing so, multiple containers can share the resources of the host. Because of this, containers are far more able to maximize host resource utilization than traditional applications on a VM. The container process is isolated from the rest of the system and restricted from both the resource consumption and security. Containers represent components of immutable software and can easily be shared among individuals while being assured everyone is working with the same piece of software.
Docker: Docker provides the ability to package and run applications in an isolated environment called a container. Docker consists of a client and server or engine. The engine requires a runtime to mount the container onto the OS of the host. Docker is not the only game in town and in later versions of Kubernetes, support of the Docker runtime has been dropped in favor of those that adhere to the OCI Kubernetes standard. Docker, however, can still be used to compile images and is the most common method to do so.
Kubernetes: Kubernetes is a truly declarative platform for orchestrating containers. Kubernetes pods are an object that wrap the containers and embellishes behavior and configuration. Pods are usually governed by Deployments that ensure the state of the application always matches the declarative state. This is part of what makes Kubernetes highly available and self-healing. But Kubernetes is way more than just Pods and Deployments.
There is a plethora of ways to get started with Kubernetes. The simplest way is to use tools that are available for local desktop computers. These would add up to Docker Desktop and minikube.
Docker Desktop is an application for Mac, Windows, and Linux operating systems that installs a complete Docker environment on your computer. It comes with a UI and it is highly configurable. It even comes with the ability to start a simple Kubernetes cluster. The disadvantage of using Docker Desktop is that only supports a single version of Docker and Kubernetes. Docker Desktop can also be a resource hog. Finally, Docker Desktop use for enterprises is supposed to be covered by a license that requires a small per seat cost.
Minikube is a lightweight Kubernetes implementation that creates a simple Kubernetes cluster on your local machine. The implementation actually creates a VM and deploys a minikube container into that VM. Therefore, minikube requires a VM driver and, by default, looks for Docker Desktop. However, there are other approaches to use minikube without relying on Docker Desktop at all.
Minikube does not have the restrictions that DockerDesktop has. While minikube is considered lightweight, it is quite capable. One can configure it to have custom resources, use a specific Kubernetes version, employ a different vm-driver, and even create multi-node clusters to the extent that your computer has the hardware resources to support such a topology.
Alternative Kubernetes Environments
There are many other Docker and Kubernetes solutions available.
Web-based: There are a couple of web-based environments available on the internet. The two that come to mind are Play with Docker and Play with K8s. Both create an environment in a web browser that is available for four hours. Keep in mind that after four hours any work on the environment is lost and there is no way to persist anything short of cut and paste. Both solutions come with labs and provide a perfect way to get hands-on with little effort and no installation.
Kind: Kind is a go based implementation. It has a couple of prerequisites that need to be installed (like go) but it is rather easy to spin up a cluster and the help on the site is on point.
K3s: k3s is another simple but certified Kubernetes implementation but it is primarily meant for IoT and Edge computing.
Killer Shell: Killer Shell is a CKS, CKA, and CKAD exam simulator which are the three Linux Foundation certifications for Kubernetes.
kubeadm: The Kubernetes project provides a tool for bootstrapping a single or multi-node cluster on VMs called kubeadm. To follow his approach, one would will need some method of creating VM(s) on the local desktop like VirtualBox, VMware, or UTM. Or cloud-based compute can be utilized.
Kubernetes-the-Hard-Way: If you really want to get deep and truly understand the internal architecture of Kubernetes you could pursue Kelsey Hightower’s GitHub repo. This approach is a level more advanced than kubeadm and builds the cluster by using the binaries directly and performing what kubeadm does manually including authentication and authorization.
Cloud Providers: Amazon AWS EKS, Microsoft Azure AKS, and Google GCP GKE comprise the three major cloud providers in the Kubernetes space. Each of these will require an account and will incur costs. In addition, Kubernetes in a cloud provider is somewhat different that Kubernetes bootstrapped with kubeadm. You will need some skill with the cloud provider you choose that will involve using services outside of Kubernetes such as IAM, networking etc. If you want to tear down your cluster and rebuild it quickly, some sort of IaC or command line utility like eksctl or Terraform would be beneficial. There are other Kubernetes players besides Amazon, Microsoft, and Google. There is OpenShift from RedHat, D2IG Konvoy, and others that aren’t mentioned here.
While Softrams does not endorse any particular training company there are a number of sites that come to mind in addition to what is available in the approaches above. Udemy, KodeKloud, Pluralsight, and A Cloud Guru are all excellent. If you prefer books, there are plenty of Kubernetes books from O’Reilly. Two of my favorites are The Docker Book and the Kubernetes Book by Nigel Poulton. And to read the official documentation, visit kubernetes.io.
There are many ways to get started with Docker and Kubernetes from local environments all the way to cloud providers. There are many available resources online that detail examples and point solutions. Some are “free” and some will incur costs. If you are really interested in diving into containerization and orchestration with Docker and Kubernetes, there are plenty of options to choose from depending on the level of depth and sophistication in which you are interested.