Certified Kubernetes Administrator (CKA) Practice Test

Question: 1 / 400

When reconfiguring a deployment to add a port specification, which YAML field should you modify?

spec.template.spec.containers

When reconfiguring a deployment to add a port specification, the correct field to modify is the one that pertains to the container configuration within the pod template. Specifically, you should focus on `spec.template.spec.containers`, as this part of the YAML structure directly relates to the containers which are part of the pod.

Within the containers array, you can specify various properties for each container including the ports that should be exposed. By modifying this field, you can add a new port configuration, adjusting the container's settings to reflect the desired state.

The other options do not serve the purpose of altering the port specifications for a deployment. The `spec.selector` field is used to define which pods the deployment manages, while `spec.strategy` deals with the deployment strategy for rolling updates or recreating pods, and `spec.ports` is not a valid field in the context of a deployment. Therefore, it is crucial to focus on modifying the container specifications to effectively add or change port configurations in a deployment.

Get further explanation with Examzify DeepDiveBeta

spec.selector

spec.strategy

spec.ports

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy