Containers & Kubernetes

Essential terms every DevOps engineer should know about containers and Kubernetes.

63 Terms Published: 11 Apr, 2026

Containers

Container

A lightweight, standalone, executable package that includes everything needed to run a piece of software code, runtime, libraries, and settings isolated from the host system.

Example

Running an Nginx web server inside a Docker container without installing Nginx on the host.

Code Snippet

docker run -d -p 80:80 nginx

Docker

An open platform for building, shipping, and running applications inside containers, providing tooling to create images, manage containers, and interact with registries.

Example

Building a custom Node.js application image using a Dockerfile.

Code Snippet

docker build -t myapp:latest .

Dockerfile

A text file containing ordered instructions that Docker follows to automatically build a container image, layer by layer.

Example

A Dockerfile that sets up a Python Flask application with all its dependencies.

Code Snippet

```dockerfile
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["python", "app.py"]
```

Docker Image

A read-only, layered template used to create containers. Built from a Dockerfile and stored in a registry. Each layer represents a set of filesystem changes.

Example

Pulling the official PostgreSQL 15 image from Docker Hub to use as a base.

Code Snippet

docker pull postgres:15

Docker Layer

Each instruction in a Dockerfile creates a read-only layer in the resulting image. Layers are cached and reused across builds to improve performance.

Example

A RUN apt-get install layer is cached and not rebuilt if the instruction has not changed.

Code Snippet

```dockerfile
RUN apt-get update && apt-get install -y curl
# This becomes one cached layer
```

Docker Compose

A tool for defining and running multi-container Docker applications using a YAML file, allowing you to start all services with a single command.

Example

Running a web app, a Redis cache, and a PostgreSQL database together with docker compose up.

Code Snippet

```yaml
services:
web:
image: myapp
ports:
- "8080:8080"
db:
image: postgres:15
```

Container Registry

A storage and distribution service for Docker images, allowing teams to push, pull, version, and share images across environments.

Example

Pushing a built image to Amazon ECR after a successful CI pipeline run.

Code Snippet

docker push 123456789.dkr.ecr.us-east-1.amazonaws.com/myapp:latest

Docker Hub

The default public container registry provided by Docker, hosting official images for popular software as well as user-published images.

Example

Pulling the official Node.js image from Docker Hub as a base for a custom application.

Code Snippet

docker pull node:18-alpine

Base Image

The starting point for a Dockerfile, specified in the FROM instruction. It provides the OS and runtime environment on top of which your application is built.

Example

Using node:18-alpine as a base image to keep the final image small.

Code Snippet

FROM node:18-alpine

Multi-stage Build

A Dockerfile technique that uses multiple FROM instructions to separate the build environment from the final runtime image, reducing the size of the produced image.

Example

Compiling a Go binary in one stage and copying only the binary into a minimal final image.

Code Snippet

```dockerfile
FROM golang:1.21 AS builder
RUN go build -o app .
FROM alpine:3.18
COPY --from=builder /app /app
CMD ["/app"]
```

Container Runtime

The low-level software responsible for running containers on a host, managing their lifecycle including starting, stopping, and isolating them using OS primitives.

Example

containerd and CRI-O are common container runtimes used by Kubernetes nodes.

Code Snippet

systemctl status containerd

Volume

A mechanism for persisting data generated by and used by Docker containers, existing outside the container lifecycle so data survives container restarts or deletion.

Example

Mounting a named volume to persist a PostgreSQL database across container restarts.

Code Snippet

docker run -v pgdata:/var/lib/postgresql/data postgres:15

Bind Mount

A type of Docker mount that maps a specific file or directory on the host machine directly into a container, enabling live file sharing between host and container.

Example

Mounting a local source code directory into a development container to enable hot reloading.

Code Snippet

docker run -v $(pwd):/app myapp:dev

Container Network

A virtual network that Docker creates to allow containers to communicate with each other and with the outside world, with different drivers supporting different topologies.

Example

Creating a bridge network so that a web container can reach a database container by name.

Code Snippet

docker network create mynetwork

.dockerignore

A file that specifies patterns of files and directories to exclude from the Docker build context, reducing build time and preventing secrets from being included in images.

Example

Excluding node_modules and .env files from the Docker build context.

Code Snippet

```
node_modules
.env
*.log
.git
```

Container Orchestration

The automated management of containerized workloads across multiple hosts, handling deployment, scaling, networking, and self-healing of containers at scale.

Example

Kubernetes automatically restarting a failed container and rescheduling it on a healthy node.

Code Snippet

kubectl get pods --watch

Kubernetes Configuration

ConfigMap

A Kubernetes object used to store non-sensitive configuration data as key-value pairs, decoupling configuration from container images.

Example

Storing application feature flags and environment-specific settings in a ConfigMap.

Code Snippet

```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: app-config
data:
LOG_LEVEL: "info"
MAX_CONNECTIONS: "100"
```

Secret

A Kubernetes object that stores sensitive data such as passwords, tokens, and TLS certificates, keeping them separate from application code and pod specs.

Example

Storing a database password as a Kubernetes Secret and injecting it as an environment variable.

Code Snippet

kubectl create secret generic db-secret --from-literal=password=mypassword

ResourceQuota

A Kubernetes policy that limits the aggregate resource consumption per namespace, controlling how much CPU, memory, and object count a team can use.

Example

Limiting the staging namespace to a maximum of 8 CPU cores and 16Gi of memory.

Code Snippet

```yaml
apiVersion: v1
kind: ResourceQuota
spec:
hard:
requests.cpu: "8"
requests.memory: 16Gi
```

LimitRange

A Kubernetes policy that sets default and maximum resource requests and limits for containers in a namespace, preventing unbounded resource consumption.

Example

Setting a default memory limit of 512Mi for all containers in the dev namespace.

Code Snippet

```yaml
apiVersion: v1
kind: LimitRange
spec:
limits:
- default:
memory: 512Mi
type: Container
```

Kubernetes Core

Kubernetes (K8s)

An open-source container orchestration platform originally developed by Google that automates deploying, scaling, and managing containerized applications across clusters.

Example

Running a production web application across 10 nodes with automatic scaling and self-healing.

Code Snippet

kubectl cluster-info

Cluster

A set of machines (nodes) that run containerized applications managed by Kubernetes, consisting of at least one control plane and one or more worker nodes.

Example

A production EKS cluster with 3 control plane nodes and 10 worker nodes across 3 availability zones.

Code Snippet

kubectl get nodes

Control Plane

The set of components that manage the overall state of the Kubernetes cluster, including scheduling workloads, maintaining desired state, and serving the API.

Example

The control plane detects that a pod has crashed and schedules a replacement on a healthy node.

Code Snippet

kubectl get componentstatuses

Node

A physical or virtual machine in a Kubernetes cluster that runs workloads. Each node contains a kubelet, container runtime, and kube-proxy.

Example

A worker node running five pods across two namespaces.

Code Snippet

kubectl describe node my-node

Pod

The smallest deployable unit in Kubernetes, consisting of one or more tightly coupled containers that share the same network namespace, IP address, and storage volumes.

Example

A pod containing an application container and a sidecar container for log shipping.

Code Snippet

```yaml
apiVersion: v1
kind: Pod
metadata:
name: my-pod
spec:
containers:
- name: app
image: myapp:latest
```

Namespace

A Kubernetes mechanism for isolating groups of resources within a single cluster, providing scope for names, resource quotas, and access control policies.

Example

Using separate namespaces for dev, staging, and production environments in the same cluster.

Code Snippet

kubectl create namespace staging

etcd

A distributed key-value store used by Kubernetes as its primary backing store for all cluster state and configuration data.

Example

All Kubernetes objects pods, services, configmaps are persisted in etcd.

Code Snippet

etcdctl get /registry/pods/default/my-pod

kube-scheduler

The Kubernetes control plane component responsible for assigning newly created pods to nodes, based on resource requirements, constraints, and policies.

Example

The scheduler placing a pod with 4 CPU requests on a node that has sufficient available capacity.

Code Snippet

kubectl -n kube-system get pod -l component=kube-scheduler

kube-proxy

A network component that runs on each node and maintains network rules to forward traffic destined for Services to the correct pod endpoints.

Example

kube-proxy updating iptables rules when a new pod is added to a Service endpoint.

Code Snippet

kubectl -n kube-system get pod -l k8s-app=kube-proxy

Kubernetes Networking

Service

A Kubernetes abstraction that provides a stable network endpoint for accessing a set of pods, with built-in load balancing and DNS-based service discovery.

Example

Exposing a backend deployment internally to other services using a ClusterIP Service.

Code Snippet

```yaml
apiVersion: v1
kind: Service
spec:
selector:
app: backend
ports:
- port: 80
targetPort: 8080
```

ClusterIP

The default Kubernetes Service type that exposes the service on an internal cluster IP, making it reachable only from within the cluster.

Example

A database service exposed only internally to application pods in the same cluster.

Code Snippet

```yaml
spec:
type: ClusterIP
ports:
- port: 5432
```

NodePort

A Kubernetes Service type that exposes the service on a static port on each node's IP, making it accessible from outside the cluster via any node's IP and that port.

Example

Exposing a development application externally on port 30080 for testing.

Code Snippet

```yaml
spec:
type: NodePort
ports:
- port: 80
nodePort: 30080
```

LoadBalancer

A Kubernetes Service type that provisions an external cloud load balancer and assigns a public IP, forwarding traffic into the cluster's pods.

Example

Exposing a production web application publicly using a LoadBalancer Service on AWS EKS.

Code Snippet

```yaml
spec:
type: LoadBalancer
ports:
- port: 443
```

Ingress

A Kubernetes API object that manages external HTTP and HTTPS access to services, providing routing rules, TLS termination, and virtual hosting in one place.

Example

Routing traffic to different microservices based on URL path using an Nginx Ingress controller.

Code Snippet

```yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
spec:
rules:
- host: app.example.com
http:
paths:
- path: /api
backend:
service:
name: api-service
```

Ingress Controller

A pod that runs inside the cluster and implements the Ingress rules, acting as a reverse proxy and load balancer for incoming traffic. Common options include Nginx and Traefik.

Example

Installing the Nginx Ingress Controller via Helm to handle all incoming HTTP traffic.

Code Snippet

helm install ingress-nginx ingress-nginx/ingress-nginx

Kubernetes Reliability

Liveness Probe

A Kubernetes health check that determines if a container is still running correctly. If the probe fails, Kubernetes restarts the container automatically.

Example

A liveness probe hitting /healthz every 10 seconds and restarting the container if it fails 3 times.

Code Snippet

```yaml
livenessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 10
periodSeconds: 10
```

Readiness Probe

A Kubernetes health check that determines if a container is ready to accept traffic. Pods that fail the readiness probe are removed from Service endpoints until they recover.

Example

A readiness probe preventing traffic from reaching a pod while it initializes its database connection.

Code Snippet

```yaml
readinessProbe:
httpGet:
path: /ready
port: 8080
initialDelaySeconds: 5
periodSeconds: 5
```

Startup Probe

A Kubernetes health check that gives slow-starting containers extra time to initialize before liveness and readiness probes take over, preventing premature restarts.

Example

A startup probe allowing a legacy Java application up to 3 minutes to start before checking health.

Code Snippet

```yaml
startupProbe:
httpGet:
path: /healthz
port: 8080
failureThreshold: 30
periodSeconds: 10
```

Rolling Update

A Kubernetes Deployment strategy that gradually replaces old pod replicas with new ones, ensuring zero downtime by keeping some replicas available throughout the update.

Example

Deploying a new application version by replacing pods one at a time while maintaining availability.

Code Snippet

```yaml
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
```

Pod Disruption Budget (PDB)

A Kubernetes policy that limits the number of pods of a replicated application that can be simultaneously unavailable during voluntary disruptions such as node drains.

Example

Ensuring at least 2 replicas of a web service are always available during a node upgrade.

Code Snippet

```yaml
apiVersion: policy/v1
kind: PodDisruptionBudget
spec:
minAvailable: 2
selector:
matchLabels:
app: my-web
```

Kubernetes Scaling

HorizontalPodAutoscaler (HPA)

A Kubernetes resource that automatically scales the number of pod replicas in a Deployment based on observed CPU utilization or custom metrics.

Example

Automatically scaling a web deployment from 2 to 20 replicas based on CPU usage exceeding 60%.

Code Snippet

kubectl autoscale deployment my-app --cpu-percent=60 --min=2 --max=20

VerticalPodAutoscaler (VPA)

A Kubernetes component that automatically adjusts the CPU and memory resource requests and limits of containers based on historical usage patterns.

Example

Using VPA to right-size a memory-hungry container that was over-provisioned at initial deployment.

Code Snippet

```yaml
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
spec:
updatePolicy:
updateMode: Auto
```

Cluster Autoscaler

A Kubernetes component that automatically adjusts the number of nodes in a cluster when pods cannot be scheduled due to resource constraints or nodes are underutilized.

Example

The Cluster Autoscaler adding a new node to AWS EKS when pending pods cannot be scheduled.

Code Snippet

kubectl -n kube-system logs deployment/cluster-autoscaler

Kubernetes Scheduling

Taint & Toleration

A Kubernetes mechanism where taints are applied to nodes to repel pods, and tolerations are applied to pods to allow them to schedule onto tainted nodes.

Example

Tainting GPU nodes so only ML workloads with the correct toleration can be scheduled on them.

Code Snippet

```yaml
tolerations:
- key: "gpu"
operator: "Equal"
value: "true"
effect: "NoSchedule"
```

Node Affinity

A Kubernetes scheduling rule that constrains which nodes a pod can be scheduled onto based on node labels, offering more expressive rules than node selectors.

Example

Scheduling data-intensive pods exclusively onto nodes in the us-east-1a availability zone.

Code Snippet

```yaml
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: topology.kubernetes.io/zone
operator: In
values: [us-east-1a]
```

Kubernetes Security

RBAC (Role-Based Access Control)

A Kubernetes authorization mechanism that regulates access to cluster resources based on the roles assigned to users or service accounts.

Example

Granting a CI/CD service account permission to deploy to the production namespace only.

Code Snippet

```yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
rules:
- apiGroups: ["apps"]
resources: ["deployments"]
verbs: ["get", "update"]
```

ServiceAccount

A Kubernetes identity assigned to pods, allowing them to authenticate to the Kubernetes API and interact with cluster resources according to their RBAC permissions.

Example

Assigning a ServiceAccount to a pod that needs to list other pods in the same namespace.

Code Snippet

```yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: app-service-account
namespace: production
```

NetworkPolicy

A Kubernetes resource that controls the traffic flow at the IP address or port level between pods and external endpoints, acting as a firewall within the cluster.

Example

Restricting a database pod to only accept connections from pods with the label app=backend.

Code Snippet

```yaml
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
spec:
ingress:
- from:
- podSelector:
matchLabels:
app: backend
```

Kubernetes Storage

PersistentVolume (PV)

A piece of storage in the cluster provisioned by an administrator or dynamically by a StorageClass, with a lifecycle independent of any pod that uses it.

Example

A 100Gi EBS volume provisioned as a PersistentVolume for a PostgreSQL StatefulSet.

Code Snippet

```yaml
apiVersion: v1
kind: PersistentVolume
spec:
capacity:
storage: 100Gi
accessModes:
- ReadWriteOnce
```

PersistentVolumeClaim (PVC)

A request for storage by a user that consumes a PersistentVolume, specifying size and access mode. Kubernetes binds the PVC to a suitable PV automatically.

Example

A pod requesting 10Gi of storage via a PVC that Kubernetes binds to an available PV.

Code Snippet

```yaml
apiVersion: v1
kind: PersistentVolumeClaim
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
```

StorageClass

A Kubernetes resource that defines different classes of storage with their provisioner and parameters, enabling dynamic provisioning of PersistentVolumes on demand.

Example

A StorageClass backed by AWS gp3 EBS volumes that auto-provisions storage when a PVC is created.

Code Snippet

```yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
provisioner: ebs.csi.aws.com
parameters:
type: gp3
```

Kubernetes Tooling

Helm

A package manager for Kubernetes that uses charts to define, install, and upgrade complex Kubernetes applications, simplifying repeatable deployments.

Example

Installing a full Prometheus + Grafana monitoring stack with a single Helm install command.

Code Snippet

helm install monitoring prometheus-community/kube-prometheus-stack

Helm Chart

A collection of files that describe a related set of Kubernetes resources, packaged together with configurable values to enable reusable and versioned application deployments.

Example

A Helm chart for a web application with configurable replicas, image tag, and ingress hostname.

Code Snippet

```
mychart/
Chart.yaml
values.yaml
templates/
deployment.yaml
service.yaml
```

kubectl

The command-line tool for interacting with Kubernetes clusters, allowing you to deploy applications, inspect resources, and manage cluster operations.

Example

Using kubectl to view all pods across all namespaces and their current status.

Code Snippet

kubectl get pods --all-namespaces

kubeconfig

A YAML file that stores cluster connection details, credentials, and context configurations, used by kubectl to authenticate and communicate with Kubernetes clusters.

Example

Switching between a staging and production cluster context using kubectl.

Code Snippet

kubectl config use-context production-cluster

Kubernetes Workloads

Deployment

A Kubernetes resource that declaratively manages a set of identical, stateless pod replicas, supporting rolling updates, rollbacks, and scaling.

Example

Scaling a web application from 3 to 10 replicas during peak traffic.

Code Snippet

kubectl scale deployment my-app --replicas=10

ReplicaSet

A Kubernetes resource that ensures a specified number of pod replicas are running at any given time. Usually managed by a Deployment rather than directly.

Example

A ReplicaSet maintaining exactly 3 running replicas of a web server pod.

Code Snippet

kubectl get replicasets

StatefulSet

A Kubernetes workload resource for managing stateful applications, providing stable pod identities, ordered deployment, and persistent storage per pod.

Example

Running a 3-node Kafka cluster using a StatefulSet with persistent volumes for each broker.

Code Snippet

```yaml
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: kafka
spec:
serviceName: kafka
replicas: 3
```

DaemonSet

A Kubernetes resource that ensures a copy of a specific pod runs on every node (or a subset of nodes) in the cluster, commonly used for logging and monitoring agents.

Example

Deploying a Fluentd log collector pod on every node using a DaemonSet.

Code Snippet

```yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: fluentd
```

Job

A Kubernetes resource that creates one or more pods to execute a finite task and ensures they run to successful completion, then terminates.

Example

Running a database migration script as a Kubernetes Job before deploying a new application version.

Code Snippet

```yaml
apiVersion: batch/v1
kind: Job
metadata:
name: db-migration
```

CronJob

A Kubernetes resource that creates Jobs on a repeating schedule defined using cron syntax, useful for periodic batch tasks like backups or report generation.

Example

Running a nightly database backup job at 2:00 AM using a CronJob.

Code Snippet

```yaml
apiVersion: batch/v1
kind: CronJob
spec:
schedule: "0 2 * * *"
```

Init Container

A specialized container that runs to completion before app containers in a pod start, used for setup tasks such as waiting for a dependency or initializing config files.

Example

An init container waiting for a database to be ready before the main application container starts.

Code Snippet

```yaml
initContainers:
- name: wait-for-db
image: busybox
command: ['sh', '-c', 'until nc -z db 5432; do sleep 2; done']
```

Sidecar Container

A helper container that runs alongside the main application container in the same pod, augmenting or supporting its functionality without modifying the main image.

Example

A Fluentd sidecar container collecting and forwarding logs from the main application container.

Code Snippet

```yaml
containers:
- name: app
image: myapp
- name: log-shipper
image: fluentd
```

Discuss this Glossary

Related Posts

You might also enjoy

Check out some of our other posts on similar topics

DevOps Basics

This glossary covers foundational terms used in DevOps and cloud engineering, spanning containerization, orchestration, infrastructure as code, CI/CD pipelines, observability, and deployment strategie

Linux Server Administration

This glossary covers essential Linux server administration concepts, from system architecture and user management to networking, storage, process management, performance tuning, and security hardening

2 related posts