0% found this document useful (0 votes)
27 views12 pages

Core Concepts of Kubernetes

Kubernetes (K8s) is an open-source platform for automating the deployment, scaling, and management of containerized applications across clusters of machines. Key concepts include clusters, nodes, pods, deployments, services, and namespaces, which help organize and manage resources efficiently. Kubernetes also supports various commands for managing these components, ensuring streamlined operations and resource utilization.

Uploaded by

PROBLEMS?
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views12 pages

Core Concepts of Kubernetes

Kubernetes (K8s) is an open-source platform for automating the deployment, scaling, and management of containerized applications across clusters of machines. Key concepts include clusters, nodes, pods, deployments, services, and namespaces, which help organize and manage resources efficiently. Kubernetes also supports various commands for managing these components, ensuring streamlined operations and resource utilization.

Uploaded by

PROBLEMS?
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Kubernetes, often abbreviated as K8s, is an open-source container orchestration platform that

automates the deployment, scaling, and management of containerized applications. Think of it


as a system that helps you manage and run your applications efficiently across a cluster of
machines.
Essentially, Kubernetes lets you treat a group of servers (physical or virtual) as a single, unified
computing resource. This simplifies deployment, scaling, and operational tasks, enabling faster
development cycles and improved resource utilization.

Let's break down some of the fundamental concepts in Kubernetes:

 Cluster: A set of nodes that run containerized applications managed by Kubernetes.


 Node: A worker machine in Kubernetes. It can be a physical or virtual machine. Each
node runs the kubelet, which is the agent that manages the node and communicates
with the Kubernetes control plane.
 Pod: The smallest deployable unit in Kubernetes. A Pod can contain one or more
containers that share storage and network resources.
 Deployment: A declarative way to define how your application should be deployed and
scaled. It ensures that the desired number of Pod replicas are running at any given time.
 Service: An abstraction that exposes an application running on a set of Pods as a
network service. It provides a stable IP address and DNS name for accessing the
application, even if the underlying Pods change.
A Namespace provides a way to divide cluster resources between multiple users or teams. It's
a logical partition within a Kubernetes cluster.

Commands:
1. kubectl create namespace dev
2. kubectl get namespaces

A Pod is the smallest deployable unit in Kubernetes. It represents a single instance of a running
process in the cluster and can contain one or more containers.

Commands:
1. kubectl get pods -n dev
2. kubectl get pods

A Pod can run multiple containers that share the same network and storage.

Labels are key-value pairs attached to Kubernetes objects. They are used to organize and select
subsets of objects.
Annotations are key-value pairs used to store arbitrary non-identifying metadata about
objects.
Unlike labels, annotations are not used to select objects.

Environment variables are used to pass configuration information into containers. They allow
you to customize the behavior of applications without modifying the container image.
Resources define the CPU and memory requests and limits for containers. This ensures that
containers have sufficient resources to run and prevents them from consuming excessive
resources.
A ConfigMap stores non-sensitive configuration data in key-value pairs. Pods can consume
ConfigMaps as environment variables, command-line arguments, or configuration files.

A Pod can consume a ConfigMap as environment variables or volumes to configure the


application running inside the container.
A Secret stores sensitive data, such as passwords, API tokens, or SSH keys. Secrets are stored in
base64 encoded format.

A Pod can use a Secret as environment variables or mounted files to access sensitive
information. This is a secure way to pass credentials to applications.
A Service abstracts and exposes a set of Pods as a network service. It provides a stable IP
address and DNS name for accessing the Pods.

Types of Services in Kubernetes


1. ClusterIP - Default. Exposes service internally within the cluster
2. NodePort - Opens a port on each Node's IP, accessible from outside
3. LoadBalancer - Provisions an external cloud load balancer (AWS, GCP, etc.)
4. ExternalName - Maps the service to an external DNS name

Commands:
1. kubectl get services (List All Services)
2. kubectl describe service <service-name> (Describe a Service)
NodePort is a type of Kubernetes Service that allows you to access your application from
outside the cluster using a port on any Node's IP.

Commands:
1. kubectl expose deployment my-app --type=NodePort --port=80 --target-port=80
2. kubectl get svc my-nodeport-service
LoadBalancer is a Kubernetes Service type that exposes your application to the internet by
creating an external load balancer (usually from your cloud provider like AWS, Azure, or GCP).

Commands:
1. kubectl expose deployment my-app --type=LoadBalancer --port=80 --target-port=80
2. kubectl get svc my-loadbalancer-service
A ReplicaSet ensures that a specified number of identical Pods are running at any given time. If
a Pod fails, the ReplicaSet automatically creates a new one to maintain the desired count.

Commands:
1. kubectl apply -f replicaset.yaml
2. kubectl get replicasets

A Deployment manages ReplicaSets and provides declarative updates for Pods. It allows you to
easily roll out new versions of your application with zero downtime.
Commands:
1. kubectl apply -f deployment.yaml
2. kubectl get deployments

You might also like