1. The cloud native philosophy #
More than a technology, a methodological approach (the Twelve-Factor App).
Immutability #
A cloud native application is designed to be resilient. You never repair a broken server; you replace it automatically with a new one. It is the shift from the 'pets' model (you take care of each server) to the 'cattle' model (the server is a replaceable resource).
2. Microservices and containers #
The application is split into small independent services communicating through APIs. Containers (Docker) ensure the application behaves the same way on the developer's computer and in production.
3. Orchestration and CI/CD #
Kubernetes becomes the conductor that manages the deployment of these thousands of containers. Combined with an automated CI/CD pipeline, cloud native makes it possible to deploy updates dozens of times a day without service interruption.
4. CNCF definition and comparison #
What really sets a cloud native application apart.
The CNCF definition #
The Cloud Native Computing Foundation defines cloud native technologies as those that empower organizations to build and run scalable applications in modern, dynamic environments (public, private, hybrid clouds). It lists containers, service meshes, microservices, immutable infrastructure and declarative APIs. The goal: loosely coupled systems that are resilient, manageable and observable, which can be changed frequently and safely thanks to automation.
Traditional or cloud native #
| Aspect | Traditional application | Cloud native application |
|---|---|---|
| Architecture | monolith | independent services, APIs |
| Deployment | manual, a few times a year | automated, several times a day |
| Servers | “pets” repaired by hand | “cattle” replaced automatically |
| State | sessions and files on the server | externalized (database, cache, object storage) |
| Scaling | vertical | horizontal and elastic |
| Monitoring | servers and uptime | observability: metrics, logs, traces |
Design principles are detailed in the twelve-factor app and how to apply them on Kubernetes in Kubernetes best practices.
Common mistake: Believing that containerizing a monolith is enough to be cloud native. Without externalized state, health probes, configuration through variables and automated deployment, you only get a monolith in a container.
Hands-on: a cloud native application #
Twelve factors, containers and continuous deployment.
The pillars of cloud native #
# De l'application au cluster, étapes types
docker build -t registre.exemple.fr/shop/api:1.0 . && docker push registre.exemple.fr/shop/api:1.0
kubectl apply -f k8s/ # déploiement déclaratif
kubectl rollout status deployment/api
# GitOps : le cluster se synchronise depuis Git
argocd app create shop --repo https://git.exemple.fr/shop/deploy.git --path k8s --dest-server https://kubernetes.default.svc --dest-namespace prod
argocd app sync shopGood practice: A cloud native application is stateless: sessions, files and configuration live in external services (database, cache, object storage, ConfigMap), so any instance can be deleted and recreated.
5. Commands to know and lab #
Everyday cloud native operations.
Commands to know #
| Action | Command |
|---|---|
| Build and push an image | docker build -t registre.exemple.fr/shop/api:1.1 . && docker push registre.exemple.fr/shop/api:1.1 |
| Update without downtime | kubectl set image deployment/api api=registre.exemple.fr/shop/api:1.1 |
| Follow the rollout | kubectl rollout status deployment/api |
| Roll back | kubectl rollout undo deployment/api |
| Replace a pod (cattle) | kubectl delete pod -l app=api --wait=false |
| Sync through GitOps | argocd app sync shop |
Lab: check cloud native properties #
- Deploy an API with 3 replicas, readiness and liveness probes, and its configuration in a ConfigMap.
- Delete a pod while a script calls the API in a loop: no error should appear.
- Publish version 1.1 and follow the rolling update, then run a
rollout undo. - Change a ConfigMap value and restart the deployment (
kubectl rollout restart) without rebuilding the image.
Expected result: the application survives losing an instance, updates and rolls back without downtime.
