1. Home
  2. Developer tools
  3. Kubernetes YAML Generator

Kubernetes YAML Generator

Deploy a container to Kubernetes with manifests that already include the parts people forget: probes, resource requests and a TLS Ingress.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use Kubernetes YAML Generator

  1. Enter the name, image, port and replicas.
  2. Set resources, health check, Service type, Ingress host and autoscaling.
  3. Download the YAML and apply it with kubectl.

Features

  • apps/v1 Deployment with recommended app.kubernetes.io labels
  • Readiness and liveness HTTP probes on a named port
  • Service (ClusterIP, NodePort or LoadBalancer)
  • Ingress with ingressClassName and cert-manager TLS
  • autoscaling/v2 HPA on CPU utilisation

Supported formats

Input

  • Form input

You get

  • YAML

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the Kubernetes YAML Generator is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • ConfigMaps, Secrets, volumes and NetworkPolicies are not generated.
  • The TLS Ingress assumes cert-manager with a ClusterIssuer named letsencrypt.

Guide

Generating Kubernetes Deployment, Service, Ingress and HPA manifests

Deploying one container to Kubernetes takes several objects that must agree with each other: a Deployment that runs the pods, a Service that gives them a stable address, an Ingress that routes a hostname to that Service, and often an autoscaler. Writing them by hand means repeating names, labels and ports in several places, and one typo breaks the chain silently. This generator writes all four from one form.

The four objects

The Deployment describes the pod template, the container image, its port, environment variables, resources and probes, and how many replicas to run. The Service selects those pods by label and exposes them inside the cluster on a port of its own. The Ingress maps a hostname and path to the Service for traffic from outside. The HorizontalPodAutoscaler watches CPU usage and changes the Deployment’s replica count between a minimum and a maximum.

How they connect

Everything hangs on labels and names. The pods carry app.kubernetes.io/name: web, the Deployment’s selector and the Service’s selector both match that label, and the Ingress and HPA refer to the Service and Deployment by name. The container port is named http, and the Service’s targetPort and the probes refer to that name rather than a number, so changing the container port later only needs one edit.

Probes and resources

With a health path set, the container gets a readiness probe, which keeps a pod out of the Service until it answers, and a liveness probe, which restarts a pod that stops answering. Resource requests tell the scheduler how much CPU and memory to reserve, and limits cap what the container may use. Requests are also what the autoscaler compares usage against.

Ingress and TLS

Setting a host adds an Ingress with ingressClassName, a single / path of type Prefix and the Service as backend. With TLS on, it adds a tls section that stores the certificate in a secret named after the app and the annotation cert-manager.io/cluster-issuer: letsencrypt, so cert-manager requests and renews a certificate automatically if it is installed with an issuer of that name.

Autoscaling and replicas

When the HPA is enabled, the Deployment deliberately has no replicas field. If it did, every kubectl apply would reset the count to that number and undo the autoscaler’s decision. The HPA uses the autoscaling/v2 API with a target average CPU utilisation, and its minimum replica count takes the place of the fixed number.

A worked example

With the default form values, the output contains four documents separated by ---: a Deployment for ghcr.io/example/web:2.4.1 without a replicas line, a ClusterIP Service on port 80, an Ingress for app.example.com with ingressClassName: nginx and TLS, and an HPA from 2 to 6 replicas with averageUtilization: 70. Turning the autoscaler off puts replicas: 2 back into the Deployment.

Applying the manifests

Download the file and validate it against the cluster with kubectl apply --dry-run=server -f web.yaml, which catches schema errors and admission policies without changing anything. Then apply for real and watch the rollout with kubectl rollout status deployment/web. Configuration files, Secrets, volumes and network policies are not generated and can be added as separate documents.

Checked against the current version of the Kubernetes YAML Generator on .

Frequently asked questions

Which Service type should I choose?

ClusterIP when traffic arrives through an Ingress, which is the usual setup for web apps. LoadBalancer when the cloud provider should give this one Service its own external address, and NodePort mainly for bare-metal clusters or quick tests.

Why must the HPA have resource requests to work?

CPU utilisation is measured as a percentage of the container’s CPU request. Without a request there is nothing to divide by, and the autoscaler reports the metric as unknown and never scales.

Why is replicas missing when autoscaling is on?

The HorizontalPodAutoscaler owns the replica count. If the Deployment also sets replicas, every kubectl apply resets it and fights the autoscaler, so the field is left out.

Do readiness and liveness probes need different paths?

Often they should. Readiness can check dependencies such as the database, so traffic stops when they fail; liveness should only check that the process responds, or a database outage restarts every pod.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.