Kubernetes pods can be made up of multiple containers, that’s why containers is an array
A common example would be a worker container or say a webserver and then another one that is used for shipping logs, or if you’re using a service mesh to act as a ‘router’ to encrypt communication to other pods.
Ahh, sorry -
So for arrays in yaml (yaml spec refers to them as collections), the space doesn’t matter because it can tell it’s an element of a collection by looking for a dash then a space “- “.
Because it can clearly parse the elements, the spacing doesn’t matter.