`json: cannot unmarshal string into Go struct field ContainerPort.spec.template.spec.containers.ports.containerPort of type int32`
BeginnerTroubleshootingTemplating & Rendering Errors
Answer
Likely causes → The port was quoted in values (port: "3000") or in the template ({{ .Values.port | quote }}).
Diagnose → helm template ... | yq '.spec.template.spec.containers[].ports'.
Fix → Render as integer: containerPort: {{ .Values.api.port | int }}; keep values unquoted.
Prevent → Schema with "type": "integer" for ports.
More on Templating & Rendering Errors
`Error: template: shop/templates/api-deployment.yaml:24:28: executing "shop/templates/api-deployment.yaml" at <.Values.api.image.tag>: nil pointer evaluating interface {}.tag`Beginner`Error: YAML parse error on shop/templates/api-deployment.yaml: error converting YAML to JSON: yaml: line 31: did not find expected key`Beginner`Error: YAML parse error on shop/templates/configmap.yaml: error converting YAML to JSON: yaml: line 7: mapping values are not allowed in this context`Intermediate`Error: template: shop/templates/api-deployment.yaml:18:12: executing "..." at <include "shop.labels" .>: error calling include: template: no template "shop.labels" associated with template "gotpl"`Beginner`Error: template: shop/templates/_helpers.tpl:14:14: executing "shop.fullname" at <.Chart.Name>: can't evaluate field Chart in type string`Intermediate`Error: parse error at (shop/templates/api-deployment.yaml:40): function "toYml" not defined`Beginner