What are Kubernetes Containers?

Last Updated : 6 Oct, 2026

Kubernetes is an open-source container orchestration platform used to automate the deployment, scaling, and management of containerized applications. Key capabilities of Kubernetes include:

  • Automates application deployment.
  • Manages containers across multiple nodes.
  • Automatically scales applications based on requirements.
  • Provides service discovery and load balancing.
  • Restarts failed containers through self-healing mechanisms.
  • Helps manage microservices-based applications.
  • Supports deployment across cloud, on-premises, and hybrid environments.

Kubernetes was originally developed by Google and is now maintained as an open-source project under the Cloud Native Computing Foundation (CNCF).

Kubernetes Containers

Kubernetes is used to manage containerized applications across a cluster. Containers provide:

  • Application portability.
  • Process isolation.
  • Consistent execution environments.
  • Faster application startup.
  • Efficient resource utilization.

Kubernetes adds orchestration capabilities on top of containers, such as:

  • Load balancing.
  • Service discovery.
  • Self-healing.
  • Horizontal scaling.
  • Rolling updates.

Containerization Using Kubernetes

To deploy an application using Kubernetes:

  1. Build a container image.
  2. Push the image to a container registry.
  3. Create Kubernetes resource manifests.
  4. Deploy the application using kubectl.
  5. Kubernetes creates and manages the required Pods.
  6. Expose the application using a Kubernetes Service or Ingress.

A Kubernetes Deployment can be used to maintain multiple replicas of an application.

For example:

apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
spec:
replicas: 3
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: my-app
image: my-app:latest

Apply the manifest using:

kubectl apply -f deployment.yaml

Check the deployed Pods:

kubectl get pods

Kubernetes creates the required Pods and continuously works to maintain the desired number of replicas.

Container Technology

Containerization is a form of OS-based virtualization that creates isolated containers on a shared host operating system.

  • Containers share the host OS kernel while remaining isolated from each other.
  • They use fewer resources than traditional virtual machines.
  • Containers have faster startup times and better resource utilization.
  • Unlike VMs, containers do not require a separate guest operating system.
  • Containers can run on Linux, Windows, and macOS environments.
  • They can run on physical machines, virtual machines, on-premises infrastructure, and cloud platforms.
  • Docker is a popular platform for creating and managing containers.
frame_4174
Containerization Technology

Container Images

  • A container image is an executable package that contains an application and all its required dependencies.
  • It provides a consistent environment for running applications across different systems.
  • Container images are stored in container registries such as Docker Hub, Amazon ECR, and Google Container Registry (GCR).

Container Runtimes

Software components that run and manage containers.

  • Provide resource allocation and process isolation.
  • Handle starting, stopping, and managing containers.
  • Ex: Docker, containerd, CRI-O, and Podman.
  • Enable efficient execution and management of containerized applications.

Kubernetes Pods

A Pod is the smallest deployable unit in Kubernetes. It can contain one or more containers that share resources and configuration.

  • Pods are ephemeral and can be recreated if they fail.
  • A Pod can contain one or more containers.
  • Pods can use persistent storage through Persistent Volumes.
  • Pods can also use configuration data required by their containers.
  • To know more about kubernetes pods refer to Kubernetes – Pods

Architecture of Kubernetes

The architecture of Kubernetes includes a master node and one or more worker nodes. The below make in clear understanding of the kubernetes architecture.

frame_4175
Architecture

Understanding of Master Node

  • Kube-apiserver: a frontend of the cluster that allows you to interact with the Kubernetes API and connects to the etcd database.
  • Kube-scheduler: schedules pods on specific nodes supported labels, taints, and tolerations set for pods
  • etcd: a database, stores all cluster data which includes job scheduling info, pod details, stage information, etc.
  • Kube - controller - manager: manages the current state of the cluster
  • cloud - controller - manager: interacts with outside cloud manager

Different optional add-ons: DNS, Dashboard, cluster-level resource monitoring, cluster-level logging

Understanding of Worker Node

Worker Nodes run the application workloads in a Kubernetes cluster.

  • kubelet: Communicates with the control plane and manages Pods on the node.
  • kube-proxy: Handles network communication and routes traffic to the appropriate Pods.
  • Container Runtime: Runs and manages containers on the node.
  • Network Agent: Provides networking between Pods and other cluster resources.

A Pod is the smallest deployable unit in Kubernetes and can contain one or more containers. The kubelet monitors the Pods and ensures they remain in the desired state.

Installing Kubernetes (Minikube)

Prerequisites

Before starting, make sure the following are installed and running:

  • Docker Desktop
  • Minikube
  • kubectl

Step 1: Check Docker

Verify that Docker is installed:

docker --version

Step 2: Check Minikube

Verify the Minikube installation:

minikube version

If Minikube is not installed, install it using Homebrew:

brew install minikube

Step 3: Check kubectl

Verify that kubectl is installed:

kubectl version --client

If kubectl is not installed, run:

brew install kubectl

Step 4: Start the Kubernetes Cluster

Start Minikube using the Docker driver:

minikube start --driver=docker

Check the Minikube status:

minikube status

The output should show that the host, kubelet, and API server are running.

DockerDriver

Step 5: Verify the Kubernetes Cluster

Check the Kubernetes nodes:

kubectl get nodes

The Minikube node should have the Ready status.

get_nodes

Step 6: Create an Nginx Pod

Create a Pod using the Nginx container image:

kubectl run nginx --image=nginx

Check the Pod:

kubectl get pods
get_nodes_nginx

Step 7: Inspect the Pod

View detailed information about the Pod:

kubectl describe pod nginx

Look for the container image:

Image: nginx

This shows that the Nginx container image is being used by the Pod.

Step 8: Check the Container

To view the container name inside the Pod, run:

kubectl get pod nginx -o jsonpath='{.spec.containers[*].name}'
nginx

Step 9: Execute a Command Inside the Container

Run the following command to check the Nginx version inside the container:

kubectl exec nginx -- nginx -v

The output will display the installed Nginx version.

exec_nginx

Step 10: Expose the Nginx Pod

Create a NodePort Service to expose the Nginx Pod:

kubectl expose pod nginx --type=NodePort --port=80

Check the Service:

kubectl get service

The output will show the Nginx Service and its assigned NodePort.

nodeport

Step 11: Access the Nginx Application

Use Minikube to open the exposed Nginx Service:

minikube service nginx
exec_service

The Nginx welcome page will open in the browser.

welcome_page_nginx

Step 12: View Container Logs

To view the logs generated by the Nginx container, run:

kubectl logs nginx

Step 13: Delete the Pod

Delete the Nginx Pod:

kubectl delete pod nginx
delete_nginx_pod

Verify that the Pod has been deleted:

kubectl get pods

Because the Pod was created directly and is not managed by a Deployment or another controller, Kubernetes does not automatically recreate it.

Step 14: Delete the Service

Delete the Nginx Service:

kubectl delete service nginx

Verify that the Service has been removed:

kubectl get services

Step 15: Stop Minikube

After completing the demonstration, stop the Minikube cluster:

minikube stop

Docker Container vs Kubernetes

The following are the differences between Docker Container and Kubernetes:

AspectDocker ContainersKubernetes
DefinitionContainer management tool for building, running, and managing containersContainer orchestration platform for automating deployment, scaling, and management of containerized applications
PurposeTo package applications with their dependencies into containersTo orchestrate and manage containerized applications across a cluster of machines
DeploymentUses Docker CLI or Docker Compose for managing individual containers or multi-container applicationsUses kubectl and manifests (YAML files) for managing containers at scale within clusters
ScalingManual scaling using Docker CLI commands or Docker ComposeAutomated scaling using Kubernetes controllers like Deployments and StatefulSets
NetworkingDocker networking for linking containers within the same host or networkAdvanced networking with built-in service discovery and load balancing

Kubernetes Ingress vs Kubernetes Services

The following are the differences between kubernetes Ingress and Kubernetes Services:

AspectKubernetes IngressKubernetes Services
DefinitionManages external access to services within a clusterExposes a set of pods as a network service
PurposeProvides HTTP and HTTPS routing to services based on host and pathFacilitates internal and external connectivity for pods
RoutingSupports advanced routing (e.g., URL-based routing, SSL termination)Basic routing, mainly for internal communication within the cluster
ConfigurationRequires an Ingress Controller and Ingress resourcesDefined using Service resources (ClusterIP, NodePort, LoadBalancer)
Load BalancingProvides application layer (L7) load balancingProvides network layer (L4) load balancing

Features

The key features of Kubernetes include:

  • Kube-scheduler assigns Pods to suitable nodes based on available resources and policies.
  • Supports application scaling and highly available deployments.
  • Supports add-ons for networking, service discovery, monitoring, and other requirements.
  • New worker nodes can register with the Kubernetes cluster.
  • Automatically discovers services and endpoints using DNS or environment variables.
  • Persistent Volumes allow applications to retain data across Pod restarts.
  • Supports versioned APIs and controlled node maintenance and upgrades.
  • Supports health checks, monitoring tools, and logging solutions such as Metrics Server and Prometheus.
  • Kubernetes Secrets can store sensitive information and expose it to applications through volumes or environment variables.

Advantages

  • Allows for easy scaling of applications by increasing or decreasing the number of replicas of a particular service.
  • Provides features such as self-healing and automatic failover, which help ensure that applications remain available even in the event of a node failure.
  • Designed to be platform-agnostic, which means that applications can be deployed on any infrastructure, whether it be on-premises, in the cloud, or at the edge.
  • Automates many of the tasks associated with deploying and managing applications, such as rolling updates, service discovery, and load balancing.
  • Allows for the use of multiple orchestration patterns, such as blue-green deployment, canary releases, and A/B testing, which gives developers more flexibility in how they deploy their applications.
Comment

Explore