CNCF Certified Kubernetes Administrator (CKA) & Application Developer (CKAD) — Cluster Architecture, Networking, Storage & Troubleshooting
High-yield CKA and CKAD flashcards covering the 2-hour hands-on exam blueprint, kubeadm upgrades, etcd backup/restore, RBAC, Taints/Tolerations, NodeAffinity, TopologySpreadConstraints, PV/PVC/StorageClass, NetworkPolicies, Gateway API, Probes, SecurityContexts, Kustomize/Helm, and CLI troubleshooting.
- Category
- Multi-Cloud & DevOps Architecture — Microsoft Azure (AZ-104 & AZ-305), Google Cloud (PCA & PDE), Kubernetes (CKA / CKAD) & HashiCorp Terraform Associate
- Level
- advanced
- Languages
- en → en
- Cards
- 32
- Markdown
- CNCF Certified Kubernetes Administrator (CKA) & Application Developer (CKAD) — Cluster Architecture, Networking, Storage & Troubleshooting (.md)
Flashcards (32)
| # | Front (Term / Question) | Back (Definition / Answer) | Example | Multiple-Choice Options |
|---|---|---|---|---|
| 1 | How do you safely drain a Kubernetes node for kernel maintenance on the CKA exam, and what flags are typically required? | Run `kubectl drain <node> --ignore-daemonsets --delete-emptydir-data` to cordon the node and evict Pods while respecting `PodDisruptionBudgets`, then `kubectl uncordon <node>` afterward. | Unlike `kubectl cordon` (which only marks the node `SchedulingDisabled` for new Pods), `kubectl drain` both cordons the node and evicts existing Pods so ReplicaSets reschedule them onto healthy nodes. |
|
| 2 | How do `HorizontalPodAutoscaler` (HPA), `ResourceQuota`, and `LimitRange` work together in a multi-tenant Kubernetes namespace? | `ResourceQuota` caps aggregate namespace CPU/memory/objects; `LimitRange` injects default per-Pod requests/limits and min/max bounds; `HPA` scales replicas based on target utilization. | Once a `ResourceQuota` for `requests.cpu` or `limits.memory` is active in a namespace, every Pod created in that namespace MUST specify those resource values—or a `LimitRange` with defaults must exist. |
|
| 3 | What fast imperative `kubectl` commands and flags save critical time on the CKA and CKAD exams? | Use `--dry-run=client -o yaml > file.yaml` with `kubectl run` and `kubectl create`, plus `kubectl explain <resource>.spec --recursive` for built-in schema documentation. | Running `kubectl create rolebinding dev-view --clusterrole=view --serviceaccount=dev:app-sa -n dev --dry-run=client -o yaml` generates error-free RBAC YAML in 3 seconds, and `kubectl replace --force -f pod.yaml` rapidly recreates an immutable Pod. |
|
| 4 | Compare the four Kubernetes PersistentVolume Access Modes (`ReadWriteOnce`, `ReadOnlyMany`, `ReadWriteMany`, `ReadWriteOncePod`) and the three Reclaim Policies (`Retain`, `Delete`, `Recycle`). | `RWO` mounts read-write on one node, `ROX` read-only on many, `RWX` read-write on many, `RWOP` on one Pod; `Retain` keeps volumes while `Delete` removes them. | Cloud block storage (AWS EBS, Azure Disk, GCP Persistent Disk) typically supports `ReadWriteOnce` (`RWO`) and `ReadWriteOncePod` (`RWOP`), whereas shared NFS/Azure Files/Filestore CSI drivers support `ReadWriteMany` (`RWX`). |
|
| 5 | What is the exact sequence of steps to upgrade a Kubernetes cluster by one minor version (e.g., 1.30 to 1.31) using `kubeadm`? | Drain control plane, upgrade `kubeadm`, run `kubeadm upgrade apply`, upgrade `kubelet`/`kubectl`, uncordon, then drain and upgrade workers using `kubeadm upgrade node`. | On the control plane, after `apt-get install -y --allow-change-held-packages kubeadm=1.31.x-*` and `kubeadm upgrade apply v1.31.x`, always run `systemctl daemon-reload && systemctl restart kubelet` after upgrading `kubelet`. |
|
| 6 | How do you back up and restore an `etcd` cluster on the CKA exam using `etcdctl` and `etcdutl`? | Save with `ETCDCTL_API=3 etcdctl snapshot save <file>` passing `--endpoints`, `--cacert`, `--cert`, and `--key`; restore with `etcdutl snapshot restore <file> --data-dir=/var/lib/etcd-from-backup`. | After restoring the snapshot to a new directory `/var/lib/etcd-restore`, update the `hostPath.path` volume in `/etc/kubernetes/manifests/etcd.yaml` so the static etcd Pod mounts the restored data directory. |
|
| 7 | In Kubernetes `nodeAffinity`, what is the difference between `requiredDuringSchedulingIgnoredDuringExecution` and `preferredDuringSchedulingIgnoredDuringExecution`? | `requiredDuringScheduling...` is a hard scheduling filter (Pod stays Pending without match); `preferredDuringScheduling...` scores nodes by weight (1–100); `IgnoredDuringExecution` never evicts running pods. | Note that Kubernetes 1.31+ also supports `requiredDuringSchedulingRequiredDuringExecution` (or taint `NoExecute`) when pods must be evicted if a node loses its required label. |
|
| 8 | How do Init Containers (`spec.initContainers`) and native Sidecar Containers (`initContainers` with `restartPolicy: Always` in K8s 1.28+) differ in Pod startup behavior? | Standard Init Containers run sequentially to completion before app containers start; an Init Container with `restartPolicy: Always` stays running alongside main containers. | An Envoy service-mesh proxy or log-shipping agent defined in `initContainers` with `restartPolicy: Always` is guaranteed to be ready before the main application container starts and terminates after main Jobs finish. |
|
| 9 | Why was `docker` (dockershim) removed from Kubernetes, and which CLI tool replaces `docker ps` / `docker logs` on nodes running `containerd` or `CRI-O` when `kube-apiserver` is down? | Kubernetes uses the Container Runtime Interface (`containerd` or `CRI-O`), and `crictl` (`crictl ps`, `crictl logs`) is the CRI CLI for debugging node containers. | When a syntax error in `/etc/kubernetes/manifests/kube-apiserver.yaml` crashes the API server so `kubectl` cannot connect, an administrator runs `crictl ps -a` and `crictl logs <container-id>` (or checks `/var/log/pods/`) on the control plane node. |
|
| 10 | When a Kubernetes worker node shows status `NotReady` in `kubectl get nodes`, what is the systematic CLI troubleshooting sequence? | Run `kubectl describe node <name>`, SSH to the node to check `systemctl status kubelet` and `journalctl -u kubelet -xe`, and verify `containerd` (`crictl ps`). | On the CKA exam, `NotReady` worker nodes are frequently caused by a stopped `kubelet` service (`systemctl enable --now kubelet`), a wrong binary path in `10-kubeadm.conf`, expired certs, or a stopped `containerd` daemon. |
|
| 11 | Compare `DaemonSet` and `StatefulSet` in Kubernetes regarding Pod identity, scheduling, and storage. | `DaemonSet` runs one Pod per node (for CNI/CSI/logging agents); `StatefulSet` maintains sticky ordinal identities (`web-0`, `web-1`), ordered rollouts, and per-Pod `volumeClaimTemplates`. | Deleting `web-1` in a `StatefulSet` does not delete its dynamically provisioned PVC (`data-web-1`); when Kubernetes recreates `web-1`, it reattaches the exact same `data-web-1` volume. |
|
| 12 | How does the Kubernetes scheduler vs. the `kubelet` handle Pod `resources.requests` and `resources.limits` for CPU and Memory? | The scheduler uses `requests` to place Pods; `kubelet` enforces `limits` via cgroups by throttling CPU or `OOMKilling` (Exit Code 137) containers exceeding memory. | A Pod becomes `Guaranteed` QoS class only when every container sets both CPU and Memory `requests` and `limits` to identical values; `Burstable` has requests < limits; `BestEffort` has neither. |
|
| 13 | What is the Container Network Interface (CNI) in Kubernetes, where are CNI plugin binaries and configuration files located on Linux nodes, and what happens if no CNI plugin is installed? | CNI plugins (Calico, Cilium, Flannel) assign Pod IPs; configs live in `/etc/cni/net.d/` and binaries in `/opt/cni/bin/`; without CNI, nodes stay `NotReady`. | The Kubernetes networking model requires that every Pod can communicate with every other Pod on any node without NAT; installing Cilium or Calico creates the CNI config in `/etc/cni/net.d/` and transitions nodes to `Ready`. |
|
| 14 | In a Kubernetes `StorageClass`, why is `volumeBindingMode: WaitForFirstConsumer` strongly preferred over `Immediate` for zonal cloud block volumes? | `WaitForFirstConsumer` delays dynamic provisioning and binding of the PersistentVolume until a Pod using the PVC is scheduled onto a specific node and zone. | With `Immediate`, a zonal EBS/Persistent Disk might be provisioned in `zone-a` while the Pod's `nodeAffinity` or CPU capacity forces the Pod onto `zone-b`, leaving the Pod permanently stuck in `ContainerCreating`. |
|
| 15 | In Kubernetes RBAC, what are the four matrix combinations of `Role`/`ClusterRole` and `RoleBinding`/`ClusterRoleBinding`, and what happens when a `RoleBinding` references a `ClusterRole`? | A `RoleBinding` referencing a `ClusterRole` reuses the cluster-wide role definition but restricts the granted permissions strictly to the `RoleBinding`'s single namespace. | Binding the built-in `view` or `admin` `ClusterRole` via a namespaced `RoleBinding` in `namespace: finance` grants read/admin access only inside `finance` without duplicating Role definitions across 50 namespaces. |
|
| 16 | What is the exam format, duration, passing score, and domain weight distribution of the CNCF Certified Kubernetes Administrator (CKA) exam? | A 2-hour performance-based hands-on CLI exam requiring a 66% passing score across five domains led by Troubleshooting (30%) and Cluster Architecture (25%). | Candidates solve 15–20 live tasks in a remote Linux terminal across Troubleshooting (30%), Cluster Architecture/Installation/Configuration (25%), Services & Networking (20%), Workloads & Scheduling (15%), and Storage (10%). |
|
| 17 | Compare the four Kubernetes Service types: `ClusterIP`, `NodePort`, `LoadBalancer`, and `ExternalName` (plus Headless Services `clusterIP: None`). | `ClusterIP` exposes an internal VIP; `NodePort` opens port 30000–32767 on nodes; `LoadBalancer` provisions a cloud LB; `Headless` (`clusterIP: None`) returns direct Pod DNS records. | StatefulSets require a Headless Service (`clusterIP: None`) so each Pod gets a deterministic, stable DNS record `<pod-name>.<service-name>.<namespace>.svc.cluster.local`. |
|
| 18 | What are the three Pod Security Standards (PSS) profiles enforced by the built-in Pod Security Admission (PSA) controller via Namespace labels? | `privileged` (unrestricted), `baseline` (blocks hostNetwork/privileged pods), and `restricted` (hardened: requires `runAsNonRoot: true`, seccomp `RuntimeDefault`, and dropping `ALL` capabilities). | Labeling a namespace with `pod-security.kubernetes.io/enforce=restricted` and `pod-security.kubernetes.io/warn=restricted` immediately rejects any Pod admission request that omits `runAsNonRoot: true`. |
|
| 19 | How do Kubernetes `NetworkPolicy` rules work by default, and what is the difference between stacked `to`/`from` array items vs. combined properties inside a single list item? | Pods allow all traffic until selected by a `NetworkPolicy`; separate `-` list items use OR logic, while properties inside one `-` item use AND logic. | Writing `- namespaceSelector: ...` followed on the next line (without a second `-`) by `podSelector: ...` allows traffic ONLY from matching Pods inside matching Namespaces (AND); adding a second `-` uses logical OR. |
|
| 20 | Compare Kubernetes `Deployment` strategies (`RollingUpdate` vs. `Recreate`) and explain how `maxSurge` and `maxUnavailable` control rollout velocity. | `Recreate` kills all old Pods before creating new ones; `RollingUpdate` replaces Pods gradually using `maxSurge` (extra Pods allowed) and `maxUnavailable` (max unavailable Pods). | For a 4-replica Deployment with `maxSurge: 25%` (1 Pod) and `maxUnavailable: 25%` (1 Pod), Kubernetes immediately scales the new ReplicaSet to 2 Pods while terminating 1 old Pod, maintaining 3 available Pods. |
|
| 21 | In a Kubernetes `Job` and `CronJob`, what do `completions`, `parallelism`, `backoffLimit`, `activeDeadlineSeconds`, and `concurrencyPolicy` control? | `completions` sets required successes; `parallelism` sets concurrent Pods; `backoffLimit` caps retries; `activeDeadlineSeconds` caps runtime; `concurrencyPolicy` (`Allow`/`Forbid`/`Replace`) governs overlapping CronJobs. | A `CronJob` running every 5 minutes (`*/5 * * * *`) with `concurrencyPolicy: Forbid` skips launching a new Job run if the previous Job is still actively executing. |
|
| 22 | When applying a Default Deny Egress `NetworkPolicy` to a namespace, what critical rule must you remember to add so Pods can still resolve service names? | Explicitly allow Egress on UDP and TCP port 53 to `kube-system` (CoreDNS pods), or DNS resolution inside isolated Pods will fail completely. | Allow egress to `namespaceSelector: {matchLabels: {kubernetes.io/metadata.name: kube-system}}` and `podSelector: {matchLabels: {k8s-app: kube-dns}}` on `ports: [{protocol: UDP, port: 53}, {protocol: TCP, port: 53}]`. |
|
| 23 | Compare `Helm` and `Kustomize` for managing multi-environment Kubernetes manifests. | Helm is a package manager using Go templates (`Chart.yaml`, `values.yaml`) and release tracking; Kustomize (`kubectl -k`) uses template-free `base` and `overlays` patches. | To deploy a Kustomize staging overlay without modifying base YAML files, run `kubectl apply -k overlays/staging/`; to upgrade a Helm release with custom values, run `helm upgrade --install my-app bitnami/nginx -f prod-values.yaml`. |
|
| 24 | If a Pod is running and Ready (`1/1`), and a Service exists, but `curl <service-name>` fails or times out, what are the four most common causes to verify? | Verify that: 1) Service `selector` matches Pod labels (`kubectl get ep`), 2) `targetPort` matches container port, 3) `NetworkPolicy` allows traffic, and 4) CoreDNS is running. | Running `kubectl get endpoints <svc>` (or `kubectl get endpointslices -l kubernetes.io/service-name=<svc>`) immediately shows whether the Service matched any Pod IPs: if `<none>` is listed, fix the Service's `spec.selector`. |
|
| 25 | How do `topologySpreadConstraints` distribute Pods evenly across failure domains (zones or nodes), and what do `maxSkew` and `whenUnsatisfiable` control? | `maxSkew` defines the maximum allowed Pod count difference between any two topology domains (`topologyKey`); `whenUnsatisfiable` sets `DoNotSchedule` (hard) or `ScheduleAnyway` (soft). | Setting `topologyKey: topology.kubernetes.io/zone`, `maxSkew: 1`, and `whenUnsatisfiable: DoNotSchedule` guarantees that a 6-replica Deployment places exactly 2 Pods in each of 3 Availability Zones. |
|
| 26 | In a Pod or Container `securityContext`, what happens if both the Pod-level `spec.securityContext` and Container-level `spec.containers[*].securityContext` define `runAsUser`? | Container-level `securityContext` settings override Pod-level `spec.securityContext` settings for that container; `fsGroup` and `supplementalGroups` exist only at the Pod level. | Linux capabilities (`securityContext.capabilities.add: ["NET_ADMIN"]` or `drop: ["ALL"]`), `allowPrivilegeEscalation: false`, and `readOnlyRootFilesystem: true` are configured at the Container level (`spec.containers[*].securityContext`). |
|
| 27 | Compare Kubernetes `startupProbe`, `livenessProbe`, and `readinessProbe` regarding failure actions and lifecycle execution order. | `startupProbe` disables other probes until startup succeeds; `livenessProbe` restarts deadlocked containers; `readinessProbe` removes unhealthy Pods from Service `EndpointSlices` without restarting them. | For a legacy Java application taking 90 seconds to boot, configuring a `startupProbe` (`failureThreshold: 30, periodSeconds: 5`) prevents the `livenessProbe` from killing the container before initialization finishes. |
|
| 28 | Compare the three Kubernetes Taint effects (`NoSchedule`, `PreferNoSchedule`, `NoExecute`) and explain how a Pod's `tolerationSeconds` interacts with `NoExecute`. | `NoSchedule` blocks new un-tolerated pods; `PreferNoSchedule` is soft; `NoExecute` blocks new pods AND immediately evicts running pods lacking a matching toleration. | If a running Pod has a `NoExecute` toleration with `tolerationSeconds: 300`, when the node is tainted `kubectl taint nodes node1 hardware=gpu:NoExecute`, the Pod continues running for 300 seconds before eviction. |
|
| 29 | Where do Static Pods live on a Kubernetes node, which component manages them directly, and how can you identify a Static Pod in `kubectl get pods`? | Static Pod manifests reside in `/etc/kubernetes/manifests` (via `staticPodPath` in `/var/lib/kubelet/config.yaml`), are managed by `kubelet`, and append `-<node-name>` to the Pod name. | The control plane components (`kube-apiserver`, `kube-controller-manager`, `kube-scheduler`, `etcd`) run as Static Pods; deleting them via `kubectl delete pod` fails because `kubelet` immediately recreates them until the file in `/etc/kubernetes/manifests` is moved. |
|
| 30 | In the Kubernetes Gateway API (the modern successor to `Ingress`), how do `GatewayClass`, `Gateway`, and `HTTPRoute` separate role responsibilities? | `GatewayClass` defines the controller template; `Gateway` defines network listeners and TLS ports; `HTTPRoute` defines application HTTP routing, headers, and weighted traffic splitting. | An `HTTPRoute` attaches to a parent `Gateway` via `parentRefs` and splits canary traffic (`weight: 90` to `svc-v1` and `weight: 10` to `svc-v2`) natively without vendor-specific Ingress annotations. |
|
| 31 | How do you enable Encryption at Rest for Kubernetes `Secret` resources stored in `etcd`? | Pass `--encryption-provider-config` to `kube-apiserver` with an `EncryptionConfiguration` manifest listing `aescbc` (or `kms`) before `identity: {}`, then re-encrypt existing secrets. | The provider order in `EncryptionConfiguration` matters: the FIRST provider (`aescbc`) encrypts all new writes to `etcd`; running `kubectl get secrets -A -o json | kubectl replace -f -` re-encrypts all pre-existing plaintext secrets. |
|
| 32 | When a `ConfigMap` or `Secret` is updated in Kubernetes, does a running Pod consuming it automatically receive the updated values? | Mounted `ConfigMap`/`Secret` volumes (without `subPath`) update automatically within ~60–90 seconds, whereas environment variables (`env`/`envFrom`) and `subPath` mounts require a Pod restart. | If an application reads `DB_PASSWORD` via `env.valueFrom.secretKeyRef` or mounts a single config file using `volumeMounts.subPath`, engineers must trigger `kubectl rollout restart deployment/<name>` after updating the Secret or ConfigMap. |
|