How can I generate ConfigMap from directory without create it?

3/15/2017

How can I generate ConfigMap from directory without create it?

If I use:

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

ConfigMap yaml output is displayed but my-config is created on current Kubernetes project context.

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

Best regards,
Stéphane

-- Stéphane Klein
kubernetes

1 Answer

3/15/2017

Just add --dry-run so:

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

Source: https://kubernetes.io/docs/user-guide/kubectl/kubectl_create_configmap/

-- Janos Lenart
Source: StackOverflow