<p>i've came across 2 types of syntax for creating configmaps from files in kubernetes.</p>

<p><strong>first one</strong> ;</p>

<hr>

<pre><code>apiVersion: v1
data:
  file1.yaml: |+
    parameter1=value1
kind: ConfigMap
metadata:
  name: my-configmap
</code></pre>

<p><strong>second one</strong> ;</p>

<pre><code>apiVersion: v1
data:
  file1.yaml: | -
    parameter1=value1
kind: ConfigMap
metadata:
  name: my-configmap
</code></pre>

<p>what is the difference between |+ and |- ?</p>

<p>This is the <a href="https://yaml-multiline.info/" rel="noreferrer">block chomping indicator</a>.</p>

<p>Directly  quoting from the link:</p>

<blockquote>
  <p>The chomping indicator controls what should happen with newlines at
  the end of the string. The default, clip, puts a single newline at the
  end of the string. To remove all newlines, strip them by putting a
  minus sign (-) after the style indicator. Both clip and strip ignore
  how many newlines are actually at the end of the block; to keep them
  all put a plus sign (+) after the style indicator.</p>
</blockquote>

<p>This means that for:</p>

<pre><code>apiVersion: v1
data:
  file1.yaml: |-
    parameter1=value1


kind: ConfigMap
metadata:
  name: my-configmap
</code></pre>

<p>file1.yaml will have the value:</p>

<pre><code>parameter1=value1
</code></pre>

<p>For:</p>

<pre><code>apiVersion: v1
data:
  file1.yaml: |+
    parameter1=value1


kind: ConfigMap
metadata:
  name: my-configmap
</code></pre>

<p>file1.yaml will have the value:</p>

<pre><code>parameter1=value1 # line break
# line break
# line break
</code></pre>
