In a Helm chart example, which file would you typically edit to set the container port for the deployed pod?

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 Helm chart example, which file would you typically edit to set the container port for the deployed pod?

Explanation:
Configuring the container port for a running pod is done in the Deployment manifest that defines the pod template. In a Helm chart, that template lives in templates/deployment.yaml, where the containerPort is specified inside the container spec. It’s common to drive that value from values.yaml (for flexibility) by using a template expression like containerPort: {{ .Values.containerPort }}, but the actual port setting shown in the pod’s configuration comes from the deployment template itself. The other files aren’t used to define runtime ports—chart.yaml holds metadata, and README.md is documentation; while values.yaml provides default values to feed the templates, the concrete port assignment appears in the deployment template.

Configuring the container port for a running pod is done in the Deployment manifest that defines the pod template. In a Helm chart, that template lives in templates/deployment.yaml, where the containerPort is specified inside the container spec. It’s common to drive that value from values.yaml (for flexibility) by using a template expression like containerPort: {{ .Values.containerPort }}, but the actual port setting shown in the pod’s configuration comes from the deployment template itself. The other files aren’t used to define runtime ports—chart.yaml holds metadata, and README.md is documentation; while values.yaml provides default values to feed the templates, the concrete port assignment appears in the deployment template.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy