Kubernetes Container Orchestration Container Orchestration 5 — Questions and Answers
Question 1: What is the purpose of a Kubernetes Secret?
- To encrypt etcd data at rest automatically
- To store sensitive data like passwords and tokens in base64-encoded form (Correct answer)
- To define network policies that block external access
- To create read-only mounts for configuration files
Correct answer: To store sensitive data like passwords and tokens in base64-encoded form
Secrets store sensitive information separately from Pod specs, reducing exposure in application code and manifests.
Question 2: Which Kubernetes resource guarantees stable network identities and ordered deployment for stateful applications?
- Deployment
- ReplicaSet
- DaemonSet
- StatefulSet (Correct answer)
Correct answer: StatefulSet
StatefulSets provide stable hostnames, ordered Pod creation/deletion, and persistent storage for stateful workloads like databases.
Question 3: What does the 'kubectl rollout undo deployment/<name>' command do?
- Deletes the most recent Deployment revision
- Reverts the Deployment to its previous revision (Correct answer)
- Pauses the rollout of a new Deployment version
- Scales the Deployment down to zero replicas
Correct answer: Reverts the Deployment to its previous revision
kubectl rollout undo rolls back a Deployment to the previously deployed revision, restoring the old Pod template.
Question 4: Which network plugin concept in Kubernetes is responsible for assigning IP addresses to Pods?
- kube-proxy
- CoreDNS
- CNI (Container Network Interface) plugin (Correct answer)
- Ingress Controller
Correct answer: CNI (Container Network Interface) plugin
CNI plugins like Calico, Flannel, or Cilium handle Pod networking, including IP allocation and routing between Pods.
Question 5: What is the effect of setting a container's resource limit lower than its request in Kubernetes?
- The Pod will fail to schedule
- The configuration is invalid and rejected by the API server (Correct answer)
- The limit is silently raised to match the request
- The Pod schedules normally but the container may be OOMKilled if it exceeds the limit
Correct answer: The configuration is invalid and rejected by the API server
Kubernetes rejects resource configurations where limits are set below requests because limits must be at least equal to requests.
Question 6: Which RBAC object in Kubernetes binds a Role to a user, group, or service account?
- ClusterRole
- RolePolicy
- RoleBinding (Correct answer)
- ServicePolicy
Correct answer: RoleBinding
A RoleBinding grants the permissions defined in a Role to a subject (user, group, or ServiceAccount) within a namespace.
Question 7: What is the purpose of an Init Container in a Kubernetes Pod?
- To run alongside application containers to provide sidecar functionality
- To initialize the node before scheduling the Pod
- To run to completion before app containers start, performing setup tasks (Correct answer)
- To monitor the health of application containers and restart them
Correct answer: To run to completion before app containers start, performing setup tasks
Init containers run sequentially before app containers and are commonly used for setup tasks like waiting for dependencies.
What is the purpose of a Kubernetes Secret?