1001Ferramentas
📦Dev

Kubernetes ConfigMap Generator

Generate a Kubernetes ConfigMap in YAML from key=value pairs, ready to apply with kubectl. Centralize your pod configuration in seconds.

YAML

Write a ConfigMap without counting spaces

You want three settings out of the code and into a ConfigMap, and then the YAML gets in the way. Two spaces or four? Does data sit under metadata or beside it? One stray space and kubectl answers with mapping values are not allowed in this context. Type the resource name, paste your key=value lines, and the manifest builds itself beside you as you type.

The skeleton is fixed: apiVersion v1, kind ConfigMap, metadata.name, then a data block filled from your lines. Each line splits on the first equals sign, so everything after it stays inside the value, extra equals signs included. Values come out quoted, which keeps DATABASE_URL=postgres://a=b:5432 intact and stops 8080 or true from being read as a number and a boolean.

Two things to check before you apply. The name has to be a DNS-1123 label (lowercase letters, digits, dashes) and keys are limited to letters, digits, dot, dash and underscore; nothing on the page validates that for you. Multi-line values, such as an entire nginx.conf, do not fit here, because every line break becomes another key. Reach for kubectl create configmap --from-file instead. Everything runs in your browser, and editing a ConfigMap never restarts pods on its own.

Frequently asked questions

Can I set a namespace?
No. The output carries only metadata.name. Add the namespace by hand in the file or pass -n when you run kubectl apply.
Why is every value quoted?
Because the data field of a ConfigMap must be a map of strings. Unquoted, YAML would read 8080 as an integer and yes as a boolean, and the API server would reject the object.
Is there a copy button?
No. The YAML sits in a plain text block that you select and copy. It rebuilds on every keystroke, so there is nothing to click.

Related Tools