Understanding Kubernetes (K8s) Terminologies

Altaf Ahmad

Published On

November 15, 2024

Kubernetes (K8s) is a powerful tool for managing applications in isolated containers, enabling smooth deployment, scaling, and operation. Key components—such as clusters, nodes, pods, services, and network policies—work together to keep apps accessible, secure, and efficient. This guide covers essential Kubernetes features and how they simplify managing complex applications.

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Block quote

Ordered list

  1. Item 1
  2. Item 2
  3. Item 3

Unordered list

  • Item A
  • Item B
  • Item C

Text link

Bold text

Emphasis

Superscript

Subscript

1. Kubernetes (K8s)

Kubernetes (also called K8s) is a tool that helps you manage applications by running them in containers (isolated environments). Kubernetes helps deploy, scale, and manage these containers automatically.

Example: Think of Kubernetes as the control room for a large ship. It helps direct, organize, and monitor all activities to keep everything running smoothly.

2. Cluster

A cluster is a group of computers that Kubernetes uses to run and manage applications. Each cluster consists of multiple computers (called nodes). Kubernetes treats this group as a single unit.

Example: Imagine a team of workers. Each worker has a specific role, but they all work together to accomplish a big task (the cluster).

3. Node

A node is a single computer (or server) within the cluster that runs the application containers. There are two types of nodes: Master Node (which controls everything) and Worker Nodes (which do the actual work).

Example: If the cluster is a team, then each node is a person on that team, with the master node as the team leader and worker nodes as the workers.

4. Pod

A pod is the smallest unit in Kubernetes. It usually runs one application container, but it can run multiple related containers if needed. Each pod has its own unique IP address and shares resources.

Example: Think of a pod like a small box with a single app inside (or a few tightly connected apps). Each box has a label (IP) that makes it easy to find.

5. Service

A Service is like a doorway to a set of pods. It provides a consistent way to access pods, even if they come and go. Kubernetes automatically load-balances traffic across all pods linked to a service.

Example: Imagine a restaurant with a service counter. Customers go to the counter (service) without knowing which cook (pod) will handle their order.

6. NodePort

NodePort is a way to make a service accessible from outside the cluster. When you set up a NodePort service, Kubernetes assigns a port number to each node, allowing you to access your application by typing <NodeIP>:<NodePort>.

Example: Think of NodePort as giving each node a window through which people can interact with the app from outside the cluster.

7. Network Policies

Network Policies are rules that control communication between pods, making it possible to restrict access. These policies are like firewalls for pods. By default, Kubernetes allows all pods to communicate with each other; network policies can limit this.

Example: In a large building, network policies are like doors that only some people can open, ensuring that only specific people have access to certain rooms.

8. Ingress

Ingress is a resource that manages external access to services within the cluster, typically HTTP or HTTPS traffic. It provides a way to define rules to route external traffic to specific services within the cluster.

9. Container Network Interface (CNI) Plugins

Kubernetes doesn’t handle low-level networking itself. Instead, it uses CNI (Container Network Interface) plugins to manage network connectivity. Popular CNIs include Cisco ACI, Juniper Contrail, and Broadcom NSX.

Examples in Practice

Imagine you have a cluster with several nodes running an e-commerce application. Here’s how Kubernetes concepts work in this setup:

  • Pods: You have a pod for each part of the app, like the frontend, backend, and database.
  • Nodes: Each pod runs on a node. One node might handle the frontend pods, and another node might handle backend pods.
  • NodePort: You use NodePort to make the frontend accessible to users from outside the cluster.
  • Network Policies: You set up network policies to allow the frontend pods to communicate with backend pods while restricting access to the database pods.