Kubernetes Architecture

Download as pdf or txt
Download as pdf or txt
You are on page 1of 39

KUBERNETES ARCHITECTURE

PODS
• Pods are the smallest, most basic deployable
objects in Kubernetes. A Pod represents a
single instance of a running process in your
cluster. Pods contain one or more containers,
such as Docker containers. When a Pod runs
multiple containers, the containers are
managed as a single entity and share the Pod's
resources.
Kubernetes kubelet vs kubectl
• kubectl is the command-line interface (CLI) tool for working with a
Kubernetes cluster. Kubelet is the technology that applies, creates,
updates, and destroys containers on a Kubernetes node. Let’s
explore the details.
• kubectl is the primary means by which a developer can interact
with a Kubernetes cluster. For example, if you want to get the
basic information about the nodes in a cluster, you’d type the
command:
kubectl get nodes

• The result of the command will be similar to the following:


• NAME STATUS ROLES AGE VERSION node1 Ready master
89s v1.19.1 node2 Ready <none> 58s v1.19.1 node3 Ready
<none> 58s v1.19.1
How kubectl works
• Or, if you want to create a Kubernetes resource such
as a service, you will execute the command

kubectl apply -f myservice.yaml

• WHERE myservice.yaml is the name of a fictitious


manifest file that describes a Kubernetes service.

• You can view a complete listing of all the


subcommands that can be used with kubectl at-
https://kubernetes.io/docs/reference/generated/kube
ctl/kubectl-commands
How the Kubernetes kubelet
command works
• Kubelet on the other hand is a process that runs on each node of a
Kubernetes cluster and creates, destroys, or update pods and their Docker
containers for the given node when instructed to do so.

• in figure below every worker node in a Kubernetes cluster will have an


instance of Kubelet running. When it’s time to create a pod and
container(s), mechanisms in the Kubernetes controller node inform an
instance of Kubelet running on a particular worker node to interact with
the node’s container runtime to create the required container(s).
• Kubelet works with the controller node to organize the container
according to its associated pod.
Kubelet and Kubernetes nodes

• Remember, every node (virtual or physical machine) in a


Kubernetes cluster will have an instance of Kubelet running. The
following command will return the location of the Kubelet on a
Linux machine:
which kubelet

You’ll get output similar to the following:

/usr/bin/kubelet

If you want to find out the details about kubelet, execute the
following command:
kubelet --help
• The kubelet vs kubeclt comparison boils down
to this:
• kubelet is Kubernetes’s mechanism for
creating containers in a worker node,
while kubectl is the CLI tool that developers
use for interacting with a Kubernetes cluster.
• If you know which piece of the Kubernetes
architecture you need to interact with, the
choice between kubectl and kubelet will be
clear.
Kubeadm
• Kubeadm is a tool used to build Kubernetes (K8s)
clusters.
• Kubeadm performs the actions necessary to get a
minimum viable cluster up and running quickly.
• By design, it cares only about bootstrapping, not
about provisioning machines (underlying worker
and master nodes).
• Kubeadm also serves as a building block for
higher-level and more tailored tooling.
Kubeadm’s Features
• Common use cases for Kubeadm include testing, creating baselines for
more advanced K8s deployments, and providing new K8s users a simple
starting point for cluster configuration. The specific features that make
kubeadm useful in those applications are:

• Quick minimum viable cluster creationKubeadm is designed to have all the


components you need in one place in one cluster regardless of where you
are running them.

• PortableKubeadm can be used to set up a cluster anywhere whether it's


your laptop, a Raspberry Pi, or public cloud infrastructure.

• Local developmentAs Kubeadm creates clusters with minimal


dependencies and quickly, it's an ideal candidate for creating disposable
clusters on local machines for development and testing needs.

• Building block for other toolsKubeadm is not just a K8s installer. It also
serves as a building block for other tools like Kubespray.

You might also like