Kubernetes Deployment YAML Generator & Manifest Builder

Kubernetes Deployment YAML Generator & Manifest Builder

Create production-ready Kubernetes Deployment manifests with pod replicas, resource limits, health probes, and rolling update strategies.

Presets:
Input
Max pods above desired replica count
Set to 0 for 100% zero-downtime rollouts
:
:
:
apiVersion: apps/v1
kind: Deployment
metadata:
  name: web-api-gateway
  namespace: production
  labels:
    app: "web-api-gateway"
    tier: "backend"
    env: "production"
  annotations:
    prometheus.io/scrape: "true"
    prometheus.io/port: "8080"
    prometheus.io/path: "/metrics"
spec:
  replicas: 3
  selector:
    matchLabels:
      app: "web-api-gateway"
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 0
  minReadySeconds: 5
  template:
    metadata:
      labels:
        app: "web-api-gateway"
        tier: "backend"
        env: "production"
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "8080"
        prometheus.io/path: "/metrics"
    spec:
      serviceAccountName: web-api-sa
      securityContext:
        runAsNonRoot: true
        runAsUser: 10001
        runAsGroup: 10001
      containers:
      - name: api-server
        image: ghcr.io/acme-corp/api-gateway:v2.4.1
        imagePullPolicy: IfNotPresent
        ports:
        - name: http
          containerPort: 8080
          protocol: TCP
        - name: metrics
          containerPort: 9090
          protocol: TCP
        securityContext:
          readOnlyRootFilesystem: true
          allowPrivilegeEscalation: false
          capabilities:
            drop:
            - ALL
        resources:
          requests:
            cpu: "250m"
            memory: "256Mi"
            ephemeral-storage: "50Mi"
          limits:
            cpu: "1000m"
            memory: "512Mi"
            ephemeral-storage: "200Mi"
        livenessProbe:
          httpGet:
            path: /healthz
            port: 8080
          initialDelaySeconds: 15
          periodSeconds: 10
          timeoutSeconds: 3
          successThreshold: 1
          failureThreshold: 3
        readinessProbe:
          httpGet:
            path: /ready
            port: 8080
          initialDelaySeconds: 5
          periodSeconds: 5
          timeoutSeconds: 2
          successThreshold: 1
          failureThreshold: 2
        env:
        - name: NODE_ENV
          value: "production"
        - name: PORT
          value: "8080"
        - name: DB_PASSWORD
          valueFrom:
            secretKeyRef:
              name: db-credentials
              key: password
        - name: CONFIG_JSON
          valueFrom:
            configMapKeyRef:
              name: app-config
              key: settings.json
        volumeMounts:
        - name: tmp-cache
          mountPath: /tmp
      volumes:
      - name: tmp-cache
        emptyDir: {}
      nodeSelector:
        kubernetes.io/os: "linux"
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - weight: 100
            podAffinityTerm:
              labelSelector:
                matchExpressions:
                - key: app
                  operator: In
                  values:
                  - "web-api-gateway"
              topologyKey: "kubernetes.io/hostname"
Replicas & Rollout StrategyRollingUpdate
3 Pod Replicas

Surge: 25% | Max Unavailable: 0

Resource Quotas & AllocationGuaranteed
CPU: 250m / 1000m

Mem: 256Mi / 512Mi

Production & Security ScoreGrade A+
100 / 100 Readiness

Probes: 2 /3 active

Zero-Knowledge Local Execution

All data processing, parsing, and compilation execute strictly inside your local browser memory. Zero external server uploads.

Sub-Millisecond AST Engine

All data payloads remain strictly local with zero external server communication.

Production Ready Export

Clean, optimized output formats ready for immediate deployment.

Technical Reference & Architecture Guide

Kubernetes Deployment YAML Generator & Manifest Builder — Reference Guide

Create production-ready Kubernetes Deployment manifests with pod replicas, resource limits, health probes, and rolling update strategies.

Key Parameters & Controls

spec.replicasinteger

Number of desired pod instances to run concurrently across worker nodes.

Default: 1
spec.template.spec.containers[*].imagestring

Docker or OCI container image repository and tag (e.g., 'nginx:1.25-alpine').

Default: Required
spec.template.spec.containers[*].resourcesobject

CPU and memory requests (guaranteed allocation) and limits (maximum cap before throttling or OOMKill).

Default: Optional (Recommended)
spec.strategyobject

Deployment update strategy (RollingUpdate with maxSurge and maxUnavailable, or Recreate).

Default: RollingUpdate
spec.template.spec.containers[*].livenessProbeobject

Health check probe triggering automated pod restart upon application deadlock or crash.

Default: Optional

Pro Tips & Best Practices

Define requests to guarantee node

Define requests to guarantee node scheduler placement and limits to protect cluster nodes from runaway memory leaks. Setting memory requests equal to limits establishes the Guaranteed QoS class.

For high-availability web services

For high-availability web services, configure maxUnavailable: 0 and maxSurge: 25% (or 1) to ensure zero dropped HTTP connections during rolling updates.

Decouple Liveness from Readiness Probes

Use readiness probes for dependency and warmup checks (e.g., database connectivity), and reserve liveness probes strictly for unrecoverable deadlocks to avoid cascading restart storms.

Always specify immutable semantic

Always specify immutable semantic version tags or SHA-256 digests in container images to guarantee reproducible deployments and dependable rollbacks.

Common Gotchas & Troubleshooting

CrashLoopBackOff or OOMKilled with exit code 137

The container exceeds memory boundaries or crashes on launch. Run kubectl describe pod <name> and kubectl logs <name> --previous; increase resources.limits.memory or debug container startup commands.

Rolling update stalled with new pods stuck in Pending

Worker nodes lack sufficient allocatable capacity to satisfy resources.requests. Inspect nodes with kubectl describe nodes, lower CPU/memory requests, or activate cluster autoscaling.

Selector immutability error when applying updated manifest

Kubernetes prohibits modifying spec.selector on existing deployments. Delete the deployment without terminating pods using kubectl delete deploy <name> --cascade=orphan and re-apply, or retain original matchLabels.

Frequently Asked Questions

What is the difference between a Kubernetes Deployment, StatefulSet, and DaemonSet?▼

A Deployment manages interchangeable, stateless workloads. A StatefulSet manages stateful pods requiring persistent network identities and ordered disk storage. A DaemonSet guarantees that exactly one replica runs across all eligible cluster nodes.

Why should I use RollingUpdate instead of the Recreate strategy?▼

RollingUpdate spins up new pod instances incrementally and verifies readiness before terminating old pods, guaranteeing zero downtime. Recreate terminates all existing pods simultaneously before creating new ones, causing immediate service interruption.

How does Kubernetes match Pods to a Deployment controller?▼

Deployments use label selectors (spec.selector.matchLabels). The controller continually reconciles the cluster state by tracking pods whose template labels (spec.template.metadata.labels) match these key-value pairs.

How do Pod Disruption Budgets (PDB) protect Deployment replicas?▼

While a Deployment defines target replica counts, a Pod Disruption Budget (PDB) enforces the minimum available pods or maximum disruptions permitted during voluntary cluster maintenance operations like node drains and node upgrades.

Related Tools & Utilities

All Tools →