3 Let’s build a Pod

 

This chapter covers

  • Exploring the basics of Linux primitives
  • Utilizing Linux primitives in Kubernetes
  • Building your own Pod without using Docker
  • Why certain Kubernetes plugins have evolved over time

This chapter gives you an introduction to building a Pod via several Linux primitives that already exist in your OS. These are the fundamental building blocks in the Linux OS for process management, and we’ll soon learn that they can be used to build more sophisticated administrative programs or accomplish basic day-to-day tasks that require access to OS-level functionality in an ad hoc manner. The importance of these primitives is that they both inspire and implement many important aspects of Kubernetes.

We’ll also look at the reasons why we need CNI providers, which are executable programs that provide Pods with IP addresses. Finally, we’ll review the role the kubelet plays in starting a container. Let’s begin with a little appetizer to contextualize what you’ll learn in the next few sections.

3.1 Looking at Kubernetes primitives with kind

3.2 What is a Linux primitive?

3.2.1 Linux primitives are resource management tools

3.2.2 Everything is a file (or a file descriptor)

3.2.3 Files are composable

3.2.4 Setting up kind

3.3 Using Linux primitives in Kubernetes

3.3.1 The prerequisites for running a Pod

3.3.2 Running a simple Pod

3.3.3 Exploring the Pod’s Linux dependencies

3.4 Building a Pod from scratch

3.4.1 Creating an isolated process with chroot

3.4.2 Using mount to give our process data to work with

3.4.4 Creating a network namespace