In a Kubernetes Deployment, which field controls the number of desired pod replicas?

Prepare for the Red Hat Openshift Developer EX288 Exam. Study with comprehensive quizzes and flashcards. Each question includes hints and explanations to enhance your understanding. Ace your exam with confidence!

Multiple Choice

In a Kubernetes Deployment, which field controls the number of desired pod replicas?

Explanation:
The number of desired pod replicas in a Deployment is controlled by the replicas field in the Deployment spec. This field tells the Deployment how many pod instances it aims to have running at any given time. The Deployment controller reconciles the actual state to match this desired state by creating or terminating pods (via the underlying ReplicaSet) as needed. If you set replicas to a certain number, the controller works to maintain that many pods; if the field is omitted, the default is 1. To change the number, you can modify this field in the manifest or use commands like kubectl scale. The other options aren’t valid fields in a Deployment spec—there isn’t a replicasCount, desiredReplicas, or podCount field, so they don’t define the desired scale.

The number of desired pod replicas in a Deployment is controlled by the replicas field in the Deployment spec. This field tells the Deployment how many pod instances it aims to have running at any given time. The Deployment controller reconciles the actual state to match this desired state by creating or terminating pods (via the underlying ReplicaSet) as needed. If you set replicas to a certain number, the controller works to maintain that many pods; if the field is omitted, the default is 1. To change the number, you can modify this field in the manifest or use commands like kubectl scale.

The other options aren’t valid fields in a Deployment spec—there isn’t a replicasCount, desiredReplicas, or podCount field, so they don’t define the desired scale.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy