Skip to content

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.

Know

  • The three signals: metrics (Prometheus), logs, and traces (OpenTelemetry). Kubernetes exposes component metrics and events; cluster-level logging is up to you.

Read

Demo: Metrics, logs, and events from the CLI

  1. Create a namespace for this demo and make it the default for your context.

    Terminal window
    kubectl create namespace kcna-obs
    kubectl config set-context --current --namespace=kcna-obs
  2. Resource metrics come from metrics-server, installed in the lab setup.

    Terminal window
    kubectl top nodes
    kubectl top pods -n kube-system --sort-by=memory | head
  3. 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=120s
    kubectl logs talker --tail=3 --timestamps
  4. Events are the cluster’s own log of what it did.

    Terminal window
    kubectl events --types=Normal
    kubectl 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:

Terminal window
kubectl config set-context --current --namespace=default
kubectl delete namespace kcna-obs

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

  1. Create a namespace for this demo and make it the default for your context.

    Terminal window
    kubectl create namespace kcna-eco
    kubectl config set-context --current --namespace=kcna-eco
  2. Kubernetes is an extensible API. See what is built in, and what was added.

    Terminal window
    kubectl api-resources | wc -l
    kubectl api-resources --api-group=apps
    kubectl get crd
  3. 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=8080
    kubectl rollout status deployment/web
    kubectl set image deployment/web agnhost=registry.k8s.io/e2e-test-images/agnhost:2.55
    kubectl rollout status deployment/web
    kubectl 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:

Terminal window
kubectl config set-context --current --namespace=default
kubectl delete namespace kcna-eco

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.