How to use the Kubernetes YAML Generator
- 1. Describe your appEnter the name, image, replicas and container port.
- 2. Set resources and checksAdd CPU and memory values and a health check path.
- 3. ApplyDownload the YAML and run kubectl apply -f with the file.
What the defaults generate
The example app web-api produces 2 objects: a Deployment and a Service. The Deployment runs 2 replicas of ghcr.io/example/web-api:1.4.2 on port 8080, with requests of 100m CPU and 128Mi memory and limits of 500m and 256Mi. Readiness and liveness probes call /healthz, and the security context sets runAsNonRoot: true and blocks privilege escalation. The Service is a ClusterIP that maps port 80 to the container's 8080.
Add an Ingress host such as api.example.com and a third object appears, routing that host to the Service through an ingress controller.
Choosing values
- Requests are what the scheduler reserves. Set them near normal usage.
- Limits cap usage. Going over the memory limit kills the container; going over the CPU limit slows it.
- Readiness failing removes the Pod from the Service; liveness failing restarts it. Give liveness a longer start delay.
- Service type: ClusterIP for internal traffic, NodePort for testing, LoadBalancer for a cloud load balancer.
runAsNonRoot needs an image that does not run as root, and ingressClassName must match your controller. Keep passwords in a Secret, not in the env list. Convert units with the Kubernetes CPU and memory units converter, and test your knowledge with the Kubernetes MCQ quiz.
Frequently asked questions
Which Kubernetes versions does this work with?
apps/v1 Deployments, v1 Services and networking.k8s.io/v1 Ingress have been stable for years and work on current clusters.
Can I use this with Minikube or kind?
Yes. For a quick test use NodePort or kubectl port-forward instead of an Ingress.
Is the Kubernetes YAML Generator free?
Yes, the Kubernetes YAML Generator is free. The first time you generate your first manifest, you are asked for your name and WhatsApp number once. After that, this and every other Uncodemy tool opens straight away without the form.