Skip to main content
Back to Dev generators

Dev

Kubernetes Deployment YAML Generator

Kubernetes YAML is verbose, indentation-sensitive, and easy to misconfigure — a label mismatch between a Deployment's selector and its pod template means the Deployment never manages any pods, and the error message does not make that obvious. This generator produces a correctly wired Deployment and Service manifest from two inputs. Enter the app name — lower-cased and converted to a valid Kubernetes name using hyphens — and set the replica count (1–20). The Deployment wires matchLabels, pod template labels, and container name to the same app label. The container exposes port 8080, declares CPU and memory requests (100m / 128Mi) and limits (500m / 256Mi). The Service routes traffic from port 80 to 8080 using the same label. Save as a .yaml file, replace the image with your real registry path, adjust the port and resource sizes, then run kubectl apply -f.

Read the complete guide — 4 min read

How to use

  1. Choose your options above
  2. Click Generate
  3. Copy your result

Detailed instructions

  1. Enter your app name.
  2. Set the number of replicas.
  3. Click Generate to produce the manifest.
  4. Swap in your image and run kubectl apply -f.

Use Cases

  • Scaffolding a new Kubernetes workload
  • Learning how a Deployment and Service fit together
  • Avoiding YAML indentation errors that break kubectl
  • Setting sensible resource requests and limits
  • Standardising manifests across services

Tips

  • Pin a real image tag rather than latest for reproducible rollouts.
  • Add readiness and liveness probes before going to production.
  • Keep requests realistic so the scheduler can pack nodes well.
  • Store manifests in git so changes are reviewable.

FAQ

why do the Deployment selector and pod template labels need to match

The Deployment's spec.selector.matchLabels tells Kubernetes which pods belong to this Deployment. The pod template's labels must match that selector, or the Deployment will not manage any pods it creates. The generator uses the same label value in both places.

why are resource requests and limits included

Requests let the scheduler place pods on nodes with enough capacity; limits prevent a runaway container from consuming all node resources and starving neighbours. Declaring both is a cluster best practice and required by some environments with LimitRange policies.

what do I change before applying the manifest

Replace the container image with your real registry path and tag, set containerPort to the port your app listens on, and adjust resource requests and limits to your workload. The Service port mapping (80 to 8080) may also need adjustment.

what is the difference between a Deployment and a Service

A Deployment manages pod lifecycle — how many run, how they roll out, and how they restart. A Service provides a stable network address that routes traffic to those pods regardless of which specific instances are running. The generator produces both so traffic can reach your app.

You might also like

Popular tools from other categories that share themes with this one.

Try these next

More free tools from other corners of the catalog, picked by shared themes.