RousselTMLEARNING

Cloud computing

Cloud native: definition and principles of a cloud native application

What is cloud native? The CNCF definition, the principles of a cloud native application (microservices, containers, APIs, orchestration, observability) and how it differs from a traditional application.

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.

Cloud native delivery chain

Traditional or cloud native #

AspectTraditional applicationCloud native application
Architecturemonolithindependent services, APIs
Deploymentmanual, a few times a yearautomated, several times a day
Servers“pets” repaired by hand“cattle” replaced automatically
Statesessions and files on the serverexternalized (database, cache, object storage)
Scalingverticalhorizontal and elastic
Monitoringservers and uptimeobservability: 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 #

Pillars of a cloud native application
Each pillar shortens the time between an idea and its release to production.
# 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 shop
Good 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 #

ActionCommand
Build and push an imagedocker build -t registre.exemple.fr/shop/api:1.1 . && docker push registre.exemple.fr/shop/api:1.1
Update without downtimekubectl set image deployment/api api=registre.exemple.fr/shop/api:1.1
Follow the rolloutkubectl rollout status deployment/api
Roll backkubectl rollout undo deployment/api
Replace a pod (cattle)kubectl delete pod -l app=api --wait=false
Sync through GitOpsargocd app sync shop

Lab: check cloud native properties #

  1. Deploy an API with 3 replicas, readiness and liveness probes, and its configuration in a ConfigMap.
  2. Delete a pod while a script calls the API in a loop: no error should appear.
  3. Publish version 1.1 and follow the rolling update, then run a rollout undo.
  4. 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.

Related articles

Cloud deployment models: public, private, hybrid, community and multi-cloud

Understand cloud computing deployment models according to NIST: public, private, community and hybrid cloud, …

Cloud best practices: security, resilience, costs and operations

Cloud computing best practices: pillars of a well-architected design, IAM and least privilege, multi-AZ resil…

Edge computing: definition, solutions and modular data centers

Edge computing explained: processing data as close as possible to its source, use cases (IoT, industry, retai…

Keep learning

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!