Kubernetes Deployment Generator

Build a Deployment and see the capacity envelope your rollout settings actually produce, drawn to scale. The output is checked by our own validator as you type.

Workload
Rollout

How replacing pods behaves during a deploy. These are the fields that decide whether a deploy is invisible or an outage.

Adds a topologySpreadConstraint. Without one the scheduler may put every replica in one zone.

Resources

deployment.yaml

updates as you type

    Common mistakes

    These are the ones that fail silently. The config is accepted, nothing raises an error, and the consequence arrives later.

    1. Leaving the default rolling update strategy on a small deployment

      25% of 2 replicas rounds to 1, so half the capacity can be gone during a rollout.

      Instead:Set maxUnavailable to 0 with maxSurge 1 where capacity matters.

    2. Omitting resource requests

      The pod becomes BestEffort, first to be evicted and last for CPU under contention.

      Instead:Set requests at minimum. That alone moves it to Burstable.

    3. Setting replicas in the manifest while an HPA manages it

      They fight: the HPA scales up and the next apply scales back down.

      Instead:Remove replicas from the manifest once an HPA owns it.

    What a Deployment does during a deploy

    A Deployment is a controller that manages ReplicaSets, and a rollout is one ReplicaSet scaling up while another scales down. Everything that goes wrong during a deploy is one of the numbers governing how fast that happens.

    maxSurge and maxUnavailable round in opposite directions

    Both accept a number or a percentage, and the rounding is not symmetric: maxSurge rounds up so there is always a spare slot, maxUnavailable rounds down so the dip is never bigger than asked for. Both directions protect availability, and reading them as the same rule is how 25% on three replicas surprises people.

    replicas: 3, maxSurge: 25%, maxUnavailable: 25%
    
      maxSurge       ceil(0.75) = 1 extra pod
      maxUnavailable floor(0.75) = 0 may be down
    
      so capacity during the deploy: 3 to 4, never below 3
    
    replicas: 10, both 25%
      surge 3, unavailable 2  -> capacity 8 to 13

    spec.selector is immutable, and that is a one-way door

    It is required, and once the Deployment exists it cannot be changed. Adding or renaming a label in the selector means deleting and recreating the Deployment, which means downtime unless you plan around it. This is why the selector should be one stable label, not a copy of every label on the pod.

    selector:
      matchLabels:
        app.kubernetes.io/name: api    <- pick one, keep it
    
    # not this:
    selector:
      matchLabels:
        app: api
        version: v1.2.3    <- now every release needs a
                              delete and recreate

    A failed rollout does not roll back

    progressDeadlineSeconds decides when a stalled rollout is marked Failed. That is all it does. The Deployment sits with both ReplicaSets present, the old pods still serving, and the new ones still crashing, until a person runs kubectl rollout undo. Nothing is automatic, and nothing alerts.

    kubectl rollout status deploy/api
    error: deployment "api" exceeded its progress deadline
    
    kubectl rollout undo deploy/api    # the manual step
    
    # CI that runs `rollout status` and fails the build is
    # what turns this into something you find out about.

    minReadySeconds is what catches a pod that lies

    Without it, a pod counts as available the instant its readiness probe passes once. A container that starts, passes one probe and then crashes still lets the rollout move on to the next pod, so a broken build can roll all the way out. minReadySeconds makes the rollout wait and watch.

    minReadySeconds: 10
    
    # the pod has to stay Ready for 10 seconds before it
    # counts. A crash at t+3 stops the rollout with most
    # of the old ReplicaSet still up and serving.

    Replica count is not availability

    Nothing stops the scheduler placing every replica on one node. Three replicas on one node is one node failure away from zero. A topology spread constraint fixes it, and the strict form leaves pods Pending forever on a single-zone cluster, so ScheduleAnyway is the safer default.

    topologySpreadConstraints:
      - maxSkew: 1
        topologyKey: topology.kubernetes.io/zone
        whenUnsatisfiable: ScheduleAnyway
        labelSelector: {matchLabels: {...}}
    
    # DoNotSchedule is stricter and correct in production
    # across real zones. On a one-zone test cluster it
    # leaves pods Pending with an unhelpful event.

    More kubernetes tools

    Kubernetes YAML Generator Answer a few questions, get a manifest Kubernetes YAML Validator Is this YAML valid, and where is it wrong? Kubernetes Rollout & Probe Timing Restart loops, capacity dips and stuck drains Kubernetes Service Checker Will this Service have any endpoints? Kubernetes Network Policy Viewer What can reach what, and what just broke Kubernetes Manifest Diff What actually changed Kubernetes Resource Calculator What these manifests actually reserve Kubernetes RBAC Viewer Who can actually do what Kubernetes Service Generator port, targetPort, and which one you meant Kubernetes StatefulSet Generator Stable names, and volumes that outlive you Kubernetes QoS Class Calculator And where you sit in the eviction order Kubernetes Node Capacity Planner Allocatable is not capacity Kubernetes Max Pods per Node Calculator The ENI limit, not the 110 default Kubernetes Label Selector Tester Which key failed, not just that one did Kubernetes Taint & Toleration Tester Tolerations permit, they do not attract Kubernetes Resource Name Validator RFC 1123 subdomain, label, or 1035 Kubernetes Label & Annotation Validator Why your image tag is not a legal label Kubernetes CrashLoopBackOff Guide The status is a timer, not a cause Kubernetes TLS Certificate Decoder When it expires, and what it covers Kubernetes ServiceAccount Token Decoder Bound or legacy, and when it dies Kubernetes imagePullSecret Generator The registry URL nobody gets right Kubernetes cert-manager Certificates Issuer scope, and the rate limit that costs a week Kubernetes Flux HelmRelease Generator With the source it cannot work without Kubernetes Helm Chart Generator Chart.yaml, values, and working templates Kubernetes Argo CD Application Generator The defaults that are off, turned on Kubernetes Ingress Generator pathType, and the TLS secret that fails quietly Kubernetes HPA Generator Why it says unknown and never scales Kubernetes SecurityContext Generator Pod level, container level, and which wins Kubernetes Probe Generator How long it gets to start before liveness kills it Kubernetes PVC Generator Access modes your storage can actually do Kubernetes ResourceQuota Generator And the LimitRange that stops it breaking deploys Kubernetes CronJob Generator The fields that decide whether it runs Kubernetes NetworkPolicy Generator With the DNS rule already in it Kubernetes RBAC Generator And what it actually grants Kubernetes PodDisruptionBudget Generator Can this budget ever be satisfied? Kubernetes API Deprecation Checker What breaks on the next upgrade Kubernetes Kubeconfig Viewer Read it without handing it to anyone Kubernetes Quantity Parser What 512Mi, 100m and 1e3 actually mean Kubernetes Multi-Document YAML Splitter One file per object, in apply order Kubernetes .env to ConfigMap & Secret Split the credentials out on the way Kubernetes Secret Decoder See what is actually in there Kubernetes Ingress to Gateway API Which annotations silently stop working Kubernetes Manifest Visualizer What points at what, and what points at nothing Kubernetes Patch Tester Which --type, and what it deletes Kubernetes kubectl JSONPath Tester kubectl's dialect, not generic JSONPath Kubernetes Node Affinity Tester Required excludes, preferred only scores Kubernetes Helm Values Diff A missing key is a third value Kubernetes Pod and Service CIDR Fixed at cluster creation Kubernetes Secret Encoder base64 is not encryption Kubernetes API Version Checker Will this apply on that cluster Kubernetes Go Template Tester Go truthiness is not JavaScript's Kubernetes Cluster Cost Estimator At your rates, not a price table Kubernetes Kustomize Build Transformers run in kustomize's order Kubernetes Helm Chart Validator version is SemVer, appVersion is not

    Elsewhere on the site