One thing that might help you in this madness is:
https://github.com/dhall-lang/dhall-kubernetes
Type safe, fat finger safe representation of your YAMLs is grossly underrated.