KCNA: Cloud Native Architecture
12% of the KCNA exam, 3 competencies. Back to the KCNA overview.
Each competency lists what to know and the official documentation to read, then a demo you can run. Demos run on the demo lab, a throwaway kind cluster on your own machine; set it up once before you start.
Observability
Section titled “Observability”Know
- The three signals: metrics (Prometheus), logs, and traces (OpenTelemetry). Kubernetes exposes component metrics and events; cluster-level logging is up to you.
Read
- Logging architecture
- Metrics for Kubernetes system components
- OpenTelemetry documentation
- Prometheus documentation
Demo: Metrics, logs, and events from the CLI
-
Create a namespace for this demo and make it the default for your context.
Terminal window kubectl create namespace kcna-obskubectl config set-context --current --namespace=kcna-obs -
Resource metrics come from metrics-server, installed in the lab setup.
Terminal window kubectl top nodeskubectl top pods -n kube-system --sort-by=memory | head -
Logs come from the container’s stdout and stderr.
Terminal window kubectl run talker --image=registry.k8s.io/e2e-test-images/busybox:1.37.0-2 -- sh -c 'i=0; while true; do i=$((i+1)); echo "line $i"; sleep 2; done'kubectl wait --for=condition=Ready pod/talker --timeout=120skubectl logs talker --tail=3 --timestamps -
Events are the cluster’s own log of what it did.
Terminal window kubectl events --types=Normalkubectl get --raw /metrics | grep ^apiserver_request_total | head -3
What you should see: Three different signals: numbers from top, text from logs, and the event stream. The last command shows the raw Prometheus metrics the API server exposes, which is what a Prometheus server would scrape.
Clean up:
kubectl config set-context --current --namespace=defaultkubectl delete namespace kcna-obsCloud Native Ecosystem and Principles
Section titled “Cloud Native Ecosystem and Principles”Know
- Cloud native means containers, microservices, declarative APIs, and immutable infrastructure, run with automation.
- Know the major CNCF projects by job: Prometheus (metrics), Envoy (proxy), Helm (packaging), Argo and Flux (GitOps), containerd and CRI-O (runtimes), CoreDNS (DNS), etcd (state).
- Serverless and autoscaling (HPA, cluster autoscaler) are about matching capacity to demand.
Read
Demo: Extend the API and roll out immutably
-
Create a namespace for this demo and make it the default for your context.
Terminal window kubectl create namespace kcna-ecokubectl config set-context --current --namespace=kcna-eco -
Kubernetes is an extensible API. See what is built in, and what was added.
Terminal window kubectl api-resources | wc -lkubectl api-resources --api-group=appskubectl get crd -
Immutable rollout: change the image and the Deployment replaces pods instead of patching them.
Terminal window kubectl create deployment web --image=registry.k8s.io/e2e-test-images/agnhost:2.66.1 --replicas=3 -- /agnhost netexec --http-port=8080kubectl rollout status deployment/webkubectl set image deployment/web agnhost=registry.k8s.io/e2e-test-images/agnhost:2.55kubectl rollout status deployment/webkubectl get replicasets -l app=web
What you should see: The cluster lists dozens of resource types, and kubectl get crd shows any extensions installed (the lab’s cloud-provider-kind adds the Gateway API ones). After set image you have two ReplicaSets: the old one scaled to zero and kept for rollback, and the new one.
Clean up:
kubectl config set-context --current --namespace=defaultkubectl delete namespace kcna-ecoCloud Native Community and Collaboration
Section titled “Cloud Native Community and Collaboration”Know
- Kubernetes is governed in the open: Special Interest Groups (SIGs) own areas, enhancements go through KEPs, and releases come roughly three times a year.
- CNCF projects move through sandbox, incubating, and graduated maturity levels.
Read
Domain and competency names are from the CNCF KCNA curriculum (current curriculum (unversioned)), cncf/curriculum, licensed CC BY 4.0. Summaries, demos, and exercises are original to this site.