Kubernetes Basic Terminologies

In this blog we will understand some of the basic terms and terminologies of Kubernetes such as Pods, Deployments, Services and Ingress.

You can refer to my previous blogs of Kubernetes from here - Architecture of Kubernetes

This single image explains the Kubernetes in a nutshell.

What is a Pod?

A pod represents the basic building block in Kubernetes. Containers within a pod are always scheduled to run on the same node, and they are treated as a single cohesive unit. A Kubernetes pod is a collection of one or more Linux containers, and is the smallest unit of a Kubernetes application.

What is a Deployment?

A Deployment provides declarative updates for Pods and ReplicaSets. It provides a way to update and roll back applications, manage changes to your application's containers, and maintain the desired number of replicas. In production or in real life scenarios, we do not directly deploy a Pod instead we deploy a Deployment and from deployment our Pods are created along with its ReplicaSets.

Using Deployments, it helps in the auto-healing feature of Kubernetes.

What is a Service?

A service is an abstraction that represents a set of logical pods where an application or component is running, as well as embedding an access policy to those pods.

There are four types of services that Kubernetes supports: ClusterIP, NodePort, LoadBalancer, and Ingress. Each has their own set of requirements to enable them for your application, so you must understand which one you need before deploying.

What is Ingress?

Kubernetes Ingress is an API object that provides routing rules to manage access to the services within a Kubernetes cluster. This typically uses HTTPS and HTTP protocols to facilitate the routing. With Ingress, you can easily set up rules for routing traffic without creating a bunch of Load Balancers or exposing each service on the node. This makes it the best option to use in production environments. 

Ingress Controller

If Kubernetes Ingress is the API object that provides routing rules to manage external access to services, Ingress Controller is the actual implementation of the Ingress API. The Ingress Controller is usually a load balancer for routing external traffic to your Kubernetes cluster and is responsible for L4-L7 Network Services.

Layer 4 (L4) refers to the connection level of the OSI network stack—external connections load-balanced in a round-robin manner across pods. Layer 7 (L7) refers to the application level of the OSI stack—external connections load-balanced across pods, based on requests.

In production environments, you typically use Ingress to expose applications to the Internet. An application is accessed from the Internet via Port 80 (HTTP) or Port 443 (HTTPS), and Ingress is an object that allows access to your Kubernetes services from outside the Kubernetes cluster.

What is a Namespace?

In Kubernetes, namespaces provides a mechanism for isolating groups of resources within a single cluster. Names of resources need to be unique within a namespace, but not across namespaces.

A namespace provides scope for Kubernetes resource names. It’s useful when many users across multiple teams or projects use the same cluster and there’s a risk of name collisions. A namespace is a method that Kubernetes offers us to help isolate our resources logically.

Namespace not only divides resources, but it’s also useful for security purposes. It allows you to provide role-based access to different users, which also translates into better performance.

What are ConfigMap & Secrets?

Kubernetes has two types of objects that can inject configuration data into a container when it starts up: Secrets and ConfigMaps.

ConfigMaps are used to store non-sensitive configuration data in key-value pairs. They can be used to parameterize applications, decoupling configuration from code. ConfigMaps can be consumed by Pods as environment variables or as mounted files in the container filesystem.

Secrets are used to store sensitive information, such as passwords, API keys, and certificates. They are encoded or encrypted when stored in etcd, the key-value store used by Kubernetes. Secrets can be consumed by Pods as environment variables or as mounted files in the container filesystem.

Summary

In Kubernetes (or K8s) all the operations such as deploying pods, deployments, services, ingress, etc are the files written in Yet Another Markup Language File Format (YAML).

Example - pod.yaml, deployment.yaml, service.yaml

You can check the reference of these file in the official page of Kubernetes - https://kubernetes.io/docs/

So its a wrap-up of this blog, where we understand some of the basic terms and terminologies used in the concept of Kubernetes. Do explore more and learn these terms for future hand-on practice and better understanding of K8s.

In the next blog we will do the hands-on practice on the Kubernetes.

STAY UPDATED & HAPPY LEARNING!!. 🚀