Introduction to Kubernetes
1 - What is Kubernetes?
Kubernetes (often abbreviated K8s) is an open-source container orchestration platform originally developed by Google. It automates the deployment, scaling, and management of containerized applications.
Why "K8s"?
The name "K8s" comes from an abbreviation of Kubernetes: K + 8 letters + s. This convention is common in the tech world (i18n for internationalization, l10n for localization).
The problem Kubernetes solves
Without orchestration, managing containers quickly becomes complex:
| Challenge | Without Kubernetes | With Kubernetes |
|---|---|---|
| Deployment | Manual, custom scripts | Declarative, automated |
| Scaling | Complex, manual intervention | Automatic (HPA) |
| High availability | Manual configuration | Native |
| Updates | Downtime | Rolling updates |
| Recovery | Manual intervention | Self-healing |
2 - History and evolution
Origins at Google
Kubernetes has its roots in Borg and Omega, Google's internal systems that manage billions of containers each week.
The Cloud Native Computing Foundation (CNCF)
In 2015, Google donated Kubernetes to the CNCF, a foundation that hosts many cloud-native projects:
- Kubernetes - Orchestration
- Prometheus - Monitoring
- Envoy - Service mesh
- Helm - Package manager
- etcd - Distributed database
3 - Key concepts
The declarative model
Kubernetes uses a declarative model: you describe the desired state of your application, and Kubernetes ensures that state is maintained.
# Exemple : Déclarer un déploiement avec 3 réplicas
apiVersion: apps/v1
kind: Deployment
metadata:
name: mon-application
spec:
replicas: 3 # État souhaité : 3 instances
selector:
matchLabels:
app: mon-app
template:
metadata:
labels:
app: mon-app
spec:
containers:
- name: app
image: nginx:latest
ports:
- containerPort: 80
Main Kubernetes resources
4 - Use cases
Microservices
Kubernetes excels at deploying microservices architectures:
CI/CD and GitOps
Kubernetes integrates seamlessly into CI/CD pipelines:
- GitHub Actions → Building Docker images
- ArgoCD → GitOps deployment
- Flux → Continuous Delivery
Batch Processing and Jobs
For batch workloads:
apiVersion: batch/v1
kind: Job
metadata:
name: data-processing
spec:
completions: 10
parallelism: 3
template:
spec:
containers:
- name: processor
image: data-processor:v1
restartPolicy: Never
5 - Kubernetes vs alternatives
Comparison with other orchestrators
| Criterion | Kubernetes | Docker Swarm | Nomad |
|---|---|---|---|
| Complexity | High | Low | Medium |
| Features | Very comprehensive | Basic | Comprehensive |
| Community | Huge | Medium | Growing |
| Ecosystem | Very rich | Limited | Good |
| Learning curve | Steep | Gentle | Medium |
| Enterprise adoption | Standard | Limited | Growing |
When to choose Kubernetes?
Kubernetes is ideal for:
- Large-scale applications
- Multi-cloud environments
- Mature DevOps teams
- High availability needs
Alternatives to consider:
- Docker Swarm: For simple deployments
- Nomad: For heterogeneity (VMs + containers)
- ECS/Fargate: If 100% AWS
6 - The Kubernetes ecosystem
7 - Essential terminology
| Term | Definition |
|---|---|
| Cluster | A set of machines (nodes) managing containers |
| Node | A physical or virtual machine in the cluster |
| Pod | The smallest deployable unit (1+ containers) |
| Service | A network abstraction to access Pods |
| Deployment | Manages the lifecycle of Pods |
| Namespace | Logical isolation of resources |
| kubectl | CLI to interact with Kubernetes |
| Manifest | A YAML file describing a resource |
Summary
In this chapter, we discovered:
- The origin of Kubernetes at Google (Borg)
- The declarative model that defines the desired state
- Use cases: microservices, CI/CD, batch
- The rich ecosystem around Kubernetes
- The core terminology to master
Next step
In the next chapter, we will explore in detail the Kubernetes architecture and the role of each component.
→ Next chapter: Kubernetes Architecture