Cloud native principles
What "cloud native" means in the CNCF definition, microservices vs monoliths, immutability and declarative APIs, and serverless with Knative.
Exam tasks: 4.2 (cloud native ecosystem and principles: architecture characteristics, serverless)
The decision: which design property (loose coupling, immutability, declarative state, elastic scaling) does the scenario need, and which Kubernetes mechanism or CNCF project delivers it?
The CNCF definition in one line
The CNCF's official definition says cloud native technology helps you build and run scalable applications in dynamic environments: public, private and hybrid clouds. Its usual building blocks are containers, microservices, service meshes, declarative APIs and immutable infrastructure. The aim is loosely coupled systems you can operate, observe and recover easily, paired with automation so engineers can ship frequent, predictable changes with little toil.
Exam signal
If an option says cloud native "means running in a public cloud", it's wrong. Cloud native is about how applications are built and operated. It applies equally on premises.
Characteristics worth recognising
| Principle | What it means in practice | Kubernetes expression |
|---|---|---|
| Declarative over imperative | You state the end result; a controller works out the steps | YAML manifests applied to the API, reconciled by controllers |
| Immutable infrastructure | Never patch a running instance; build a new image and replace it | New image tag, rolling update replaces Pods |
| Disposable, stateless processes | Any instance can die and be replaced without losing data | Deployments with state kept in databases or volumes |
| Self-healing | The system notices drift and corrects it | ReplicaSets recreate Pods, probes restart containers |
| Elastic | Capacity follows demand, both ways | HPA, VPA, Cluster Autoscaler, KEDA |
| Resilient by design | Expect failure: retries, timeouts, circuit breakers, multiple replicas across zones | Topology spread, PodDisruptionBudgets, service mesh policies |
| Observable | You can understand the system from its telemetry | Prometheus, OpenTelemetry |
- The phrase cattle, not pets sums up disposability: servers and Pods are numbered and replaceable, not named and nursed back to health.
- The Twelve-Factor App guidelines predate Kubernetes but map well onto it: config in the environment (ConfigMaps, Secrets), logs as event streams (stdout), stateless processes, and dev/prod parity.
Monoliths and microservices
| Monolith | Microservices | |
|---|---|---|
| Deploy unit | One artifact for the whole app | One per service, released independently |
| Scaling | Scale everything together | Scale only the hot service |
| Failure blast radius | One bug can take down the whole app | Contained to a service if designed well |
| Data | One shared database | Each service owns its data |
| Complexity lives in | The codebase | The network: discovery, latency, partial failure, tracing |
- Microservices trade code complexity for operational complexity. That's why they come with service discovery, service meshes and distributed tracing.
- A small team with a simple app may be better off with a well-structured monolith. The exam rewards knowing the trade-off, not "microservices always".
Microservices sharing one database
Splitting an app into services that all read and write the same tables keeps the coupling and adds network hops. Loose coupling means each service owns its data and talks to others through APIs or events.
Autoscaling
Autoscaling has its own page: Autoscaling covers HPA, VPA, the Cluster Autoscaler, Karpenter, KEDA and the Cluster Proportional Autoscaler.
Building blocks for microservices
- Dapr (graduated) is a sidecar runtime that gives microservices common APIs: service invocation, state
stores, pub/sub, secrets. The app calls
localhost, and Dapr talks to the real backend, so the backend can change without code changes. - A service mesh solves the networking side (mTLS, retries, traffic splitting). Dapr solves the application building-block side. They can run together.
- Helm and ConfigMaps supply packaging and configuration. Both appear in the delivery and core objects pages.
Serverless and Knative
- Serverless means you supply code or a container and the platform handles servers, scaling (including to zero) and often per-request billing. Functions as a Service (FaaS) is one form.
- Knative (graduated) brings serverless to Kubernetes. Knative Serving runs request-driven containers with revisions, traffic splitting and scale to zero. Knative Eventing routes events between producers and consumers.
- CloudEvents (graduated) is the CNCF specification for describing event data in a common way, so events can move between platforms. Knative Eventing uses it.
- Trade-offs: cold starts after scaling to zero, limits on run time, and less control over the environment.
Scenarios
The CNCF definition focuses on loosely coupled, resilient, manageable and observable systems in public, private or hybrid clouds. It doesn't require a public cloud or serverless. Patching in place goes against immutable infrastructure.
Immutable infrastructure means you build a new image and replace the running instances, so every copy is identical and reproducible. Editing live containers creates drift that disappears on the next restart. The other principles are real but aren't what the change violates.
Related
Further reading
Cloud computing models
IaaS, PaaS, CaaS, FaaS and SaaS, public, private, hybrid and multicloud, virtualization vs containers vs orchestration, and how cloud native differs from simply running in a cloud.
Autoscaling
HPA, VPA, Cluster Autoscaler, Karpenter, KEDA and the Cluster Proportional Autoscaler. Which one scales Pods, which one resizes them, and which one adds nodes.