<p>How can I generate ConfigMap from directory without create it?</p>

<p>If I use:</p>

<pre><code>$ kubectl create configmap my-config --from-file=configuration/ -o yaml
apiVersion: v1
   data:
...
</code></pre>

<p>ConfigMap yaml output is displayed but <code>my-config</code> is created on current Kubernetes project context.</p>

<p>I would like only generate ConfigMap file, it is possible? Are there a <code>kubectl create</code> "dry" mode?</p>

<p>Best regards,<br/>
Stéphane</p>

<p>Just add <code>--dry-run</code> so:</p>

<pre><code>$ kubectl create configmap my-config --from-file=configuration/ -o yaml --dry-run
</code></pre>

<p>Source: <a href="https://kubernetes.io/docs/user-guide/kubectl/kubectl_create_configmap/" rel="noreferrer">https://kubernetes.io/docs/user-guide/kubectl/kubectl_create_configmap/</a></p>
