Awesome Reviewers

When templating, explicitly distinguish three states: missing, explicit false, and null. Relying on truthiness can silently drop intended configuration.

Apply two patterns: 1) Preserve explicit false (boolean fields)

{{/* BAD: with treats false as empty */}}
{{- with .Values.serviceMonitor.honorLabels }}
honorLabels: {{ . }}
{{- end }}

{{/* GOOD: preserves explicit false */}}
{{- if hasKey .Values.serviceMonitor "honorLabels" }}
honorLabels: {{ .Values.serviceMonitor.honorLabels }}
{{- end }}

2) Omit fields via real null (Helm values)

# values.yaml override example
podSecurityContext:
  runAsUser: null
  fsGroup: null
securityContext:
  runAsUser: null

Rule of thumb: