Bird
0
0

Which of the following is the correct syntax to reference a value named service.port inside a Helm template?

easy📝 Syntax Q3 of 15
Kubernetes - Helm Package Manager
Which of the following is the correct syntax to reference a value named service.port inside a Helm template?
A{{ .service.port }}
B{{ .Values.service.port }}
C{{ .Values['service.port'] }}
D{{ .Values.service[port] }}
Step-by-Step Solution
Solution:
  1. Step 1: Recall Helm template syntax for nested values

    Nested values are accessed with dot notation inside .Values, e.g., .Values.service.port.
  2. Step 2: Evaluate options

    {{ .Values.service.port }} uses correct dot notation; others misuse brackets or omit .Values.
  3. Final Answer:

    {{ .Values.service.port }} -> Option B
  4. Quick Check:

    Nested value access = .Values.service.port [OK]
Quick Trick: Use .Values for all values, dot notation for nested keys [OK]
Common Mistakes:
  • Omitting .Values prefix
  • Using brackets incorrectly
  • Mixing dot and bracket notation wrongly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes