Kubernetes Container Orchestration Container Orchestration 3 — Questions and Answers
Question 1: Which resource type is best suited for running a batch job that should execute once and complete?
- Deployment
- DaemonSet
- Job (Correct answer)
- StatefulSet
Correct answer: Job
A Job creates one or more Pods and ensures they run to successful completion.
Question 2: What does a PersistentVolumeClaim (PVC) do in Kubernetes?
- Defines storage class provisioner settings
- Requests a specific amount of storage from the cluster (Correct answer)
- Mounts a host directory directly into a Pod
- Replicates data across multiple nodes
Correct answer: Requests a specific amount of storage from the cluster
A PVC is a user's request for storage that is fulfilled by binding to a PersistentVolume.
Question 3: Which field in a Pod spec defines the minimum CPU and memory a container needs to be scheduled?
- limits
- requests (Correct answer)
- allocations
- quotas
Correct answer: requests
Resource requests are used by the scheduler to find a node with sufficient available capacity.
Question 4: What is the function of a Kubernetes Ingress resource?
- Assigns external IPs to nodes
- Routes external HTTP/HTTPS traffic to internal Services based on rules (Correct answer)
- Creates encrypted secrets for TLS certificates
- Scales Deployments based on incoming traffic
Correct answer: Routes external HTTP/HTTPS traffic to internal Services based on rules
Ingress manages external access to Services, typically HTTP, by defining host/path-based routing rules.
Question 5: A DaemonSet ensures that:
- Exactly one Pod runs cluster-wide at all times
- A copy of a Pod runs on every (or selected) node (Correct answer)
- Pods are evenly distributed across availability zones
- Pods restart on a defined schedule
Correct answer: A copy of a Pod runs on every (or selected) node
DaemonSets are ideal for node-level agents like log collectors or monitoring daemons that must run on every node.
Question 6: Which command scales a Deployment named 'web' to 5 replicas?
- kubectl resize deployment web --count=5
- kubectl scale deployment web --replicas=5 (Correct answer)
- kubectl update deployment web --pods=5
- kubectl set replicas deployment/web 5
Correct answer: kubectl scale deployment web --replicas=5
kubectl scale adjusts the desired replica count of a Deployment, ReplicaSet, or StatefulSet.
Question 7: What happens during a rolling update in a Kubernetes Deployment by default?
- All old Pods are terminated before new ones start
- New Pods are gradually started while old ones are incrementally terminated (Correct answer)
- The Deployment is paused and requires manual approval at each step
- Old and new Pods run simultaneously forever
Correct answer: New Pods are gradually started while old ones are incrementally terminated
Rolling updates incrementally replace old Pods with new ones to maintain availability throughout the update.
Which resource type is best suited for running a batch job that should execute once and complete?