Kafka .properties to YAML Converter

A Kafka .properties file as YAML, a ConfigMap or a Strimzi resource. Dotted keys stay flat and every value is quoted, which are the two things a hand conversion gets wrong.

A ConfigMap gets the whole file in one block scalar key, because that is what a client mounts and reads. The Strimzi shape lists the settings the operator manages itself and rejects.

Paste below, or drop a file anywhere on this panel

Or drop a file anywhere on this panel. Nothing is uploaded: the analysis runs in this tab.

The answer appears here

Paste on the left and press Convert. Nothing leaves this tab.

Examples

Real input you can load into the tool above. Each one shows a different thing going wrong, because that is what the tool is for.

A JAAS line

A value containing quotes and a semicolon, which YAML must quote to survive

bootstrap.servers=broker:9092
security.protocol=SASL_SSL
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="a" password="b";

Plain settings

Dotted keys kept flat, because Kafka reads them as literal strings rather than nested

num.partitions=6
default.replication.factor=3
min.insync.replicas=2

Common mistakes

These are the ones that fail silently. The config is accepted, nothing raises an error, and the consequence arrives later.

  1. Nesting dotted keys in YAML

    Kafka reads bootstrap.servers as one literal key. Nesting it under bootstrap: servers: produces a key Kafka never looks up.

    Instead:Keep the keys flat and quoted.

  2. Leaving a JAAS value unquoted

    It contains spaces, quotes and a semicolon, all of which change meaning in YAML.

    Instead:Quote the whole value, and escape the inner quotes.

  3. Putting a password in a ConfigMap

    Anyone with get on the namespace reads it, and it appears in describe output.

    Instead:Use a Secret and reference it, or a config provider that resolves at startup.

Three ways this conversion goes wrong by hand

The keys, the quoting and the shape. Each produces a document that is valid YAML and is not the configuration you meant.

Dotted keys stay flat

num.partitions is one key whose name happens to contain a dot. It is not a path into a num mapping, and nesting it that way produces a completely different document that Kafka and Strimzi both ignore without complaint. This is the single most common mistake in hand-converting a properties file, because YAML makes nesting look like the natural thing to do with a dotted name.

Every value is quoted, with no exceptions

A ConfigMap's data and a Strimzi config block are both string maps. An unquoted 8080 becomes an integer and an unquoted true becomes a boolean, and the API server rejects the resource with a Go unmarshalling error that never names the key that caused it. Deciding case by case which values look like strings already is exactly how that error gets shipped, so everything is quoted.

A ConfigMap holds the whole file in one key

A client mounts a ConfigMap and reads a properties file, so the file has to arrive as a file. Splitting it into one key per setting produces a ConfigMap the application cannot read without reassembling it, which nothing does. The output uses a block scalar under a single kafka.properties key, with the original properties syntax inside rather than YAML.

Strimzi rejects the settings it manages itself

The operator generates the listeners, the node identity, the storage paths and the authorizer from the Kafka resource, so it refuses them in spec.kafka.config. The error names the setting without explaining that the intent belongs in spec.kafka.listeners, spec.kafka.storage or spec.kafka.authorization instead. Those settings are listed here when the Strimzi shape is selected.

What this cannot see

It converts a properties file faithfully and does not validate the settings themselves. A setting that is misspelled, deprecated or in the wrong unit converts exactly as written: the config upgrade checker and the unit converter on this site answer those. It also keeps only the effective value of a duplicated key, because a YAML mapping cannot hold a duplicate at all, and reports that it did.