<p>I have this scenario in my spring boot yaml file:</p>
<p><a href="https://i.stack.imgur.com/NUfd1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NUfd1.png" alt="bootstrap.yaml" /></a></p>
<p>This way I'm able to load the properties in config file to memory.</p>
<p><a href="https://i.stack.imgur.com/qgiUB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qgiUB.png" alt="enter image description here" /></a></p>
<p>Now I need to apply this same configuration to my config map kubernetes file.</p>
<p>I have found this example in kubernetes official documentation, but is different from what a I need.</p>
<p><a href="https://kubernetes.io/docs/concepts/configuration/configmap/#configmaps-and-pods" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/configuration/configmap/#configmaps-and-pods</a></p>
<p><a href="https://i.stack.imgur.com/uHaWM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uHaWM.png" alt="enter image description here" /></a></p>
<p>Are there some way to apply the configuration in config map as is in my first image ?</p>

Yuri.stpsa
<p>Yes, of course - use your application.yaml as input.</p>
<pre><code>kubectl create configmap demo --from-file application.yaml
</code></pre>
<p>You can mount the file in a container again as <code>application.yaml</code> and you're done.</p>
<p>The generated configmap looks like this:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
data:
  application.yaml: |+
    my-company:
      kafka:
        some-propery-1: 10
      topics:
      - foo: bar
</code></pre>
<p>By the way: Please don't post screenshots with code, this makes the content inaccessible to screen readers and search engines.</p>
