Unluckily, the builtin yaml format has its own option philosophy. Not to mention some tool like kustomize requires you do that. Each time you play with kubectl, there is no indent.
ApiVersion : apps/v1 kind : Deployment metadata : name : nginx-deployment spec : selector : matchLabels : app : nginx replicas : 2 template : metadata : labels : app : nginx spec : containers : - name : nginx image : nginx:1.14.2 ports : - containerPort : 80Īs you see, the sequence style( containers and ports) in the k8s style yaml has no indent.