# Kubernetes YAML Generator - Deployment, Service & Ingress

> Generate Kubernetes manifests: Deployment/StatefulSet, Service, Ingress, ConfigMap, Secret, HPA, PVC and CronJob, with validation and docker run/compose import.

- URL: https://qilingtools.com/en/k8s-yaml
- Category: Developer Tools (https://qilingtools.com/en/dev)
- Tags: [Developer](https://qilingtools.com/en/tags/dev), [DevOps](https://qilingtools.com/en/tags/devops)
- Last updated: 2026-10-26
- Price: Free, no sign-up
- Privacy: Runs locally in the browser; files are never uploaded

Hand-written Kubernetes YAML usually breaks on indentation, labels and names that must match across resources. This tool builds a complete multi-document manifest ready for kubectl apply from a form: a Deployment or StatefulSet (image, replicas, ports, env vars, envFrom ConfigMaps/Secrets, CPU and memory requests and limits, liveness and readiness probes, PVC/ConfigMap/Secret/emptyDir/hostPath volumes, securityContext, nodeSelector, tolerations, pod anti-affinity spreading and rolling-update settings), plus a Service (ClusterIP, NodePort, LoadBalancer or headless), Ingress (ingressClassName, multiple hosts, path, TLS and cert-manager), ConfigMap, Secret (base64-encoded automatically, UTF-8 safe), HPA (autoscaling/v2 on CPU or memory), PVC and a CronJob using the same image. Selectors, Service, Ingress and HPA references are generated from one model, so they always match; StatefulSets automatically get a headless Service and volumeClaimTemplates. Live checks flag invalid names and labels, port-name rules (15 characters max), duplicate ports, NodePort ranges, wrong CPU/memory units (m instead of Mi, MB), requests above limits, HPAs without requests, probes on unknown ports, latest image tags and more. You can also paste a docker run command or docker-compose.yml to convert it into a Deployment and Service: ports, env vars (password-like ones go into a Secret), named volumes to PVCs, bind mounts to ConfigMaps, memory/CPU limits, healthchecks to probes and user to runAsUser. Everything runs in your browser.

## How to use

1. Fill in the name, image and ports, or paste a docker run command or docker-compose.yml at the top to import it
2. Enable the Service, Ingress, ConfigMap, Secret, PVC, HPA or CronJob you need and set their options
3. Review the checks, copy or download the YAML, validate with kubectl apply --dry-run=server and deploy

## Features

- Deployment / StatefulSet form: probes, resources, volumes, security context, scheduling
- Four Service types and Ingress with TLS, cert-manager and multiple hosts
- ConfigMap, Secret (auto base64), HPA v2, PVC and CronJob
- Live validation of labels, port names, resource units and requests/limits
- Selectors, Service, Ingress and HPA always consistent
- docker run / docker-compose to Kubernetes conversion
- Multi-document YAML download with kubectl commands

## FAQ

### How do I deploy the generated YAML?

Download it and run kubectl apply --dry-run=server -f file.yaml first: the API server validates everything without creating anything. If that passes, run the apply without --dry-run and watch the rollout with kubectl rollout status. For a namespace other than default, tick “Also generate the Namespace”.

### Deployment or StatefulSet?

Use a Deployment for stateless services such as web apps and APIs, where Pods are interchangeable. Use a StatefulSet for databases, queues and other apps that need stable network identities and their own storage: each Pod gets a fixed name (name-0, name-1), is reached through a headless Service and gets its own PVC from volumeClaimTemplates.

### How should I write CPU and memory values?

CPU is in cores or millicores, so 0.5 equals 500m. For memory, prefer binary units Ki, Mi and Gi (1Mi = 1,048,576 bytes); M and G are decimal; a lowercase m means millibytes, so 128m of memory is almost certainly a typo. The tool flags these and checks that requests do not exceed limits.

### What are the limits of the docker-compose conversion?

depends_on, privileged, network_mode: host and build have no direct equivalent, and the tool tells you so. Bind mounts become ConfigMap volumes you create with kubectl create configmap --from-file, and named volumes become PVCs. Env vars named like PASSWORD, TOKEN or KEY go into a Secret; remember that Secret base64 is encoding, not encryption, so keep real passwords out of Git.

## Related tools

- [JSON Formatter](https://qilingtools.com/en/json): Free online JSON formatter: beautify or minify, validate with the exact line and column of any error, browse a collapsible tree, sort keys and escape strings.
- [Base64 Encode/Decode](https://qilingtools.com/en/base64): Free online Base64 encoder and decoder: UTF-8 safe, optional URL-safe variant, convert text to Base64 and back in real time. Processed locally, never uploaded.
- [URL Encode/Decode](https://qilingtools.com/en/url-encode): Free online URL encoder and decoder with encodeURIComponent and encodeURI modes. Escapes Chinese, spaces and special characters. Real-time and local, no upload.
- [JWT Decoder](https://qilingtools.com/en/jwt): Free online JWT decoder: decode the header and payload of a JSON Web Token, show expiry and issued-at times, all locally without uploading the token.
- [Timestamp Converter](https://qilingtools.com/en/timestamp): Free online Unix timestamp converter: convert timestamps and dates, auto-detect seconds or milliseconds, and show local, UTC, ISO 8601 and relative time.
- [Hash / Checksum](https://qilingtools.com/en/hash): Free online hash calculator: SHA-1, SHA-256, SHA-384 and SHA-512 of text or any file through the browser crypto API. Files never leave your device.
- [UUID Generator](https://qilingtools.com/en/uuid): Free online UUID generator: create RFC 4122 UUID v4 in bulk with a cryptographic RNG. Options for uppercase, no hyphens and braces, with one-click copy.
- [Base Converter](https://qilingtools.com/en/base-convert): Free online number base converter: convert between binary, octal, decimal, hexadecimal and any base 2–36. Uses BigInt for huge integers, computed locally.
