Skip to content

KCNA: Cloud Native Application Delivery

16% of the KCNA exam, 2 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

  • CI builds and tests images; CD deploys them. GitOps keeps the desired state in Git and lets a controller (Argo CD, Flux) apply it.
  • Deployments roll out new versions gradually and can roll back. Helm packages applications; Kustomize patches YAML without templates.

Read

Demo: Declarative delivery from a directory

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

    Terminal window
    kubectl create namespace kcna-delivery
    kubectl config set-context --current --namespace=kcna-delivery
  2. Keep the app as files, the way a GitOps tool would read them from Git.

    Terminal window
    mkdir -p app && cat > app/deploy.yaml <<'EOF'
    apiVersion: apps/v1
    kind: Deployment
    metadata:
    name: web
    spec:
    replicas: 2
    selector:
    matchLabels:
    app: web
    template:
    metadata:
    labels:
    app: web
    spec:
    containers:
    - name: app
    image: registry.k8s.io/e2e-test-images/agnhost:2.66.1
    args: ["netexec", "--http-port=8080"]
    EOF
    kubectl apply -f app/
  3. Change the file, preview the change, then apply it.

    Terminal window
    sed -i 's/replicas: 2/replicas: 3/' app/deploy.yaml
    kubectl diff -f app/
    kubectl apply -f app/
    kubectl get deployment web

What you should see: kubectl diff shows only the replicas line changing before anything happens. Argo CD and Flux automate exactly this loop: read files from Git, diff, apply.

Clean up:

Terminal window
rm -rf app
kubectl config set-context --current --namespace=default
kubectl delete namespace kcna-delivery

Practise

  • Roll a Deployment to a new image, then roll it back with kubectl rollout undo.

On this site

Know

  • Debugging an application on Kubernetes means separating “the app is broken” from “the platform is broken”: check the pod, then the Service, then the network path.
  • kubectl debug attaches an ephemeral container to a running pod, useful when the image has no shell.

Read

Demo: Get inside a pod that has no shell

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

    Terminal window
    kubectl create namespace kcna-debug
    kubectl config set-context --current --namespace=kcna-debug
  2. Run a distroless-style container: the pause image has no shell at all.

    Terminal window
    kubectl run quiet --image=registry.k8s.io/pause:3.10.2
    kubectl wait --for=condition=Ready pod/quiet --timeout=120s
    kubectl exec quiet -- sh || true
  3. Attach an ephemeral debug container that shares its process namespace.

    Terminal window
    kubectl debug -it quiet --image=registry.k8s.io/e2e-test-images/busybox:1.37.0-2 --target=quiet -- sh -c 'ps; ls /proc/1/root/'
  4. Or copy the pod and change its command, leaving the original alone.

    Terminal window
    kubectl debug quiet --copy-to=quiet-copy --image=registry.k8s.io/e2e-test-images/busybox:1.37.0-2 --share-processes -- sleep 3600
    kubectl get pods

What you should see: exec fails with executable file not found. The ephemeral container sees the /pause process as PID 1 and can browse its filesystem. The copy is a separate pod you can break freely.

Clean up:

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

On this site


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.