Kubernetes Manifest Generator: From Parameters to Reviewable YAML
When to use
My first Kubernetes deployment was a single Deployment file. It looked fine in review. Then the rollout failed because there was no Service, no Ingress, and the namespace had a typo. I rebuilt the same four files by hand for every small service, and the mistakes repeated. This generator is built for that first pass: a small web service with one image, one port and one hostname.
It fits single-service applications. You know the image, the container port, the hostname and a rough CPU and memory budget. In a few minutes you get a readable multi-document YAML file. The output can include a Namespace, ConfigMap, Secret, Deployment, Service, Ingress, HPA and PDB.
It also fits design review. The right panel shows document count, line count and structural checks. Reviewers can look at those first, then discuss image tags, secret management and rollout policy.
It is also useful when you need to explain a manifest to someone who does not live in Kubernetes every day. The labels and comments are plain, and the panel does not hide the structure behind a wizard.
It is not a replacement for Helm. Multi-environment overlays, versioned rollbacks and packaged dependencies still belong in Helm, Kustomize or a GitOps pipeline.

Parameters
The application name must be a DNS label: lowercase letters, digits and hyphens, up to 63 characters. Uppercase letters, underscores and Chinese characters are rejected. The namespace follows the same rule.
Replicas accept an integer from 1 to 100. This value goes into the Deployment replicas field. It is not the HPA minimum. When HPA is enabled, set the minimum and maximum separately, and make sure the minimum is not greater than the maximum.
Container port and Service port both accept 1 to 65535. The container port becomes containerPort. The Service port becomes the Service port field, while targetPort still points at the container port. The Ingress backend uses the Service port, not the container port. That is the most common place people get it wrong.
CPU uses values such as 100m or 0.5. Memory uses values such as 128Mi or 1Gi. The validator checks the unit and rejects informal strings such as 2GB. If both request and limit are empty, the scheduler cannot reserve capacity, and HPA CPU utilisation becomes unreliable.
maxSurge and maxUnavailable use the 25% / 25% form. Under the Recreate strategy these values do not apply. The tool keeps your input but does not write them into the YAML.
Environment variables use one KEY=VALUE pair per line. ConfigMap and Secret follow the same format. Secret values are Base64 encoded inside the browser and are never sent to a server. Variable names accept letters, digits, underscores and dots, and cannot start with a digit.
The health path is used by both liveness and readiness probes. A delay of 10 seconds and a period of 15 seconds is a conservative default. Slow-starting services should increase the initial delay, otherwise the kubelet may restart a container that is still booting.
Steps
- In the Workload card, fill the application name, namespace, replicas, image and container port. Use a real tag, not latest.
- In the Service and Entry card, choose the Service type and rollout strategy, then fill the Ingress host and path. The path must start with /. Prefix fits most cases.
- Turn Service, Ingress, HPA and PDB on or off as needed. An internal-only service can leave Ingress disabled.
- In the Resources and Probes card, set CPU, memory and the health path. For a slow service, raise the initial delay before generating.
- Click Generate YAML. Read the document count first, then the structural checks. Fix any red item in the left panel before copying.
- Copy the YAML or download the .yaml file. Run kubectl apply --dry-run=server against the target cluster before a real apply.

What you get
The generated YAML starts with a short comment header. That header names the generator and reminds the reviewer to check namespace, image and secret strategy before applying. It is safe to remove, but keeping it makes later reviews easier to trace.
The document count is not fixed. A Deployment-only output is one document. The default example with ConfigMap, Secret, Deployment, Service and Ingress produces five. Enabling Namespace, ServiceAccount, HPA, PDB and NetworkPolicy can take it to ten. Line count grows with fields, so do not use it as a quality score.
The structural checks confirm that js-yaml can parse the output, that the document count matches, that a Deployment exists, and that Service, Ingress, HPA and PDB appear when their switches are on. They do not prove the cluster will accept the manifest. They only prove the syntax and structure are not broken.
Secret data is a Base64 string. API_TOKEN: YXBpLXRva2Vu is not encrypted. It is only encoded. For production, use Sealed Secrets, External Secrets or a cloud key management service.
HPA metrics are fixed at 70% CPU utilisation. This depends on metrics-server. Without metrics, the replica count will not move. PDB minAvailable set to 1 is an absolute pod count. Set to 25% it is a proportion. The two behave differently during a rolling update.

FAQ
Can I apply the generated YAML to production directly?
Use it as a skeleton. Secret management, image signing, egress NetworkPolicy, resource quotas and RBAC still need to follow your platform rules. At minimum, run a server-side dry run.
Why is the Ingress backend port different from the container port?
The Ingress points at the Service port. The Service targetPort maps that port to the container. Writing the container port directly into the Ingress usually produces a 503.
Why does the replica count stay flat after enabling HPA?
Check that metrics-server is installed, and that resources.requests.cpu is set on the Deployment. Without both, HPA cannot calculate utilisation.
Boundaries
The tool does not generate Helm charts, Kustomize overlays, RBAC or External Secrets. It can generate a ServiceAccount and an ingress-only NetworkPolicy, but it does not verify that the CNI enforces the policy, nor does it validate CRDs, StorageClasses or the Ingress controller version in the target cluster. The result is a starting point, not a production licence.
What 1.1.0 adds: three baselines, twelve kinds and document tabs
The top of the page now has three baseline buttons: Development, Staging and Production. Development uses one replica, 50m/250m CPU and 64Mi/256Mi memory, with HPA, PDB, ServiceAccount and NetworkPolicy off. Staging uses two replicas and turns on HPA, PDB, TLS, ServiceAccount and NetworkPolicy. Production uses three replicas, 250m/1 CPU and 256Mi/1Gi memory, HPA 3-12, PDB 2 and zone spread. The buttons only write parameters; they do not change the image or hostname. Check every field before you generate.
Two resource kinds are new. ServiceAccount sets automountServiceAccountToken to false by default, so a workload that calls the Kubernetes API needs a deliberate change. NetworkPolicy is ingress-only: it allows same-namespace pods and the named Ingress controller namespace. Egress policy is still your team's decision.
The output panel now has document tabs. All YAML is the default for copy or download. Click a tab to read one kind, then use Copy Current Document to send only the Deployment or NetworkPolicy to a reviewer. Generation still dumps with js-yaml and reads the documents back, and the check list reports the document count.
The form also gained envFrom, imagePullSecret, graceful termination and an HPA metric selector. envFrom is added only when the ConfigMap or Secret has content. Duplicate environment keys are reported as a last-value-wins warning. HPA can target CPU or memory utilisation from 1 to 100. A passing check is not a passing cluster; run a server-side dry run before apply.
What 1.2.0 adds: startup probe, preStop and DNS egress
A slow-starting service can be killed by a liveness probe before it finishes booting. The 1.2.0 form adds a startup probe with periodSeconds 10 and failureThreshold 30, giving roughly a five-minute boot window; liveness takes over only after the startup probe passes. It protects startup, not readiness.
preStop gives in-flight connections time to drain. The default is 10 seconds and emits a lifecycle preStop sleep. Keep it below terminationGracePeriodSeconds, or the container will still be killed. Read the two together: one gives the process time to finish, the other gives traffic time to move.
NetworkPolicy now has an optional Allow DNS egress switch. When on, policyTypes becomes Ingress and Egress, and egress allows only UDP/TCP 53 in kube-system plus the business port in the same namespace. This is not a full egress allowlist; external APIs, object storage and databases still need team policy. When off, the policy remains ingress-only and does not pretend to block all egress.
Three checks were added for the startup probe, preStop and DNS egress. The production preset turns on the first two and leaves DNS egress off, so a single click does not cut external dependencies. The Secret label now says plaintext with automatic Base64, which is accurate: the browser encodes, but that is not encryption.
What 1.3.0 adds: least-privilege RBAC and production defaults
This release moves from "it deploys" to "it has just enough permission". Enable "least-privilege RBAC (read ConfigMaps only)" and the output gains a Role and a RoleBinding. The Role allows only get, list and watch on configmaps in the same namespace; the binding attaches it to the app's ServiceAccount. It grants nothing on secrets, pods or other namespaces, so you do not need cluster-admin just to read configuration.
RBAC cannot be enabled alone. The validator reports "least-privilege RBAC requires a ServiceAccount" because the binding's subject must be a real SA. Staging and production presets turn on both SA and RBAC; development leaves both off. Turn both off if you only want the workload objects.
The production preset now emits 11 documents by default: ServiceAccount, Role, RoleBinding, ConfigMap, Secret, Deployment, Service, Ingress, HPA, PDB and NetworkPolicy. Namespace stays off unless selected, which makes it 12. That difference comes from the toggles, not a failed build; check the document count and structure self-check before copying.
A new self-check line reports RBAC as generated, needing a ServiceAccount, or disabled. It proves the objects exist, not that your cluster's permission model matches your security baseline. Before apply, verify with kubectl auth can-i --as=system:serviceaccount:<ns>:<sa>.
The Role verbs are a fixed minimal set and there is no option to grant ConfigMap writes. If an application really needs to update configuration, build a controlled write path instead of widening this read-only role.
1.4.0: Namespace governance and Pod Security
1.4.0 adds a “Namespace governance (Quota/LimitRange/PSS)” switch, enabled by default for staging and production and off for development. It emits a ResourceQuota and a LimitRange. The quota derives a release budget from the HPA maximum (or current replicas when HPA is off), adds maxSurge headroom, then aggregates per-Pod requests and limits over that budget. The Pod cap equals the same budget, so it does not block the HPA and still covers temporary rolling-update Pods. The LimitRange records default requests/limits and sets the per-container maximum to twice the configured limit.
When the Namespace document is also enabled, the namespace receives pod-security.kubernetes.io/enforce, audit and warn labels set to restricted. Together with non-root, drop ALL, seccomp and a read-only root, this forms a layered baseline from namespace to container. Without the Namespace document, no namespace is invented; only the quota and limit range are generated.
The production preset now produces 13 documents instead of 11; enabling Namespace makes 14, and turning governance off returns to 11. The new self-check only proves the objects exist, not that the cluster's admission and quota controllers behave as expected. Run a server-side dry-run before apply and confirm the quota will not block a rollout.