K8s pt.2 / how it works

Liebertar
Dev-ops
Published in
4 min readJan 20, 2024

Before we jump into the Kubernetes, let me quickly share some fundamental insights that might come in handy. I know that you don’t have much time to focus deeply into the details, so I’ll keep it straightforward and cover only the basics.

1. 3 types of computing Structure

2. How K8s works compared to the Virtual Machine.

3. What point should we consider before using K8s.

1. Computing Structure

Bare Metal | Virtual Machine | K8s

edited by Liebertar

Bare metal

  • Bare metal is like having a computer that’s not sharing with anyone else. Imagine you have a computer at home with its own operating system. That’s how bare metal works.
  • No sharing — everything runs directly on the computer without any extra layers. It’s like having your own private space.

Virtual machines

  • Virtual machines are like having multiple computers inside one physical computer. It’s a bit like having separate rooms for different tasks inside a big house.
  • A special software, called a hypervisor, helps manage these different rooms, making sure they don’t bother each other.

Kubernetes (K8s)

  • In Kubernetes, we have multiple computers (called nodes) working together, and there’s a leader, the master node, that tells everyone what to do.
  • Imagine it’s like a team of workers in a big office building. The boss (master node) coordinates and assigns tasks to each worker (worker nodes) efficiently.
  • Pods as Work Teams: In Kubernetes, worker nodes are like desks in an office building. They organize themselves into teams, represented by Pods. A Pod is a collaborative group of workers with a common purpose, working closely together.
  • Containers as Individual Workers: Within each Pod, individual workers are containers, akin to employees at each desk. Containers specialize in specific tasks, collaborating within the Pod to achieve common goals. Each container may perform a unique function, contributing to the overall success of the team.

2. How K8s works?

6 Po-view of “Virtual Machine” vs. “Kubernetes”

Virtual Machine. VS. Kubernetes.

Resource Utilization

  • Kubernetes: Containers in Kubernetes share the host OS kernel, making them light. This is turning into be the efficient resource utilization and faster startup times.
  • VMs: Each VM has its own complete operating system, leading to higher resource overhead and slower startup times compared to containers. Of course there are pros and cons on this point.

Isolation

  • Kubernetes: Containers within a Pod share the same network namespace, but they are isolated in terms of process and file system. Kubernetes provides strong isolation between Pods.
  • VMs: VMs offer strong isolation since each VM has its own independent operating system, making them more suitable for scenarios requiring strict isolation.

Scaling

  • Kubernetes: Kubernetes allows dynamic scaling by adding or removing containers (pods) based on demand. It can efficiently scale applications horizontally.
  • VMs: Scaling with VMs often involves provisioning new VMs, which can be a slower process compared to the dynamic scaling capabilities of Kubernetes.

Management Overhead

  • Kubernetes: Kubernetes abstracts away much of the infrastructure complexity, allowing for easier management through declarative configuration files. It simplifies application deployment and scaling.
  • VMs: Managing VMs involves configuring and maintaining complete operating systems for each virtual machine, leading to higher management overhead compared to Kubernetes.

Deployment Speed

  • Kubernetes: Containers in Kubernetes start quickly, enabling faster deployment of applications. This agility is crucial for modern development practices like continuous integration and continuous deployment (CI/CD).
  • VMs: VMs generally take longer to start since they involve booting up a complete operating system. This can slow down the deployment process.

Density

  • Kubernetes: Due to lightweight containers, Kubernetes allows for higher application density on a given host, enabling efficient use of resources.
  • VMs: VMs, with their heavier resource requirements, may limit the number of VMs that can run on a host, leading to lower density.

3. Key Considerations

Application Suitability:

  • We need to assess our application type first. Kubernetes is most impactful when our application is dealing with intricate, microservices-based systems. Make sure your applications are ready for being service unit which comes with containerization.
https://media.istockphoto.com/id/1264699774

Scalability Evaluation

  • Need to evaluate the scalability requirements of your applications. Kubernetes is very flexible for the changes in workload size, offering adaptability to fluctuating workloads. Check if your applications are prepared for this level of scalability.

Operational Considerations

  • Understandings on the operational complexity of Kubernetes. K8s abstracts away many complicated stuff, but it might takes some challenges for running it smoothly. Prepare your self or assess your team’s readiness to go with the Kubernetes environment.

Remember, Kubernetes is like a tech party organizer — it’s awesome, but it’s crucial to make sure your applications are ready to be on it. We should approach the decision to use Kubernetes with a consideration of the application structure, scalability, and also the operational capabilities. It’s a robust tool, but understanding its nuances is the key point to get to the successful implementation.

01.20.24 — Fin.

--

--