Welcome to the Linux Foundation Forum!

Does the indentation mean anything for list elements in Kubernetes yaml?

does the indentation mean anything for list elements in Kubernetes yaml ? For example, in the pod yaml under Use-Case: As container environment variables "- name" under "containers:" is indented, however, "- secretRef" under "envFrom" is not indented...

Comments

  • Posts: 9
    edited July 2020

    Hello,
    Not related to Kubernetes.
    yaml works like this.

  • Posts: 2,451

    Hi @Ryan-Chase,

    In this specific example, - name is evaluated the same way, with or without indentation:

    With indentation (as presented in the example):

    1. spec:
    2. containers:
    3. - name: test-container
    4. image: k8s.gcr.io/busybox

    Without indentation:

    1. spec:
    2. containers:
    3. - name: test-container
    4. image: k8s.gcr.io/busybox

    Regards,
    -Chris

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training