Kubernetes essentials: 50 core objects and kubectl commands
Kubernetes fundamentals for developers and CKA or CKAD candidates: Pods, Deployments, Services, storage, probes, resources and scheduling, plus the kubectl commands you use daily.
Practice now
Study without an account
Scheduled with the default Askesis timings. Progress is saved in this browser.
All 50 cards
- 1What is a Pod?The smallest deployable unit: one or more containers that share a network namespace (one IP) and volumes, and are scheduled together on one node
- 2DeploymentKeeps a set of identical Pods running through ReplicaSets, with rolling updates and rollbacksThe usual choice for stateless apps.
- 3ReplicaSetKeeps a specified number of Pod replicas running; normally managed by a Deployment rather than created directly
- 4StatefulSetFor stateful apps: Pods get stable names (
db-0,db-1), start in order and each keep their own PersistentVolumeClaim - 5DaemonSetRuns one copy of a Pod on every node, or on selected nodes, e.g. log collectors and monitoring agents
- 6Job vs CronJobA Job runs Pods until a task completes successfully; a CronJob creates Jobs on a cron schedule
- 7Init containersRun to completion, one after another, before the app containers startTypical uses: waiting for a dependency, running migrations, fetching configuration.
- 8What does a Service do?Gives a set of Pods, chosen by a label selector, a stable virtual IP and DNS name, and load-balances traffic across them
- 9The four Service types
ClusterIP(the default, internal only),NodePort(a port on every node),LoadBalancer(an external cloud load balancer),ExternalName(a DNS CNAME) - 10Default NodePort range30000–32767
- 11Headless ServiceA Service with
clusterIP: None: DNS returns the Pod IPs directly instead of one virtual IPStatefulSets use one to give each Pod its own DNS name. - 12A Service’s DNS name inside the cluster
<service>.<namespace>.svc.cluster.localFrom the same namespace, the bare service name works. - 13IngressRules that route HTTP and HTTPS traffic to Services by host name and path; it does nothing without an ingress controller running in the clusterThe newer Gateway API is its more expressive successor.
- 14NetworkPolicyRules for which traffic may reach or leave Pods, selected by labels, namespaces or IP rangesOnly enforced if the cluster’s network plugin supports it, as Calico and Cilium do.
- 15ConfigMap vs SecretBoth inject configuration as environment variables or files; Secrets hold sensitive data but are only base64-encoded by default, not encryptedTurn on encryption at rest and limit who can read Secrets with RBAC.
- 16NamespaceA scope for names, resource quotas and access control inside a clusterBuilt in:
default,kube-system,kube-publicandkube-node-lease. - 17Labels vs annotationsLabels are identifying key-value pairs that selectors match on; annotations hold non-identifying metadata for tools and people
- 18PersistentVolume vs PersistentVolumeClaimA PV is a piece of storage in the cluster; a PVC is a request for storage that binds to a matching PV and is mounted by Pods
- 19StorageClassDescribes a kind of storage and lets PVCs provision PersistentVolumes dynamically, on demand
- 20Volume access modes
ReadWriteOnce(one node),ReadOnlyMany,ReadWriteManyandReadWriteOncePod(a single Pod) - 21Liveness probeWhen it fails, the kubelet restarts the container
- 22Readiness probeWhile it fails, the Pod is taken out of Service endpoints and gets no traffic; the container isn’t restarted
- 23Startup probeHolds off liveness and readiness checks until it succeeds, so slow-starting apps aren’t killed during startup
- 24An HTTP liveness probe in a container specyaml
livenessProbe: httpGet: path: /healthz port: 8080 initialDelaySeconds: 5 periodSeconds: 10Probes can also usetcpSocket,execorgrpc. - 25Resource requests vs limitsRequests are what the scheduler reserves for a container on a node; limits are the most it may useOver its memory limit a container is OOM-killed; over its CPU limit it is throttled.
- 26The three Pod QoS classes
Guaranteed(every container has CPU and memory requests equal to limits),Burstable(some requests or limits set),BestEffort(none set)Under memory pressure, BestEffort Pods are evicted first. - 27HorizontalPodAutoscalerScales a workload’s replica count up and down based on metrics such as CPU utilizationIt needs the metrics API, usually provided by metrics-server.
- 28Rolling update settings of a Deployment
maxSurge(extra Pods allowed during the update) andmaxUnavailable(Pods that may be down), both 25% by default - 29Control plane components
kube-apiserver,etcd,kube-schedulerandkube-controller-manager, pluscloud-controller-managerin cloud clusters - 30etcdThe consistent, distributed key-value store that holds all cluster stateBack it up: losing etcd means losing the cluster’s configuration.
- 31kubeletThe agent on each node that makes sure the containers in its Pods are running and healthy
- 32kube-proxyRuns on each node and programs the network rules (iptables, IPVS or nftables) that make Services work
- 33kube-schedulerAssigns each new Pod to a node, based on resource requests, affinity rules, and taints and tolerations
- 34Taints and tolerationsA taint on a node repels Pods unless they have a matching tolerationbash
kubectl taint nodes node1 gpu=true:NoSchedule - 35nodeSelector vs node affinityBoth attract Pods to nodes with certain labels;
nodeSelectoris a simple exact match, while affinity adds operators and required or preferred rules - 36CrashLoopBackOffA container keeps crashing, and the kubelet restarts it with an increasing delay, up to five minutesStart with
kubectl logs --previousandkubectl describe pod. - 37ImagePullBackOffThe node can’t pull the image: a wrong name or tag, a private registry without credentials, or a network problem
- 38Role vs ClusterRoleA Role grants permissions in one namespace; a ClusterRole is cluster-wide or reusable across namespacesGrant them with a RoleBinding or a ClusterRoleBinding.
- 39ServiceAccountThe identity that processes in a Pod use to call the Kubernetes API
- 40List Pods with their node and IP addressbash
kubectl get pods -o wideAdd-Afor every namespace, or-wto watch for changes. - 41See a Pod’s events and why it isn’t startingbash
kubectl describe pod web-7d4b9c - 42Show the logs of a container’s previous, crashed runbash
kubectl logs web-7d4b9c --previous-c namepicks a container in a multi-container Pod;-ffollows new output. - 43Open a shell inside a running Podbash
kubectl exec -it web-7d4b9c -- sh - 44Create or update resources from a manifestbash
kubectl apply -f deployment.yaml - 45Watch a rollout, then roll it backbash
kubectl rollout status deployment/web kubectl rollout undo deployment/web - 46Scale a Deployment to five replicasbash
kubectl scale deployment web --replicas=5 - 47Reach a Service from your machine without exposing itbash
kubectl port-forward svc/web 8080:80 - 48Generate a Deployment manifest without creating anythingbash
kubectl create deployment web --image=nginx --dry-run=client -o yaml > web.yaml - 49List cluster contexts and switch to anotherbash
kubectl config get-contexts kubectl config use-context staging - 50Empty a node safely before maintenancebash
kubectl drain node1 --ignore-daemonsetsThenkubectl uncordon node1lets Pods be scheduled there again.
Frequently asked questions
Do I need to know Docker first?
It helps. Kubernetes runs containers built from images, so the Docker deck is a good warm-up.
Is this enough for the CKA or CKAD exam?
No. Both exams are hands-on. This deck makes the concepts and commands automatic, so your practice time in a real cluster goes further.
What is the difference between liveness and readiness probes?
A failing liveness probe restarts the container; a failing readiness probe only stops traffic to the Pod until it passes again.
More in IT & DevOps
Linux command line
Linux commands and files for sysadmins and LPIC-1 candidates: find and grep, permissions and special bits, fstab, systemd targets, package managers, users, cron and more.
50 cardsLinux filesystem basics
Learn the Linux directory tree: what /etc, /var, /usr, /proc and /dev are for, plus passwd, shadow, fstab and hosts. Free flashcards, no signup.
50 cardsIntermediate Linux filesystem
Linux paths admins use daily: /usr/local, /var/lib, /run, /sys, /etc/skel, sudoers, Bash startup files, SSH keys, resolv.conf and /proc. Free flashcards.
50 cardsAdvanced Linux filesystem
Deeper Linux files for LPIC-1: profile.d, sudoers.d, systemd units, GRUB config, nsswitch.conf, ld.so.conf, distro logs and /lib/modules. Free flashcards.
50 cardsBash scripting
Bash scripting flashcards: shebangs, quoting, exit codes, tests, loops, functions, arrays, parameter expansion, redirection, set -euo pipefail and traps.
50 cardsVim
Learn Vim from the keyboard up: modes, motions, operators and text objects, search and :s substitutions, registers, macros, visual mode and windows.
50 cardsNetworking
Computer networking fundamentals: OSI and TCP/IP layers, TCP vs UDP, common port numbers, subnetting and CIDR, DNS, DHCP and ARP, and IPv6 basics.
50 cardsCyber security
Cyber security flashcards: the CIA triad, phishing, XSS, CSRF, SQL injection, MITM, hashing vs encryption, TLS, MFA, least privilege, OWASP and zero trust.
50 cardsDocker
Learn Docker from images and layers to multi-stage builds, volumes, networks and Compose, with the commands and best practices you use daily.
50 cardsAWS
AWS flashcards: regions and AZs, EC2, S3 storage classes, IAM users, roles and policies, VPC networking, RDS, Lambda, CloudWatch and Route 53.
50 cardsTerraform
Terraform flashcards: HCL, providers, resources, variables and outputs, state and remote backends, plan and apply, modules, count, for_each, drift and import.
50 cards