<p>In this example (<a href="https://kind.sigs.k8s.io/docs/user/local-registry/" rel="nofollow noreferrer">link</a>), it creates kind cluster with config file, which patch containerd. What does the <code>- |-</code> under the line of <code>containerdConfigPatches</code>  mean?</p>
<p>I found <code>- |</code>  in yaml indicates this is a patch field. But what does the <code>-</code> following <code>- |</code> mean?</p>
<pre><code># create a cluster with the local registry enabled in containerd
cat &lt;&lt;EOF | kind create cluster --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
containerdConfigPatches:
- |-
  [plugins.&quot;io.containerd.grpc.v1.cri&quot;.registry.mirrors.&quot;localhost:${reg_port}&quot;]
    endpoint = [&quot;http://${reg_name}:5000&quot;]
EOF
</code></pre>

Mike
<p><code>|-</code> introduces a YAML <a href="https://yaml.org/spec/1.2.2/#81-block-scalar-styles" rel="nofollow noreferrer">block scalar</a>, a way of writing a multi-line string.  The <code>|</code> means that newlines are preserved (<code>&gt;</code> would fold the string into a single line), and the <code>-</code> means the new line at the end is removed.</p>
<pre class="lang-yaml prettyprint-override"><code>anywhere: |-
  This is a multi-line string.  The new
  line in the middle is preserved.
</code></pre>
<p>The <code>- </code> at the start of the line (the space is important) is a YAML <a href="https://yaml.org/spec/1.2.2/#821-block-sequences" rel="nofollow noreferrer">block sequence</a> (list).  This is the same way other lists are presented; for example</p>
<pre class="lang-yaml prettyprint-override"><code>listOfStrings:
  - one
  - two
  - three
</code></pre>
<p>The <code>- |-</code> is nothing more than combining these two things: it is a list item whose value is a multi-line string.</p>
