Kubernetes YAML Generator

Generate a Kubernetes Deployment and Service manifest in your browser.

  • Runs locally in your browser
  • No upload required

Try it

Lowercase DNS-1123 label.

File
web.yaml
Selector
web
Content
# Generated in the browser — review this file and adapt it to your project before committing. apiVersion: apps/v1 kind: Deployment metadata: name: web namespace: default labels: app: web spec: replicas: 1 selector: matchLabels: app: web template: metadata: labels: app: web spec: containers: - name: web image: nginx:1.25 ports: - name: http containerPort: 80 resources: requests: cpu: 100m memory: 128Mi limits: cpu: 500m memory: 512Mi --- apiVersion: v1 kind: Service metadata: name: web namespace: default labels: app: web spec: type: ClusterIP selector: app: web ports: - name: http port: 80 targetPort: http
# Generated in the browser — review this file and adapt it to your project before committing.
apiVersion: apps/v1
kind: Deployment
metadata:
  name: web
  namespace: default
  labels:
    app: web
spec:
  replicas: 1
  selector:
    matchLabels:
    app: web
  template:
    metadata:
      labels:
    app: web
    spec:
      containers:
        - name: web
          image: nginx:1.25
          ports:
            - name: http
              containerPort: 80
          resources:
            requests:
              cpu: 100m
              memory: 128Mi
            limits:
              cpu: 500m
              memory: 512Mi
---
apiVersion: v1
kind: Service
metadata:
  name: web
  namespace: default
  labels:
    app: web
spec:
  type: ClusterIP
  selector:
    app: web
  ports:
    - name: http
      port: 80
      targetPort: http

Supported formats

Input
text
Output
text

Privacy

Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.

Processing
In your browser
Privacy level
Browser only

Generated a Deployment and Service for "web" with 53 line(s).

How it works

  • Wrote the Deployment metadata, labels and replica count.
  • Set the container image to "ghcr.io/example/web:1.4.0" and exposed port 3000.
  • Emitted a Service whose selector matches the Deployment labels.
  • The manifest is a starting point: review namespaces, probes, resources and policies for your cluster.
  • No network request is made; the YAML is assembled in this page.

Methodology

  1. Validate the name, namespace, image, replica count, port and environment keys.
  2. Assemble the Deployment object with matching pod and selector labels, then the Service object with the same selector.
  3. Join both documents with `---` and prepend a review header.

Usage

  1. Enter a DNS-1123 workload name and image.
  2. Set the replica count, container port, resources and optional environment variables.
  3. Choose a Service type and copy the generated manifests.

Examples

These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.

Node web service

jsonSelect to copy
{
  "name": "web",
  "namespace": "default",
  "image": "ghcr.io/example/web:1.4.0",
  "replicas": 2,
  "port": 3000,
  "containerPortName": "http",
  "env": "NODE_ENV=production\nPORT=3000",
  "cpuRequest": "100m",
  "cpuLimit": "500m",
  "memoryRequest": "128Mi",
  "memoryLimit": "512Mi",
  "serviceType": "ClusterIP"
}

Limitations

What the generated manifest includes

The Deployment carries the replica count, a pod template with the image and named container port, optional resource requests and limits, and optional environment entries. The Service selects the same `app` label.

Frequently asked questions

Is the manifest applied to a cluster?
No. The tool only assembles YAML in the page; run `kubectl apply --dry-run=client -f` yourself to check it.
Where do secrets go?
Never in this manifest. Reference a Secret with valueFrom and keep real values out of the generated file.

Sources

  1. Kubernetes API reference — Deployment — CNCF
  2. Kubernetes API reference — Service — CNCF