All Tools View Categories About Contact Privacy

Secret YAML Generator

Build a valid Kubernetes Secret manifest from key/value pairs - encode as base64 or keep as plaintext stringData.

Runs entirely in your browser - nothing is uploaded and no cluster connection is made.
0
data keys
0
labels
Your generated Secret YAML will appear here.

About Secret YAML Generator

A Secret is how Kubernetes carries sensitive material - passwords, API tokens, TLS certificates, SSH keys - into pods without baking it into images or committing it to source control. The Secret YAML Generator writes that manifest for you from a simple key/value form, so you never have to hand-encode base64 or remember the exact field names.

You give the Secret a name and, optionally, a namespace and labels, then pick a type. Opaque fits most cases; the other types describe a particular shape of data (TLS material, a docker config, basic-auth credentials, and so on). Then you add data entries - a key and its value - and choose how the value is written.

Two encodings are supported. With base64 (the data field), the value is encoded and written exactly as Kubernetes stores it. With plaintext (the stringData field), you type the real value and Kubernetes encodes it when the Secret is created. Multi-line values such as a private key or a full docker config JSON are emitted as YAML block scalars, so formatting is preserved. Names are validated as RFC 1123 labels and at least one data key is required before any YAML is produced.

The live preview updates as you type, with a small statistics strip showing how many data keys and labels the Secret carries. You can copy the manifest, download it as secret.yaml, or print it. Everything runs locally and nothing is uploaded, which is important precisely because the data here is sensitive.

Features

  • Key/value data entries - add as many rows as you need; each becomes a key in data or stringData.
  • Type selector - Opaque, kubernetes.io/tls, dockerconfigjson, basic-auth, ssh-auth, service-account-token and more.
  • base64 or stringData - encode values as base64 in data, or keep them as plaintext stringData.
  • Multi-line block scalars - private keys and JSON blobs are emitted as YAML pipe (|) block scalars.
  • Automatic quoting - values with special characters are quoted so the YAML stays valid.
  • Live YAML preview - updates as you type, with data/label counts.
  • Validation - RFC 1123 name and at least one data key required.
  • Copy / Download / Print - get secret.yaml wherever you need it.

How to Use

  1. Name the Secret. Type a valid RFC 1123 name and, optionally, a namespace.
  2. Pick a type. Use Opaque unless you are building a specific Secret shape.
  3. Choose encoding. base64 (data) or plaintext (stringData).
  4. Add data entries. For each, set a key and a value; multi-line values are fine.
  5. Watch the preview. The Secret YAML appears on the right.
  6. Fix any messages. Invalid names or missing keys are reported clearly.
  7. Export. Copy, download secret.yaml, or print.

Examples

Example 1 - base64 data. Key password with value s3cr3t produces datanswer: { password: czNjcjN0 }.

Example 2 - stringData. Same key with plaintext encoding produces stringDatanswer: { password: s3cr3t }.

Example 3 - TLS. Type kubernetes.io/tls with tls.crt and tls.key values yields a valid TLS Secret.

Example 4 - Multi-line key. A private key value is emitted as a pipe block scalar.

Example 5 - Namespaced. Setting namespace to staging scopes the Secret to that namespace.

Benefits

  • No image rebuilds - secrets live outside the image.
  • Correct encoding - base64 or stringData handled for you.
  • Multi-line safe - full keys and JSON preserved as block scalars.
  • Validated - names and required keys checked.
  • Clean output - empty fields omitted.
  • Private - everything runs in the browser.
  • Copy, download or print - get the manifest where you need it.

Frequently Asked Questions

What is a Kubernetes Secret?
A Secret holds sensitive data such as passwords, tokens and keys. Pods mount it as files or inject it as environment variables, keeping secrets out of your container images.
Should I use data (base64) or stringData?
Use base64-encoded data when you want the exact encoded form in the manifest. Use stringData to write values as plain text - Kubernetes base64-encodes them for you when the Secret is created.
Why is base64 not encryption?
base64 is only encoding, not encryption. Anyone with the manifest can decode it. Restrict access to the Secret with RBAC and consider encryption at rest.
Which type should I pick?
Opaque is the general purpose default. Choose kubernetes.io/tls for certificates (tls.crt, tls.key), kubernetes.io/dockerconfigjson for image pull secrets, and the others for their specific key sets.
Is the name validated?
Yes. The Secret name must be a valid RFC 1123 label (lowercase letters, numbers and hyphens).
Does this upload my secret?
No. Everything is assembled in your browser and nothing leaves the page.
Can I download it?
Yes. Copy the YAML, download secret.yaml, or print it.