Kubernetes Container Orchestration Kubernetes 5 — Questions and Answers
Question 1: Which Kubernetes resource is used to store non-sensitive configuration data such as app settings?
- Secret
- ConfigMap (Correct answer)
- PersistentVolume
- ServiceAccount
Correct answer: ConfigMap
ConfigMaps store non-confidential key-value configuration data that can be consumed by Pods as environment variables or mounted files.
Question 2: What is the effect of setting a Pod's QoS class to 'Guaranteed'?
- The Pod gets dedicated CPU cores and is never evicted under memory pressure
- The Pod's resource requests and limits are equal, making it the last evicted under pressure (Correct answer)
- The Pod bypasses all network policies
- The Pod is scheduled on the master node
Correct answer: The Pod's resource requests and limits are equal, making it the last evicted under pressure
Guaranteed QoS is assigned when all containers set identical requests and limits; these Pods are evicted last during resource pressure.
Question 3: What is a Kubernetes ServiceAccount used for?
- Defining human user credentials for kubectl access
- Providing an identity for processes running in Pods to authenticate with the API server (Correct answer)
- Managing SSH keys for node access
- Storing database connection strings
Correct answer: Providing an identity for processes running in Pods to authenticate with the API server
ServiceAccounts give Pods an identity so they can authenticate against the Kubernetes API server with appropriate RBAC permissions.
Question 4: Which RBAC resource binds a Role to a user, group, or ServiceAccount within a specific namespace?
- ClusterRole
- ClusterRoleBinding
- RoleBinding (Correct answer)
- PolicyBinding
Correct answer: RoleBinding
A RoleBinding grants the permissions defined in a Role to a subject (user, group, or ServiceAccount) within a specific namespace.
Question 5: What does the 'kubectl rollout undo deployment/<name>' command do?
- Deletes the current Deployment and recreates it from scratch
- Rolls back the Deployment to the previous revision (Correct answer)
- Pauses the Deployment's rollout
- Scales the Deployment to zero replicas
Correct answer: Rolls back the Deployment to the previous revision
kubectl rollout undo reverts a Deployment to its previous recorded revision by switching to the prior ReplicaSet.
Question 6: Which scheduler feature allows you to repel Pods from nodes unless specific tolerations are set?
- Node affinity
- Pod affinity
- Taints and tolerations (Correct answer)
- Priority classes
Correct answer: Taints and tolerations
Taints are applied to nodes to repel Pods; a Pod must have a matching toleration to be scheduled on a tainted node.
Question 7: What is the purpose of a PodDisruptionBudget (PDB) in Kubernetes?
- To limit the maximum number of Pods that can run simultaneously
- To guarantee a minimum number of Pods remain available during voluntary disruptions (Correct answer)
- To set CPU burst limits for a namespace
- To prevent Pods from being scheduled on specific nodes
Correct answer: To guarantee a minimum number of Pods remain available during voluntary disruptions
A PDB ensures that a minimum number (or percentage) of Pods in a set remain available during voluntary disruptions such as node drains or cluster upgrades.
Which Kubernetes resource is used to store non-sensitive configuration data such as app settings?