Skip to content
Opsfolk

Kubernetes YAML generator

Fill in a form and get YAML you can apply: a Deployment, StatefulSet or DaemonSet, with checks under every field. Nothing you type leaves your browser.

Workload

metadata.name

Names every resource of the app. Lowercase letters, digits and dashes, starting with a letter, 63 characters at most.

metadata.namespace

Where the app lives. Left empty, it goes wherever kubectl points.

Less common settings are under .

  1. web

    name

    Unique in the pod. Lowercase letters, digits and dashes.

    image

    A registry, a repository and a tag. Pin a tag, or a digest, rather than latest.

    initContainers

    Init containers run to completion before the others start; a sidecar starts first and keeps running beside them.

    Portsports

    What the container listens on. A name lets probes and Services refer to the port.

    Environment variablesenv

    A value typed here, a key of a ConfigMap or Secret, or a field of the pod.

    resources.requests.cpu

    What the scheduler reserves: 250m is a quarter of a core.

    resources.requests.memory

    What the scheduler reserves, as 128Mi or 1Gi.

    resources.limits.memory

    Above it the container is killed and restarted.

    readinessProbe

    While it fails, the pod gets no traffic from a Service. Nothing is restarted.

    handler

    An HTTP GET, a TCP connection, a command in the container, or a gRPC health check.

    port

    A port number, or the name of one of the container's ports.

    httpGet.path

    The path to request. A status from 200 to 399 passes.

    periodSeconds

    Seconds between two checks.

    livenessProbe

    When it fails often enough, the container is restarted. Check that the process is alive, not its dependencies.

    handler

    An HTTP GET, a TCP connection, a command in the container, or a gRPC health check.

    port

    A port number, or the name of one of the container's ports.

    httpGet.path

    The path to request. A status from 200 to 399 passes.

    periodSeconds

    Seconds between two checks.

    Volume mountsvolumeMounts

    Where a volume appears in the container's filesystem.

    Commandcommand

    Replaces the image's ENTRYPOINT. One item per argument, with no shell around it.

    Argumentsargs

    Replaces the image's CMD: what the command is given.

    securityContext.allowPrivilegeEscalation

    Whether a process can gain more privileges than its parent, through setuid binaries. Set it to No.

    securityContext.readOnlyRootFilesystem

    Nothing can write to the image's files; mount an emptyDir where the app needs to write.

    Drop capabilitiessecurityContext.capabilities.drop

    Linux capabilities to remove. ALL removes every one; add back only what the app needs.

A sidecar is an init container that keeps running beside the others, for Kubernetes 1.29 and later. Sidecar containers

Less common settings are under .

Field names follow the Kubernetes API. The pod's API reference

my-app.yaml

apiVersion: apps/v1kind: Deploymentmetadata:  name: my-app  labels:    app.kubernetes.io/name: my-appspec:  replicas: 2  selector:    matchLabels:      app.kubernetes.io/name: my-app  template:    metadata:      labels:        app.kubernetes.io/name: my-app    spec:      securityContext:        runAsNonRoot: true        seccompProfile:          type: RuntimeDefault      containers:        - name: web          image: nginxinc/nginx-unprivileged:1.28-alpine          ports:            - name: http              containerPort: 8080          resources:            requests:              cpu: 100m              memory: 128Mi            limits:              memory: 256Mi          volumeMounts:            - name: tmp              mountPath: /tmp          readinessProbe:            httpGet:              path: /              port: http            periodSeconds: 5          livenessProbe:            httpGet:              path: /              port: http            periodSeconds: 10          securityContext:            allowPrivilegeEscalation: false            readOnlyRootFilesystem: true            capabilities:              drop:                - ALL      volumes:        - name: tmp          emptyDir: {}
No errors found.
No errors

How to use it

  1. Pick the workload: a Deployment for most apps, a StatefulSet when each pod keeps its own data, a DaemonSet for one pod on every node.
  2. Fill in the App and Containers cards. The common fields show first; All fields shows every one.
  3. Fix what is marked: each message says what Kubernetes expects.
  4. Copy or download the YAML, check it against your cluster with kubectl apply --dry-run=server -f my-app.yaml, then apply it.

FAQ

Will my cluster accept this YAML?

It is written for Kubernetes 1.29 and later, with stable APIs only, and every field is checked against the rules the API server applies: names, labels, ports, quantities, and references between fields. What the page cannot know is your cluster: whether a storage class, a priority class or an image exists there.

Before you apply it, let the cluster check it too: kubectl apply --dry-run=server -f my-app.yaml.

Does anything I type leave my browser?

No. The YAML is written in the page, and your draft is kept in this browser's storage so it is here when you come back. No request carries what you type, and Start over replaces the draft.

Why does the selector hold one label only?

A Deployment's, StatefulSet's or DaemonSet's selector cannot change after the first apply. It holds app.kubernetes.io/name alone, so you can add, rename and remove every other label later without deleting the workload.

Why are some values in quotes?

kubectl reads YAML 1.1, where yes, on and no are booleans and 1.10 is the number 1.1. A label, an annotation or an environment variable is always a string, so any value a reader could take for something else is quoted.

Why is the file mode a decimal number?

You type it in octal, as 0644. YAML 1.1 reads 0644 as octal and YAML 1.2 as decimal, so the generator writes the number both agree on: 420.

Where are Services, Ingresses and ConfigMaps?

On their way. For now the generator writes the workload: the Deployment, StatefulSet or DaemonSet and everything in its pods.

Learn Kubernetes on Opsfolk