CertifyDeck
All cheat sheets
CKA · CHEAT SHEET

Certified Kubernetes Administrator (CKA)

Key concepts grouped by official exam weight.

Download as PDF (free, no sign-up)

1. Cluster Architecture, Installation and Configuration

25–25%

Manage role based access control (RBAC)

  • A Role grants additive permissions inside one namespace and a ClusterRole defines them cluster-wide; a RoleBinding that references a ClusterRole grants it only in its own namespace. The core group is written "", subresources such as pods/log use a slash, roleRef is immutable, and kubectl auth can-i --as checks the permissions of users and ServiceAccounts.

Prepare underlying infrastructure for installing a Kubernetes cluster

  • Every node needs a compatible Linux host, a unique hostname, MAC address and product_uuid, the required ports open and a CRI-conformant runtime such as containerd or CRI-O using the same cgroup driver (systemd) as the kubelet. Enable net.ipv4.ip_forward, disable swap persistently or tolerate it with failSwapOn: false, and install kubeadm, kubelet and kubectl from pkgs.k8s.io, holding their versions.

Create and manage Kubernetes clusters using kubeadm

  • kubeadm init builds the control plane from static Pod manifests in /etc/kubernetes/manifests and certificates in /etc/kubernetes/pki; then you copy admin.conf to $HOME/.kube/config and install a CNI Pod network add-on, without which CoreDNS stays Pending. Nodes join with kubeadm join, a token and --discovery-token-ca-cert-hash; kubeadm token create --print-join-command prints a fresh command and kubeadm reset reverts a node.

Manage the lifecycle of Kubernetes clusters

  • A kubeadm cluster is upgraded one minor version at a time: first kubeadm and kubeadm upgrade apply on the first control plane node, kubeadm upgrade node on the others and, on each node, drain, kubelet upgrade, restart and uncordon. etcd is backed up with etcdctl snapshot save and restored with etcdutl snapshot restore; certificates are checked with kubeadm certs check-expiration and renewed with kubeadm certs renew.

Implement and configure a highly-available control plane

  • A highly available kubeadm control plane uses at least three nodes behind a load balancer set in --control-plane-endpoint, with stacked etcd (simpler) or external etcd (more hosts). kubeadm init --upload-certs and kubeadm join --control-plane --certificate-key share the certificates; etcd needs quorum, so an odd number of members is preferred, and kube-scheduler and kube-controller-manager elect a leader through Leases.

Use Helm and Kustomize to install cluster components

  • Use Helm and Kustomize to install cluster components

Understand extension interfaces (CNI, CSI, CRI, etc.)

  • The kubelet talks to the container runtime (containerd, CRI-O) over gRPC using the v1 CRI API, and crictl inspects Pods, containers and images on the node. The runtime, not the kubelet, loads the CNI plugins (config in /etc/cni/net.d, binaries in /opt/cni/bin); without a Pod network CoreDNS stays Pending. CSI drivers and device plugins add storage and hardware without changing Kubernetes code.

Understand CRDs, install and configure operators

  • A CustomResourceDefinition (apiextensions.k8s.io/v1) is named <plural>.<group>, sets scope Namespaced or Cluster and declares versions with served and exactly one storage, each with a structural openAPIV3Schema that prunes unknown fields. An operator pairs custom resources with a controller, usually a Deployment, whose service account needs RBAC permissions on those resources.

2. Workloads and Scheduling

15–15%

Understand application deployments and how to perform rolling update and rollbacks

  • A Deployment starts a rollout, and creates a new revision, only when its Pod template changes; scaling does not. RollingUpdate bounds the process with maxSurge and maxUnavailable, while Recreate removes all Pods before creating new ones. kubectl rollout status, history, undo --to-revision, pause, resume and restart manage changes, and revisionHistoryLimit sets how many old ReplicaSets remain for rollbacks.

Use ConfigMaps and Secrets to configure applications

  • ConfigMaps and Secrets are created with kubectl create configmap or secret (generic, tls, docker-registry) and consumed as variables (env.valueFrom, envFrom) or as volumes in the same namespace. Mounted volumes update on their own; variables and subPath mounts do not. base64 is not encryption: encryption at rest needs an EncryptionConfiguration on kube-apiserver.

Configure workload autoscaling

  • An autoscaling/v2 HorizontalPodAutoscaler adjusts the replicas of a Deployment or StatefulSet from metrics such as CPU utilization, which is computed against requests and needs metrics-server. kubectl autoscale creates it; behavior controls the stabilization window and policies. The VerticalPodAutoscaler is a separate add-on that adjusts requests, and in-place resize uses the resize subresource.

Understand the primitives used to create robust, self-healing, application deployments

  • Controllers (ReplicaSet, Deployment, StatefulSet, DaemonSet, Job, CronJob) recreate Pods to keep the desired state. Liveness probes restart stuck containers, readiness probes take the Pod out of Services and startup probes protect slow starts. Init containers run in order, sidecars are initContainers with restartPolicy: Always, and a PodDisruptionBudget limits voluntary evictions.

Configure Pod admission and scheduling (limits, node affinity, etc.)

  • The scheduler places a Pod only where the sum of requests fits the allocatable capacity; nodeSelector and node affinity (terms ORed, expressions ANDed) choose nodes, while taints with tolerations repel them. LimitRange injects defaults and ResourceQuota caps namespace totals; Pod Security Admission enforce applies to Pods, not to Deployments.

3. Services and Networking

20–20%

Understand connectivity between Pods

  • Every Pod gets its own unique cluster-wide IP and the containers of a Pod share its network namespace, so they talk over localhost and cannot use the same port. Pods reach each other across nodes without NAT through the CNI plugin; kube-proxy (iptables or nftables) only implements Service virtual IPs, and Pod and Service ranges must not overlap.

Define and enforce Network Policies

  • NetworkPolicies (networking.k8s.io/v1) only take effect with a network plugin that implements them and are additive allow rules: a Pod becomes isolated in a direction once a policy selects it with that policyType. podSelector: {} creates a default deny; namespaceSelector and podSelector in the same element are ANDed, and after denying egress you must allow DNS on UDP and TCP 53.

Use ClusterIP, NodePort, LoadBalancer service types and endpoints

  • ClusterIP is the default type and is reachable only inside the cluster; NodePort opens the same port (from --service-node-port-range) on every node, and LoadBalancer relies on an external integration to provision the load balancer. EndpointSlices, linked by the kubernetes.io/service-name label, track ready Pods; externalTrafficPolicy: Local preserves the client IP.

Use the Gateway API to manage Ingress traffic

  • Gateway API is installed as CRDs plus a controller: GatewayClass names the controller (controllerName), Gateway defines listeners and allowedRoutes, and HTTPRoute attaches through parentRefs and routes by path, headers or weights with filters such as RequestRedirect or URLRewrite. Cross-namespace references need a ReferenceGrant in the target namespace; always check status.conditions.

Know how to use Ingress controllers and Ingress resources

  • A networking.k8s.io/v1 Ingress does nothing without a running Ingress controller; spec.ingressClassName picks the IngressClass and the is-default-class annotation marks the default one. Every path needs a pathType (Exact, Prefix or ImplementationSpecific), Prefix matches element by element and the longest path wins; TLS uses a kubernetes.io/tls Secret whose host matches the rule.

Understand and use CoreDNS

  • CoreDNS is configured through the Corefile in the coredns ConfigMap in kube-system and is exposed by the kube-dns Service; the kubernetes, forward, cache, errors, health, ready and log plugins define its behaviour, and stub domains are added as server blocks using forward. Services resolve as name.namespace.svc.cluster.local, and dnsPolicy (ClusterFirst, ClusterFirstWithHostNet, Default, None) and dnsConfig control each Pod's /etc/resolv.conf.

4. Storage

10–10%

Implement storage classes and dynamic volume provisioning

  • A StorageClass defines provisioner, parameters, reclaimPolicy (Delete when omitted), volumeBindingMode (Immediate or WaitForFirstConsumer), allowVolumeExpansion and mountOptions. The storageclass.kubernetes.io/is-default-class annotation marks the default class that the DefaultStorageClass admission controller assigns to PVCs without storageClassName; a PVC with storageClassName "" skips dynamic provisioning.

Configure volume types, access modes and reclaim policies

  • emptyDir (medium Memory, sizeLimit), configMap, secret and projected live with the Pod; hostPath, local (nodeAffinity required on the PV) and nfs use outside storage, and persistentVolumeClaim gives durable storage. The ReadWriteOnce, ReadOnlyMany, ReadWriteMany and ReadWriteOncePod (CSI only) modes are used for matching, and the Retain or Delete policy is changed with kubectl patch pv on persistentVolumeReclaimPolicy.

Manage persistent volumes and persistent volume claims

  • A PersistentVolumeClaim binds one-to-one to a PV that satisfies capacity, access modes, storageClassName, volumeMode and selector; otherwise it stays Pending. With Retain, deleting the claim leaves the PV Released with its data until its claimRef is cleared. To expand, edit the claim, never the PV, and the pvc-protection finalizer stops a claim in use by a Pod from being deleted.

5. Troubleshooting

30–30%

Troubleshoot clusters and nodes

  • Diagnose a NotReady node with kubectl describe node (conditions and taints such as not-ready or unreachable) and, on the node, with systemctl status kubelet and journalctl -u kubelet. Usual causes: a stopped runtime, swap enabled, no CNI network, expired kubelet certificates or a kubeconfig for another cluster; settings are in /var/lib/kubelet/config.yaml, credentials in /etc/kubernetes/kubelet.conf.

Troubleshoot cluster components

  • In a kubeadm cluster, kube-apiserver, etcd, kube-scheduler and kube-controller-manager are static Pods the kubelet creates from /etc/kubernetes/manifests; a wrong flag keeps them from starting. When the API server is down, diagnose on the node with crictl ps -a and crictl logs; /readyz and /livez tell whether it accepts traffic or needs a restart.

Monitor cluster and application resource usage

  • kubectl top node and kubectl top pod (with --containers, --sort-by=cpu or memory and -A) read the Metrics API that metrics-server serves from kubelet data. CPU is shown in millicores and memory as the working set; compare it with requests and limits: exceeding the memory limit causes OOMKilled (exit code 137) and node pressure causes evictions.

Manage and evaluate container output streams

  • Containers should write to stdout and stderr: the kubelet keeps that output under /var/log/pods, rotates it with containerLogMaxSize and containerLogMaxFiles and serves it through kubectl logs (-c, --previous, --tail, --since, -l). If an application writes to files, a streaming sidecar copies them to its stdout; for debugging use kubectl exec and kubectl debug with an ephemeral container.

Troubleshoot services and networking

  • When a Service does not answer, check that it exists, that its selector matches the labels of Ready Pods (kubectl get endpointslices -l kubernetes.io/service-name=web) and that targetPort points at the container port. Then test DNS resolution from a temporary Pod, the state of CoreDNS and the kube-dns Service, the NetworkPolicies that apply and that kube-proxy runs on the node.