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.
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.
