Yes, templating YAML is crazy. But is the answer jsonnet? That's even more batshit.
Why hasn't anyone opted for a "patch-based" approach? I.e. start with a base YAML/JSON file, apply a second file over it, apply this third one, and use the result as the config. How you generate these files is entirely up to you.