09 / DevOps / kubernetes-yaml

Kubernetes YAML Tools

Generate Deployment, Service, ConfigMap and Secret YAML.

ReadyLocal processing
09 · Workspace

How to use

  1. 01Enter the Name, Namespace and container Image, then set Replicas, Container port and Service port.
  2. 02Add KEY=value lines under Environment / ConfigMap and list key names under Secret keys.
  3. 03Tick the resources to generate: Deployment, Service, ConfigMap and Secret, and choose a Service type (ClusterIP, NodePort or LoadBalancer).
  4. 04Review the multi-document YAML in the Kubernetes manifests panel, then Copy it or Download .yaml.
  5. 05Paste any YAML into Validate manifests to check syntax and required fields, or leave it empty to validate the generated output.

What is this tool?

Kubernetes YAML Tools generates a consistent set of manifests for one application: a Deployment, a Service, a ConfigMap and an optional Secret template, all linked by the same app label. It also includes a lightweight validator that parses multi-document YAML and flags missing apiVersion, kind or metadata.name. It is a fast way to start a manifest without copying boilerplate from old projects, and everything runs in your browser.

Deployment vs Service in Kubernetes

A Deployment keeps a set number of identical pods running and replaces them during rollouts. A Service gives those pods a stable network address, because individual pod IPs change whenever pods are recreated. The two are connected by labels, not by name: the generated Deployment labels its pods app: <name>, uses the same label in spec.selector.matchLabels, and the Service selects pods with that label.

The Service forwards its port to the container's targetPort. For example, with Service port 80 and Container port 8080, other pods reach the app at orders-api:80 and traffic arrives on 8080 inside the container. ClusterIP exposes it only inside the cluster, NodePort also opens a port on every node, and LoadBalancer asks the cloud provider for an external load balancer.

ConfigMap vs Secret for environment variables

When ConfigMap is ticked, your KEY=value lines become a ConfigMap named <name>-config, and the Deployment loads every key with envFrom.configMapRef. When Secret is ticked, each listed key goes into an Opaque Secret named <name>-secret with a REPLACE_ME placeholder in stringData, loaded through envFrom.secretRef. If ConfigMap is unchecked, the variables are written inline as env entries on the container instead.

Secrets are only base64-encoded when stored, not encrypted, so the generated Secret is a template. Keep real credentials in a secret manager or a tool such as Sealed Secrets rather than committing them.

Resource requests and limits in the generated Deployment

The container is given starter resources: requests of 100m CPU and 128Mi memory, and limits of 500m CPU and 256Mi memory. Requests are what the scheduler reserves when placing a pod; limits cap what the container can use, and exceeding the memory limit gets the container killed. Tune these values from real usage before production.

The Validate manifests panel parses every document separated by --- and reports YAML syntax errors per document, plus any document missing apiVersion, kind or metadata.name. It is a quick sanity check before running kubectl, not a full schema validation.

Common use cases

  • Scaffolding manifests for a new microservice in a consistent label and naming style
  • Creating a quick Deployment and Service for a QA or preview namespace
  • Producing a Secret template with the right keys without exposing real values
  • Checking a pasted multi-document manifest for YAML errors and missing metadata.name

FAQ

What is the difference between port and targetPort in a Kubernetes Service?

port is what clients connect to on the Service; targetPort is the port on the container that receives the traffic.

When should I use ClusterIP, NodePort or LoadBalancer?

ClusterIP for internal-only services, NodePort to expose a port on each node, and LoadBalancer for an external cloud load balancer.

Does the validator check my manifest against the Kubernetes schema?

No. It checks YAML syntax and that each document has apiVersion, kind and metadata.name. Use kubectl apply --dry-run=server for full validation.

Are Kubernetes Secrets encrypted?

Not by default. Secret values are base64-encoded, which anyone with read access can decode, so use a secret manager for real credentials.

How do I apply the generated YAML?

Download the .yaml file and run kubectl apply -f with that file. All resources are in one file separated by ---.