Kubernetes ConfigMap & Secret Generator
Generate a valid Kubernetes ConfigMap or Secret YAML manifest from a name, optional namespace, labels and KEY=value pairs. Secrets support base64-encoded data: or plain-text stringData: and selectable types (Opaque, TLS, dockerconfigjson, …). Runs entirely in your browser — secret values never leave the page.
Input
metadata.name — lowercase letters, digits, '-' and '.' (RFC 1123).
Optional. Leave empty to omit metadata.namespace and use your current kubectl context.
One KEY=value (or KEY: value) per line. Only the first separator splits the pair, so values may contain ':'/'='. Use \n in a value for a multi-line block.
Optional. One key=value per line, added under metadata.labels.
Adds immutable: true. Recommended for Secrets/ConfigMaps that never change.
Output
Guides
Hand-writing Kubernetes manifests is fiddly: one wrong indent, an unquoted true
that YAML reads as a boolean, or a Secret value you forgot to base64-encode, and
kubectl apply rejects the file. This generator builds a valid apiVersion: v1
ConfigMap or Secret for you from a simple list of key/value pairs — with
correct indentation, quoting, and base64 encoding handled automatically.
What it does
Pick a resource type, give it a name and (optionally) a namespace and labels,
then paste your configuration as KEY=value or KEY: value pairs, one per line.
The tool emits ready-to-apply YAML:
- ConfigMap —
kind: ConfigMapwith your pairs underdata:as plain strings, quoted only when a value would otherwise be ambiguous (numbers, booleans, values containing:or#, etc.). - Secret —
kind: Secretwith a selectabletype(Opaque,kubernetes.io/tls,kubernetes.io/dockerconfigjson, and more) and your choice ofdata:(base64-encoded) orstringData:(plain text).
How to use it
- Choose ConfigMap or Secret.
- Enter a Name (lowercase RFC 1123 — letters, digits,
-,.) and an optional Namespace. - For a Secret, choose the type and whether values go in
data:orstringData:. - Add your pairs in the Key / Value Data box. Only the first
=/:on a line splits the pair, so a value likepostgres://user:pass@db:5432/appkeeps its own colons. Need a multi-line value (a config file, a certificate)? Write\nwhere the line breaks should go and the tool emits a YAML literal block scalar (|-). - Optionally add labels and toggle immutable.
- Copy or download the generated manifest.
What's the difference between data and stringData?
This is the part that trips people up. A Kubernetes Secret ultimately stores every value base64-encoded. The two fields are just two ways to give it those values:
data:expects values that are already base64-encoded. This tool encodes them for you, sopassword=s3cr3tbecomespassword: czNjcjN0. This is the canonical on-disk form you'll see when you runkubectl get secret -o yaml.stringData:takes plain-text values. When you apply the manifest,kubectl(really the API server) base64-encodes them for you and merges them intodata. It's a write-only convenience field — it never appears when you read the Secret back.
Use stringData when you want a human-readable manifest; use data when you want
the exact stored representation. Either way the Secret behaves identically once
applied.
Is base64 encryption?
No. Base64 is encoding, not encryption — anyone can decode it instantly. A Kubernetes Secret is not encrypted at rest unless your cluster is configured for encryption at rest. Treat the output as sensitive and never commit real Secret manifests to a public repository.
Why is my value quoted / turned into a block?
To keep the YAML unambiguous. A value that looks like a number (1024), a boolean
(true), or that contains YAML-significant characters (:, #, @, leading
spaces) is double-quoted so it's read as a string. Values containing newlines are
written as a literal block scalar so whitespace is preserved exactly.
What does "immutable" do?
Adding immutable: true marks the resource so it cannot be updated after
creation — you'd delete and recreate it to change it. It's recommended for
Secrets and ConfigMaps that never change: it protects against accidental updates
and reduces load on the kubelet, which stops watching immutable objects.
Privacy
Everything runs entirely in your browser. Your names, labels, and — most importantly — your Secret values are never uploaded, logged, or sent to any server. The generation, base64 encoding, and YAML formatting all happen locally on your device, so it's safe to paste sensitive configuration.