<p>I want to have the specific configMap structure </p>

<pre><code>  apiVersion: v1
    kind: ConfigMap
    metadata:
      name: config-map-router1
      labels:
        name: nc1
    data:
      object.properties: |
        address: "1"
        port: ""
</code></pre>

<p>How to represent the indentation with </p>

<blockquote>
  <p>object.properties:</p>
</blockquote>

<p>We have to develop little more this part of code</p>

<pre><code>        Map&lt;String, String&gt; data = new HashMap&lt;&gt;();
        data.put("address","");
        //...

        V1ConfigMap configMap= new V1ConfigMap();
        configMap.apiVersion("v1");
        configMap.kind("ConfigMap");
        configMap.metadata(meta);

        configMap.data(data);
</code></pre>

Smaillns
<p>I assume you are using the Java client.<br>
The object.properties indentation appears when you create a configmap from a file. Example: <code>kubectl create configmap myapp-config --from-file=object.properties</code>.<br>
<a href="https://github.com/kubernetes-client/java/blob/master/kubernetes/docs/V1ConfigMap.md" rel="nofollow noreferrer">From what I have researched</a> the Java client seems to only support <code>&lt;string, string&gt;</code> as values for <em>data</em>. As your file object.properties only has UTF-8 characters, you can try:<br>
 <code>data.put("object.properties","address: \"1\"\nport: \"\"")</code> 
or creating  a file like the following and opening in Java as a String:</p>

<pre><code>address: "1"
port: ""
</code></pre>

<p>you can also open the file and add to the configmap as a binary, using <em>binaryData</em> instead of <em>data</em></p>
