Overview

Skill Level: Any Skill Level

Ingredients

Kubernetes organizes containers into clusters. To make the most of Kubernetes, you first need to understand its architecture. This article provides an overview of Kubernetes and its architecture.

Step-by-step

  1. Kubernetes Overview

    Kubernetes (k8s) is an open-source container orchestration system. The platform manages, deploys and scales containerized applications. 

    Benefits of Kubernetes

    Kubernetes presents several benefits for organizations:

    • Open-source—Kubernetes can run containers on public, private or on-premises environments. It is compatible with several platforms, in summary, it can be deployed almost anywhere.
    • Scalable—k8s offers several features for scaling workloads. You can scale horizontally, adding or removing nodes. Kubernetes also offers autoscaling, which enables you to set the number of containers you want to run. 
    • Highly available—the platform ensures high availability through self-healing. k8s constantly monitors the health of nodes and pods. Another feature that helps with high availability is load balancing. The load balancer ensures that the resources get distributed the load across multiple workloads.

     

  2. Kubernetes: Key Concepts

    Kubernetes architecture starts with containers. A container is the smallest unit in the k8 platform. It is a packaged software, usually containing one process in a self-contained unit. This unit or container has everything the process needs to run. 

    Pods

    A pod is a group of containers that share the same networking and storage resources. One of the characteristics of the pod is that when it is deleted, it cannot be restored. 

    Nodes

    A node is a server the pods run on. It represents a single machine in your cluster. It can be a physical or virtual machine. 

    Cluster

    A cluster consists of a collection of nodes. The cluster distributes the workload to the individual nodes for you. If you remove or add new nodes, the cluster redistributes the load. 

    Deployment

    Pods are usually managed in a deployment layer. A deployment is k8s’ way to achieve high availability. While pods are mortal, you can set the number of pods you want running. Kubernetes uses deployments to maintain this number of pods.

  3. Kubernetes Architecture Model

    K8s is based on a master-slave architecture model. A Kubernetes master node is a unit that controls workloads across the system. The components of a master node include Etcd storage, a controller manager, an API server, and a scheduler. 

    Worker or slave nodes receive communications from the master node. The master node assigns resources to containers according to the schedule. The responsibilities of master nodes range from handling API requests, to scheduling and running pods in worker nodes. Master nodes also perform monitoring and networking.

  4. What Is Etcd?

    Etcd is a key-value data store accessible by all the nodes in a cluster. Etcd stores the configuration data of the cluster, representing the actual state of the cluster. You can deploy etcd instances as pods on the master nodes or you can deploy it as an external cluster. This adds a extra layer of security. There are a number of tutorials available about how to set up the etcd kubernetes cluster. 

    Kubernetes is distributed, running in several machines at the same time. Therefore, its database requires to be distributed too. Etcd functions as k8s’ database. Before setting up an etcd Kubernetes cluster, you should ensure that no resource starvation occurs since this can lead to timeout and an unstable cluster. 

    You should run Etcd clusters on dedicated machines to ensure the stability of k8s clusters. To ensure high availability you should run Etcd as a multi-node cluster. Since maintaining consensus is important in the k8s cluster, running a five-member cluster can be helpful to avoid consensus failure. 

    Etcd requires advanced hardware configuration. You can consult the resource requirement documentation for more information.

  5. How Kubernetes Uses Etcd

    To understand how k8s uses Etcd it is important to understand the difference between the actual state and the desired state in k8s. 

    In k8s, you use API objects to describe your cluster’s desired state. Then, the k8s control plane monitors the actual state of the system, making the necessary changes to reconcile the actual and the desired states. 

    Etcd stores the configuration of the k8s cluster, including the actual and the desired state. Any change is logged and updated in etcd. Therefore, Kubernetes uses Etcd like other applications use databases, for storing configuration data, state and metadata.

  6. How Companies Leverage Kubernetes

    Many global companies chose k8s to manage their container workloads. K8s helps companies manage surges in workloads, ensuring high availability of content, among other benefits. Some examples include:

    • Pinterest—the social networking platform uses thousands of microservices, with a distributed set of tools. When the company wanted to streamline production, it looked for a container orchestration platform like Kubernetes. Pinterest reported increased efficiency after deploying Kubernetes. 
    • Pokemon Go—when the online game was released, the company expected reasonable traffic. However, the game went viral and the network received a surge in traffic of 50 times more than expected. Pokemon Go could adapt quickly to the sudden demand thanks to k8s’ scalability.
  7. Wrap Up

    It can take some time to learn how to truly leverage K8S’ capabilities and architecture. This beginner’s guide should give you a solid start. For an in-depth explanation, go to the official Kubernetes documentation.

Join The Discussion