Get Hands-On Experience with BoxBoat's Cloud Native Academy
Kubernetes Training Fundamentals - Module 2 - Intro to Container Orchestration and Kubernetes
by Mike 'MJ' Johnson | Monday, Dec 31, 2018 | Docker Kubernetes
This series is intended to be a introductory look into Kubernetes. If your organization is interested in custom training around your infrastructure, please reach out to us at BoxBoat. We are both a Docker and Linux Foundation training partner and can provide onsite corporate training on Docker and Kubernetes.
Welcome back to the BoxBoat Kubernetes Training Fundamentals course. We designed a blog and video series to get you familiar with the core tenants of Kubernetes and Docker container orchestration.
If you missed the first post in this series, check it out here: Kubernetes Training Fundamentals - Module 1 - Intro to Containers and Docker
As always, you can reach out to BoxBoat to learn the proper intersection of service gateways, discovery, frameworks like Spring Boot, and modern container orchestration. If your organization needs help with anything DevOps or microservice related, please reach out to us on our contact page or call us at 202-420-9736.
Ok, now lets get into Module 2.
Kubernetes Training Fundamentals - Module 2 - Intro to Container Orchestration and Kubernetes
This module covers the need for container orchestration, some of prominent container orchestration options in the market today, and gives you a quick intro to Kubernetes core concepts.
Kubernetes Training: Module 2 - The Video
We will be recording YouTube videos to walk you through these modules. If you prefer that, please enjoy Module 2 below. If not, skip past the video to get Module 2 in blog form.
Module 2 topics:
Let’s first review what we will cover in this first module.
- Need for Container Orchestration
- Key Features of Container Orchestration Engines
- Container Orchestration Options
- Kubernetes Core Objects and Architecture
- Dashboard UI and Microservices App Demo on K8s
Why do we need container orchestration?
In Module 1, we gave you an intro to Docker and showed you how to deploy and expose containers on a single host. Docker is good at running small deployments and you would probably be able to run 10s of containers and a couple apps manually, but what about 100s or 1000s of containers?
How would all of the containers be coordinated and scheduled? How would all the different containers in the applications communicate with each other? How can container instances be scaled? When running at scale, container orchestration - automating the deploying, managing, scaling, networking, and availability of your containers—becomes much more complex and requires other solutions.
Recommended Reading: Containerization Crash Course - What is a Container?
Key Features Of Container Orchestrators
- Leverages Ephemeral Computing: Pets vs Cattle
- Desired State / Declarative in nature
- Provisioning and deployment of containers
- Redundancy and availability of containers
- Scaling up or removing containers to spread application load evenly across host infrastructure
- Movement of containers from one host to another if there is a shortage of resources in a host, or if a host dies
- Allocation of resources between containers
- External exposure of services running in a container with the outside world
- Load balancing of service discovery between containers
- Health monitoring of containers and hosts
- Configuration of an application in relation to the containers running it
Container Orchestration Options
There are a few different container orchestration options. Below, we list the 3 major enterprise ready options (as of December 2018).
Docker Swarm / Docker EE
Docker swarm mode allows you to manage a cluster of Docker Engines, natively within the Docker platform including Docker CE.
Docker Enterprise (EE) is a Containers-as-a-Service (CaaS) platform that enables a secure software supply chain and deploys diverse applications for high availability across disparate infrastructure, both on-premises and in the cloud. (Source: Docker.com)
Recommended Reading: Docker Community Edition or Docker Enterprise Edition - Everything You Need to Know
Apache Mesos / Marathon
Apache Mesos is an open source cluster manager originally developed by UC Berkeley and extensively hardened and developed by Twitter.
Marathon is a production-proven Mesos framework for container orchestration. Marathon provides a REST API for starting, stopping, and scaling applications. (Source: Apache.org)
Kubernetes (k8s) is an open-source system for automating deployment, scaling, and management of containerized applications. It was developed and released by Google in 2014 and it was designed based on principles and learnings from the internal Google “Borg” container orchestration system. K8s was donated in 2015 to the the Cloud Native Computing Foundation (CNCF) that will is run by the Linux Foundation. (Source: Kubernetes.io/Wikipedia)
So why are we pushing Kubernetes so hard instead of the others? We stronly believe that Kubernetes is the present and future of cotainer orchestration due to its extensive capabilities. It also has the backing of Google and other large companies as well as massive community support. In 2018, Kubernetes Project reached ninth place in commits at GitHub. It is being aggressively developed and adds new features quickly.
Docker themselves recognize the power and popularity of Kubernetes as they have integrated Kubernetes fully into Docker EE 2.1 releases, which is most often how BoxBoat deploys Kubernetes at our customers.
Kubernetes Core Objects and Architecture
Kubernetes has a few “objects” that are are at the core of the platform and other features interact with these objects in some way.
Kubernetes Master: The Kubernetes master is responsible for maintaining the desired state for your cluster. When you interact with Kubernetes, such as by using the kubectl command-line interface, you’re communicating with your cluster’s Kubernetes master.
The “master” refers to a collection of processes managing the cluster state. Typically these processes are all run on a single node in the cluster, and this node is also referred to as the master. The master can also be replicated for availability and redundancy.
Kubernetes Nodes: The nodes in a cluster are the machines (VMs, physical servers, etc) that run your applications and cloud workflows. The Kubernetes master controls each node; you’ll rarely interact with nodes directly.
Objects are listed below and linked to the K8s documentation.
The above info about the core objects are directly from the K8s documentation. For full information on the key Kubernetes concepts, visit the official Kubernetes documentation here: https://kubernetes.io/docs/concepts/
(Image Credit: learningitguide.net)
Interacting with Kubernetes via the API
The two most common ways of interfacing with a self-hosted Kubernetes cluster are via the Kubernetes Dashboard and the ‘kubectl’ command.
Kubernetes Dashboard: Dashboard is a general purpose, web-based UI for Kubernetes clusters. It allows users to manage and troubleshoot applications running in the cluster, as well as the cluster itself.
kubectl: The Kubernetes command line tool used to deploy and manage applications on Kubernetes. Using kubectl, you can inspect cluster resources; create, delete, and update components; look at your new cluster; and bring up example apps
Kubernetes UI and Multiservice App Demo
You can follow along on our intro Kubernetes lab at the following link: https://katacoda.com/boxboat
Click on Kubernetes Training Fundamentals Series to begin, then click Module 2.
Once you have completed the labs, come back here so we can do some final review. As always, the labs will remain available for you going forward.
Module 2 Summary
We hope you found the above information and intro lab helpful as a starter to Kubernetes. In future posts we will go into much more depth on K8s core components. Here is a quick recap of what we covered.
- In order to scale, container orchestration is a must. The complexity of modern container and modern microservice deployments require a mature and highly capable orchestration to effectively deploy and manage the solutions in mission critical environments.
- There are 3 primary options for enterprise grade container orchestration: Docker Swarm/EE, Apache Mesos/Marathon, and Kubernetes. There are many features to look for when evaluation a container orchestration solution.
- Kubernetes has a set of core objects and concepts that once understood, make it much easier to understand how all of the components are tied together.
- All interaction with Kubernetes is handled via the KubeAPI and can be interfaced natively via both a command line and web UI. There are also numerous other 3rd party methods available.
- As shown in the demo, it is easy to define configuration files to easily deploy both management components of the system as well as complex, multi-service applications with just a few commands.
Kubernetes is one of the most powerful and well supported container orchestration tools currently available. It will be time well spent if you are in DevOps to learn the ins and outs of the K8s platform.
If your organization needs help deploying and managing a container orchestration solution like Kubernetes or Docker EE, please reach out to us at BoxBoat.
In the next video/blog we will begin digging into the Kubernetes components in more depth and understanding how they interact.