USD ($)
$
United States Dollar
Euro Member Countries
India Rupee
د.إ
United Arab Emirates dirham
ر.س
Saudi Arabia Riyal

Container Orchestration

Lesson 34/40 | Study Time: 15 Min

Kubernetes is a widely adopted container orchestration platform that automates deployment, scaling, and management of containerized applications. It introduces abstractions such as Pods and Services to encapsulate containers and expose them reliably within clusters.

The kubectl command-line tool serves as the interface for interacting with Kubernetes clusters, managing resources, and querying cluster state. Understanding essential Kubernetes concepts and commands is critical for modern container-based infrastructure management.

Kubernetes Concepts

Kubernetes abstracts container management through well-defined building blocks. Following are the primary concepts used in Kubernetes environments.


Basic kubectl Commands

The kubectl utility allows administrators to deploy, inspect, and troubleshoot Kubernetes resources. Below is a list of commonly used basic kubectl commands.


1. Verify kubectl installation and cluster connection:

text
kubectl version
kubectl cluster-info


2. List nodes in cluster:

text
kubectl get nodes


3. List all Pods in the default namespace:

text
kubectl get pods


4. Get detailed info about a Pod:

text
kubectl describe pod <pod-name>


5. View logs of a container in a Pod:

text
kubectl logs <pod-name>


6. Open an interactive terminal inside a running Pod:

text
kubectl exec -it <pod-name> -- /bin/bash

Pod and Service Management

Administrators use pod and service commands to maintain application availability and accessibility. Below are the primary commands for pod deployment and service exposure.


1. Create a Pod from a YAML configuration:

text
kubectl apply -f pod.yaml


2. Delete a Pod:

text
kubectl delete pod <pod-name>


3. Expose a Deployment as a Service with NodePort (external access):

text
kubectl expose deployment <deployment-name> --type=NodePort --port=80 --target-port=8080


4. List Services:

text
kubectl get services

Configuration Deployment

Use YAML manifests to declare desired application state: Pods, Services, Deployments, ConfigMaps.


1. Apply changes declaratively with:

text
kubectl apply -f <file.yaml>


2. Scale Deployments to adjust replica count:

text
kubectl scale deployment/<deployment-name> --replicas=3


3. Update Deployments with new container images or configurations using kubectl apply.