The --set flag uses a small expression language where . separates map keys, , separates independent assignments, and [0] indexes arrays. A value containing any of those characters is parsed rather than taken literally.
Setting an annotation whose key contains dots, such as --set podAnnotations.prometheus.io/scrape=true, creates a nested map three levels deep instead of one key. Escape the dots with backslashes: --set podAnnotations.prometheus\.io/scrape=true. A comma inside a value, common in a comma-separated allowlist, needs the same treatment.
Separately, --set infers types. A value like 1.0 becomes a float and renders as 1, and a version string such as 08 becomes an integer with the leading zero lost. Use --set-string to force the value to a string, and --set-file to read a value from a file when it contains newlines or certificates. For anything nontrivial, a values file passed with -f avoids the parser entirely and is easier to review.