Explanation

What Is Kubernetes (K8s) Explained Simply

Kubernetes is an open-source container orchestration platform that automates deploying, scaling, and managing containerized applications. This guide explains K8s architecture, core components, and why enterprises choose it for production workloads.

Evan Mael
Evan MaelDirector anavem.com
12views
96%

of organizations surveyed by CNCF are using or evaluating Kubernetes - it has become the de facto standard for container orchestration

Docker solved packaging. It made containers practical by standardizing how applications and their dependencies get bundled into portable units that run consistently everywhere. But Docker alone does not answer the harder questions: How do you run hundreds of containers across dozens of servers? How do you ensure applications stay running when servers fail? How do you scale from ten containers to ten thousand without manual intervention?

Kubernetes answers those questions. It is the operating system for your datacenter, turning a collection of machines into a unified platform that manages applications automatically.


What Kubernetes Actually Does

At its core, Kubernetes is a system for automating deployment, scaling, and operations of application containers across clusters of hosts. That definition, while accurate, obscures the practical value.

Kubernetes handles the operational complexity that would otherwise require armies of operations engineers:

Traditional OperationsKubernetes Operations
Manual server provisioningAutomatic pod scheduling
SSH to servers for deploymentsDeclarative rolling updates
Load balancer configurationService discovery built-in
Manual failover proceduresAutomatic self-healing
Capacity planning spreadsheetsHorizontal auto-scaling
Server-by-server monitoringUnified cluster metrics

Architecture: Control Plane and Worker Nodes

A Kubernetes cluster consists of two types of machines: those that make decisions and those that execute them.

Control Plane Components

The control plane hosts the brain of the cluster. Understanding its components helps troubleshoot when things go wrong.

ComponentFunctionFailure Impact
API ServerFront door for all cluster operationsTotal cluster unavailability
etcdDistributed key-value store for all cluster stateData loss, cluster failure
SchedulerAssigns pods to nodes based on resourcesNew pods stuck pending
Controller ManagerRuns controllers that reconcile stateSelf-healing stops working
Cloud ControllerIntegrates with cloud provider APIsLoad balancers, storage fail

Worker Node Components

Worker nodes run your actual applications. Each node runs:

kubelet - The agent that receives instructions from the API server and ensures containers are running as expected. It reports node status and executes pod lifecycle operations.

Container Runtime - The software that actually runs containers. Usually containerd or CRI-O in modern clusters. Docker is no longer required.

kube-proxy - Maintains network rules that allow communication to pods from inside or outside the cluster.


Pods: The Fundamental Unit

The pod is the smallest deployable unit in Kubernetes. Understanding pods is essential for working with the platform effectively.

1-2 Containers

Most pods run a single application container. Multi-container pods are for tightly coupled helper processes only - not general application architecture.

A pod represents a group of one or more containers that share storage and network resources. While most pods contain a single application container, multi-container pods serve specific purposes:

Multi-Container PatternUse CaseExample
SidecarExtend or enhance the main containerLog shipper, proxy, metrics agent
AmbassadorProxy connections to outside servicesService mesh proxy, API gateway
AdapterTransform output for consumptionLog format converter, metrics aggregator

Pod Lifecycle

Pods are ephemeral by design. They are created, run, and eventually terminate - they are never repaired in place.

PhaseDescription
PendingPod accepted but containers not yet created
RunningAt least one container is running
SucceededAll containers terminated successfully
FailedAt least one container terminated with failure
UnknownPod state cannot be determined

Pod Networking

Every pod gets its own IP address. Containers within a pod share that IP and can communicate via localhost. This flat network model simplifies application architecture significantly compared to traditional VM networking.


Services and Networking

Pods receive IP addresses, but these addresses are ephemeral - they change when pods restart or move. Services provide stable networking that survives pod lifecycle events.

Service Types

TypeAccessibilityUse Case
ClusterIPInternal onlyDefault. Internal service communication
NodePortExternal via node portsTesting, simple external access
LoadBalancerExternal via cloud LBProduction external traffic
ExternalNameCNAME redirectAccessing external services

How Services Work

Services use label selectors to find their backend pods. When you create a service targeting pods with label "app=api", Kubernetes automatically tracks all pods matching that label and load balances traffic across them.

apiVersion: v1
kind: Service
metadata:
  name: api-service
spec:
  selector:
    app: api
  ports:
    - port: 80
      targetPort: 8080
  type: ClusterIP

Ingress: HTTP/HTTPS Routing

For HTTP workloads, Ingress provides sophisticated routing, TLS termination, and virtual hosting. A single LoadBalancer can serve multiple services through intelligent path and host-based routing.

FeatureService LoadBalancerIngress
CostOne LB per serviceOne LB for many services
TLSExternal terminationBuilt-in TLS management
RoutingPort-based onlyPath and host-based
HTTP featuresNoneHeaders, redirects, rewrites

Storage and Persistence

Containers by default have ephemeral filesystems. When a container restarts, its filesystem resets. Kubernetes provides abstractions for persistent storage that survives pod lifecycle events.

Storage Abstractions

ConceptPurposeManaged By
VolumeStorage attached to a podPod definition
PersistentVolume (PV)Cluster-wide storage resourceAdmin
PersistentVolumeClaim (PVC)Request for storageDeveloper
StorageClassDynamic provisioning templatesAdmin

Volume Types

TypePersistenceUse Case
emptyDirPod lifetimeScratch space, cache
hostPathNode lifetimeSystem agents, testing
PVCClaim lifetimeDatabases, stateful apps
configMap/secretConfig lifetimeConfiguration files

StatefulSets for Databases

For applications requiring stable network identity and persistent storage - databases, message queues, distributed systems - StatefulSets provide:

  • Stable, unique network identifiers (pod-0, pod-1, pod-2)
  • Stable, persistent storage per pod
  • Ordered deployment, scaling, and updates
  • Ordered, graceful deletion

Configuration and Secrets

Applications need configuration - database connection strings, API endpoints, feature flags. Kubernetes provides dedicated resources for configuration management.

ConfigMaps

ConfigMaps hold non-sensitive configuration data. You can create them from literal values, files, or directories.

Injection MethodUse Case
Environment variablesSimple key-value config
Volume mountConfiguration files
Command-line argumentsOverride defaults
apiVersion: v1
kind: ConfigMap
metadata:
  name: app-config
data:
  LOG_LEVEL: "info"
  DATABASE_HOST: "postgres.production.svc"
  config.yaml: |
    server:
      port: 8080

Secrets

Secrets hold sensitive data. Kubernetes stores them encoded (base64) and can integrate with external secret managers for encryption at rest.

External Secrets Operators

For production environments, consider external secret management:

SolutionProsCons
VaultFull-featured, audit loggingComplex setup
AWS Secrets ManagerNative AWS integrationAWS lock-in
External Secrets OperatorMultiple backendsAnother component to manage
Sealed SecretsGit-friendly encryptionManual rotation

Deployments and Rolling Updates

Deploying new application versions without downtime requires careful orchestration. Kubernetes Deployments automate this process.

0 Downtime

Properly configured Deployments provide zero-downtime updates by gradually replacing old pods with new ones while maintaining service availability throughout.

How Rolling Updates Work

When you update a Deployment - changing the container image for example - Kubernetes performs a rolling update:

  1. Create new pods with updated specification
  2. Wait for new pods to pass health checks
  3. Remove old pods gradually
  4. Continue until all pods updated
ParameterPurposeDefault
maxSurgeExtra pods during update25%
maxUnavailablePods that can be down25%

Rollback Capability

Kubernetes maintains deployment history, enabling instant rollback:

# Check deployment history
kubectl rollout history deployment/myapp

# Rollback to previous version
kubectl rollout undo deployment/myapp

# Rollback to specific revision
kubectl rollout undo deployment/myapp --to-revision=2

Deployment Strategies

StrategyBehaviorUse Case
RollingUpdateGradual replacementDefault, most workloads
RecreateKill all, then create newBreaking changes, stateful apps
Blue-GreenParallel environmentsZero-risk rollback needed
CanaryGradual traffic shiftTesting in production

Scaling and Resource Management

Kubernetes manages computational resources - CPU and memory - at multiple levels, enabling efficient infrastructure utilization.

Resource Requests and Limits

Resource SettingPurposeIf Not Set
RequestGuaranteed minimum, used for schedulingPod may be scheduled on overloaded node
LimitMaximum allowedContainer can consume entire node
resources:
  requests:
    memory: "256Mi"
    cpu: "250m"
  limits:
    memory: "512Mi"
    cpu: "500m"

Horizontal Pod Autoscaler (HPA)

HPA automatically adjusts replica count based on observed metrics:

Metric TypeSourceExample
CPUBuilt-inScale at 80% average CPU
MemoryBuilt-inScale at 70% average memory
CustomPrometheus, etc.Scale on queue depth, request latency

Vertical Pod Autoscaler (VPA)

VPA automatically adjusts resource requests and limits based on actual usage. It helps right-size containers but requires pod restarts to apply changes.

Cluster Autoscaler

Cluster Autoscaler adds or removes nodes from your cluster based on pod scheduling needs:

  • Scales up when pods cannot be scheduled due to insufficient resources
  • Scales down when nodes are underutilized for extended periods
  • Respects pod disruption budgets during scale-down

Security Fundamentals

Kubernetes requires deliberate security configuration. Default settings prioritize developer convenience over security.

Role-Based Access Control (RBAC)

RBAC controls who can perform what actions on which resources:

ConceptPurpose
RoleDefines permissions within a namespace
ClusterRoleDefines cluster-wide permissions
RoleBindingGrants Role to users/groups in namespace
ClusterRoleBindingGrants ClusterRole cluster-wide

Pod Security

ControlPurposeImplementation
Run as non-rootPrevent privilege escalationsecurityContext.runAsNonRoot
Read-only filesystemPrevent runtime modificationsecurityContext.readOnlyRootFilesystem
Drop capabilitiesMinimize Linux capabilitiessecurityContext.capabilities.drop
Pod Security StandardsEnforce baseline securityPodSecurity admission controller

Network Policies

By default, all pods can communicate with all other pods. Network Policies restrict this:

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: deny-all
spec:
  podSelector: {}
  policyTypes:
  - Ingress
  - Egress

Supply Chain Security

ConcernMitigation
Malicious imagesUse trusted registries, sign images
Vulnerable dependenciesRegular scanning, automated updates
Compromised runtimeUse read-only containers, minimal base images
Configuration driftGitOps, policy enforcement

The Kubernetes Ecosystem

Kubernetes provides a foundation, but production deployments typically require additional components. A rich ecosystem has developed around the core platform.

Package Management

ToolPurposeComplexity
HelmCharts bundle Kubernetes manifestsMedium
KustomizeOverlay-based customizationLow
CarvelTool suite for app deploymentMedium

Observability Stack

CategoryCommon Tools
MetricsPrometheus, Grafana, Datadog
LoggingLoki, Elasticsearch, Fluentd
TracingJaeger, Zipkin, OpenTelemetry
DashboardsGrafana, Kubernetes Dashboard

Service Mesh

Service meshes add traffic management, security, and observability for service-to-service communication:

FeatureWithout Service MeshWith Service Mesh
mTLS between servicesManual configurationAutomatic
Traffic splittingCustom codeConfiguration
ObservabilityPer-app instrumentationAutomatic
Retries, timeoutsApp responsibilityInfrastructure

Popular options include Istio (feature-rich but complex), Linkerd (simpler, lighter), and Cilium (eBPF-based).

GitOps Tools

ToolApproach
ArgoCDPull-based, UI-focused
FluxPull-based, Git-native
Jenkins XCI/CD integrated

Common Mistakes and Misconceptions

Several misunderstandings persist about Kubernetes. Clarifying them helps set appropriate expectations.

Misconception: Kubernetes Is Only for Large Organizations

Kubernetes runs effectively on three-node clusters or even single-node development environments like minikube. The operational overhead comes from the ecosystem complexity, not the cluster size.

Common Operational Mistakes

MistakeConsequencePrevention
No resource limitsSingle pod consumes entire nodeAlways set limits
No health probesBroken pods receive trafficImplement liveness/readiness
No pod disruption budgetsUpgrades cause outagesDefine PDBs for critical workloads
Running as rootSecurity vulnerabilities exploitableEnforce non-root containers
No network policiesLateral movement possibleDefault deny policies
etcd without backupsTotal cluster lossRegular automated backups

Complexity Traps

When Not to Use Kubernetes

Kubernetes adds operational overhead. It may not be appropriate for:

  • Simple applications with stable load
  • Teams without Kubernetes expertise and no time to learn
  • Legacy applications that cannot be containerized
  • Environments where managed platforms (Heroku, App Engine) meet requirements

Getting Started: Practical Next Steps

Moving from understanding to practice requires concrete steps. Here is a reasonable progression for IT professionals new to Kubernetes.

Week 1-2: Local Development

Start locally with minimal complexity:

ToolBest For
Docker DesktopmacOS/Windows with built-in K8s
minikubeFeature-rich local cluster
kindCI/CD environments, fast startup
k3dLightweight, k3s-based

Deploy simple applications using kubectl. Understand pods, services, and deployments through hands-on experimentation.

Week 3-4: Core Concepts

Build deeper understanding:

  • Configure resource requests and limits
  • Implement health probes (liveness, readiness)
  • Use ConfigMaps and Secrets
  • Deploy a stateful application with persistent storage
  • Set up Ingress for HTTP routing

Month 2: Production Patterns

Move toward production-readiness:

SkillPractice
HelmPackage and deploy third-party software
MonitoringSet up Prometheus and Grafana
CI/CDBuild deployment pipelines
SecurityImplement RBAC and network policies

Managed Kubernetes Path

For production workloads, managed services reduce operational burden:

ProviderServiceDifferentiator
AWSEKSDeep AWS integration
GoogleGKEFeature-rich, autopilot option
AzureAKSAzure AD integration
DigitalOceanDOKSSimple, cost-effective

Kubernetes documentation at kubernetes.io provides authoritative references. The CNCF landscape at landscape.cncf.io maps the broader cloud-native ecosystem.

Frequently Asked Questions

Docker is a container runtime that packages and runs individual containers. Kubernetes is an orchestration platform that manages many containers across multiple servers, handling deployment, scaling, networking, and self-healing. Kubernetes can use Docker or other container runtimes to actually run containers.

No. While Kubernetes was designed for massive scale, it benefits organizations of any size by standardizing deployment patterns, enabling portability across cloud providers, and automating operational tasks. Small teams often use managed Kubernetes services to reduce operational overhead.

Yes. Kubernetes runs on any infrastructure - cloud, on-premises, or hybrid. Distributions like OpenShift, Rancher, and Tanzu simplify on-premises deployment. The same Kubernetes knowledge applies regardless of where the cluster runs.

Basic competency with core concepts - pods, services, deployments - typically requires a few weeks of hands-on practice. Production-level expertise including networking, security, and troubleshooting develops over several months. The Certified Kubernetes Administrator (CKA) exam represents a meaningful proficiency milestone.

Monolithic legacy applications that cannot be containerized, workloads requiring specialized hardware without Kubernetes drivers, applications with extreme low-latency requirements, and simple static sites often do not benefit from Kubernetes complexity. Evaluate each workload individually.

Comments

Want to join the discussion?

Create an account to unlock exclusive member content, save your favorite articles, and join our community of IT professionals.

Sign in