Developer Tools
Kubernetes Deployment Generator
Generate apply-ready Kubernetes Deployment YAML from an image, replicas, ports, and resources. Adds a matching Service, rolling update strategy, and probes.
Deployment
Identity
DNS-1123 label. Used for the name, the app.kubernetes.io/name label, the selector, and the Service.
Leave blank to apply into the current namespace.
Rollout
Replicas and update strategy
Extra pods allowed above the desired count during a rollout. A number or a percentage.
Pods allowed to be down during a rollout. A number or a percentage.
Container
Image, port, and environment
Use an explicit tag or a digest, not latest.
The port the app listens on. Leave blank if it does not serve traffic.
Probes use the container port above. Disable if the app has no HTTP health endpoint.
Quantities use Kubernetes units: m for milli-CPU, Mi and Gi for mebibytes and gibibytes. Leave a field blank to omit it.
Service
Expose the pods (optional)
The port the Service listens on.
The container port traffic is forwarded to.
Output
deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: web
labels:
app.kubernetes.io/name: web
spec:
replicas: 3
revisionHistoryLimit: 10
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
selector:
matchLabels:
app.kubernetes.io/name: web
template:
metadata:
labels:
app.kubernetes.io/name: web
spec:
containers:
- name: web
image: nginx:1.27
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
env:
- name: LOG_LEVEL
value: info
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 256Mi
livenessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: 10
periodSeconds: 10
readinessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: 5
periodSeconds: 10
---
apiVersion: v1
kind: Service
metadata:
name: web
labels:
app.kubernetes.io/name: web
spec:
type: ClusterIP
selector:
app.kubernetes.io/name: web
ports:
- port: 80
targetPort: 80
protocol: TCP
kubectl
Apply and watch the rollout
Apply the manifest
kubectl apply -f web.yaml
Watch the rollout finish
kubectl rollout status deployment/web
How the labels tie together
- The same app.kubernetes.io/name label is written into the Deployment selector, the pod template, and the Service selector, so all three always match.
- A Deployment whose selector.matchLabels does not match its pod template labels is rejected by the API server. Keeping them linked avoids that error.
- A Service routes to pods by label, not by name. If the selector matched nothing, the Service would have no endpoints and requests would hang.
- The selector is immutable after creation, so changing the name later means deleting and recreating the Deployment.
Fields that keep rollouts safe
- RollingUpdate with maxSurge and maxUnavailable controls how many pods move at once during an update.
- readinessProbe keeps traffic away from a pod until it is ready, so a rollout does not send requests to a starting container.
- livenessProbe lets the kubelet restart a pod that has hung without exiting.
- Resource requests drive scheduling and limits cap usage so one pod cannot starve a node.
How to use
- Enter a name and the container image. Use an explicit tag or digest rather than latest so rollouts stay reproducible.
- Set the number of replicas and choose an update strategy. RollingUpdate keeps the app available during a rollout; Recreate swaps all pods at once.
- Add the container port, environment variables, and CPU and memory requests and limits. Keep liveness and readiness probes on if the app serves an HTTP health path.
- Optionally add a Service. Pick ClusterIP for internal access, NodePort for local clusters, or LoadBalancer for a cloud external IP, then set the port and targetPort.
- Watch the validation panel for errors and warnings, then copy the generated deployment.yaml and run the kubectl apply and rollout status commands shown below.
About this tool
Kubernetes Deployment Generator turns a container image plus a handful of common settings into a complete, apply-ready Deployment manifest (apiVersion: apps/v1, kind: Deployment), and optionally a matching Service (apiVersion: v1, kind: Service) written into the same multi-document YAML file. The output is the full document in the same shape kubectl emits, so you can save it and run kubectl apply -f deployment.yaml without fixing indentation by hand. It is built for the everyday task of getting a stateless service onto a cluster: a web app, an API, a worker that also serves health checks. The form covers the fields that matter most. On the Deployment side that is replicas, revisionHistoryLimit, minReadySeconds, and the update strategy, with RollingUpdate exposing maxSurge and maxUnavailable as a number or a percentage, or Recreate when you cannot run two versions at once. On the container side it is the image, an optional imagePullPolicy, a containerPort, environment variables, CPU and memory requests and limits in Kubernetes quantity units, and optional HTTP liveness and readiness probes that reuse the container port. The single most common Deployment mistake is a selector that does not match the pod template, which the API server rejects, or a Service selector that matches nothing, which silently routes to zero endpoints; this tool writes the same app.kubernetes.io/name label into the Deployment selector, the pod template, and the Service selector from one source, so the three always agree. The Service section is optional: choose No Service to emit the Deployment alone, or pick ClusterIP, NodePort, or LoadBalancer and set the port, targetPort, and (for NodePort) an optional nodePort in the 30000 to 32767 range. The YAML is produced by a deterministic writer that only quotes the scalar values YAML requires, such as the empty string, leading-indicator characters, or strings that would otherwise parse as numbers or booleans, which keeps the output readable and stable. Validation runs continuously with error, warning, and informational levels: the name, namespace, and container name are checked against the DNS-1123 label rules, an untagged or latest image is flagged as non-reproducible, replicas and the numeric fields are range-checked, maxSurge and maxUnavailable cannot both be zero (which would stall every rollout), resource quantities are sanity-checked, missing limits and an empty probe port raise gentle reminders, and the Service ports and nodePort range are verified. Ready-to-run kubectl snippets for applying the manifest and watching the rollout finish are generated alongside the YAML. Everything is computed in your browser, so the image, ports, environment values, and labels you enter are never uploaded, logged, or sent anywhere.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
Kubernetes CronJob Generator
Build an apply-ready batch/v1 CronJob manifest from a schedule, image, and command.
Open tool
DeveloperDockerfile Generator
Build a production Dockerfile with multi-stage build, non-root user, BuildKit cache, and healthcheck.
Open tool
DeveloperDocker Compose Generator
Build a multi-service docker-compose.yml with templates and live validation.
Open tool
DeveloperNginx Config Generator
Build a production nginx server block with modern TLS, HTTP/2, HSTS, gzip, and proxy headers.
Open tool
DeveloperYAML Formatter
Pretty print and validate YAML with consistent indent, sorted keys, and clear errors.
Open tool
DeveloperYAML Validator
Strict YAML validation with line and column errors and human-readable hints.
Open tool