<p>I want to pass a list object in the data section of configMap in application YAML file.</p>
<p>I have the following list in the properties file:</p>
<pre><code>abc.management.provider[0].url=https://example.com
 abc.management.provider[0].username=John
 abc.management.provider[1].url=https://example2.com
 abc.management.provider[1].username=Targerian
</code></pre>
<p>YAML file:</p>
<pre><code>data:
    abc_management:
      provider:
        - url: &quot;https://example.com&quot;
          username: &quot;John&quot;
        - url: &quot;https://example2.com&quot;
          username: &quot;Targerian&quot;
</code></pre>
<p>I'm getting this error: ConfigMap in version &quot;v1&quot; cannot be handled as a ConfigMap: v1.ConfigMap: Data: ReadString: expects &quot; or n,.</p>
<p>what should I do?</p>

<blockquote>
<p>what should I do?</p>
</blockquote>
<p>This mostly depends on how your application reads the configuration.</p>
<p>If it works for you, you an <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#create-configmaps-from-files" rel="nofollow noreferrer">create the <code>ConfigMap</code> directly</a> with your properties-file:</p>
<pre><code>kubectl create configmap app-config --from-file=app.properties
</code></pre>
