Which command scales a deployment config to a specified number of replicas?

Prepare for the Red Hat OpenShift Developer II DO288 Exam with our quizzes. Study with flashcards and multiple choice questions, each with hints and explanations. Get ready for your certification!

Multiple Choice

Which command scales a deployment config to a specified number of replicas?

Explanation:
Scaling a DeploymentConfig is done by adjusting its replica count with the oc scale command, targeting the DeploymentConfig resource and setting the desired number of replicas with the --replicas flag. Using the shorthand dc makes the command clear and conventional: oc scale dc/<name> --replicas=<num>. This directly tells OpenShift to update the deployment to run the specified number of pod replicas. The alternative with --size uses a flag that isn’t used for setting replica counts, so it won’t achieve the scaling. The longer form deploymentconfig/<name> might work in some environments, but the common and recommended form for OpenShift is the shorthand dc/<name>. The resize subcommand isn’t used for scaling in this context, so it won’t perform the desired replica adjustment.

Scaling a DeploymentConfig is done by adjusting its replica count with the oc scale command, targeting the DeploymentConfig resource and setting the desired number of replicas with the --replicas flag. Using the shorthand dc makes the command clear and conventional: oc scale dc/ --replicas=. This directly tells OpenShift to update the deployment to run the specified number of pod replicas.

The alternative with --size uses a flag that isn’t used for setting replica counts, so it won’t achieve the scaling. The longer form deploymentconfig/ might work in some environments, but the common and recommended form for OpenShift is the shorthand dc/. The resize subcommand isn’t used for scaling in this context, so it won’t perform the desired replica adjustment.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy