Find configuration differences between the staging and prod Helm values files.
IntermediateScenarioScenarios: text processing and scheduling decisions
Answer
Situation read → Textual diffs are noisy because of key order and formatting; normalize first.
What I'd do →
diff <(yq -P 'sort_keys(..)' values-staging.yaml) <(yq -P 'sort_keys(..)' values-prod.yaml)
# flat path=value view, easy to read and grep
flat() { yq -o=json '.' "$1" | jq -r 'paths(scalars) as $p | "\($p | map(tostring) | join("."))=\(getpath($p))"' | sort; }
diff <(flat values-staging.yaml) <(flat values-prod.yaml)
sort_keys(..)sorts keys recursively, so order does not matter.- The flattened form shows exactly which path differs (
resources.limits.memory=512Mi).
Why → Normalized diffs show real configuration drift between environments.
Interview tip → Mention helm diff upgrade for comparing rendered manifests against what is deployed.
More on Scenarios: text processing and scheduling decisions
Users report errors in the last hour. From the Nginx access log, find which endpoints produce the most 5xx responses.BeginnerA MySQL slow log is 3 GB. You need the 10 slowest query patterns. What do you do?IntermediateTwo servers that should be identical behave differently. Compare their installed packages.BeginnerFind which pods were OOMKilled in a namespace, with their container names and restart counts.IntermediateProduce a CSV of running EC2 instances that are missing an `Owner` tag.IntermediateYou have access logs from five web servers and need one timeline sorted by time. How?Intermediate