<p>one of my keys in a Kubernetes deployment is really big and I want to break it into a multi line key:</p>
<pre class="lang-yaml prettyprint-override"><code>annotations:
  container.apparmor.security.beta.kubernetes.io/9c2591b6-bd95-442a-9d35-fb600143a873: runtime/default
</code></pre>
<p>I tried this:</p>
<pre class="lang-yaml prettyprint-override"><code>annotations:
  ? &gt;-
    container.apparmor.security.beta.kubernetes.io/
    9c2591b6-bd95-442a-9d35-fb600143a873
  : runtime/default
</code></pre>
<p>but it renders like that:</p>
<pre class="lang-yaml prettyprint-override"><code>annotations:
  container.apparmor.security.beta.kubernetes.io/ 9c2591b6-bd95-442a-9d35-fb600143a873: runtime/default
</code></pre>
<p>Any idea who to break object key into a multi line string without any spaces?<br />
I found a lot of solutions for multi line strings of the keys value but nothing regarding the key itself.</p>
<p>Thanks in advance</p>

cmdjulian
<p>Use double quotes and escape the newlines:</p>
<pre class="lang-yaml prettyprint-override"><code>annotations:
  ? &quot;container.apparmor.security.beta.kubernetes.io/\
    9c2591b6-bd95-442a-9d35-fb600143a873&quot;
  : runtime/default
</code></pre>
<p>Double quotes are the only YAML scalar that can be broken anywhere with an escaped newline.</p>
