About kubernetes yaml generator
Kubernetes runs containers across a cluster. A Deployment keeps a set number of pods running, a Service gives them a stable address, and an Ingress exposes them over HTTP.
Good practice
- Set resource requests and limits.
- Add readiness and liveness probes.
- Use labels consistently so Services find the right pods.
A worked example
A Deployment named web with 3 replicas runs the image myapp:1.0 and listens on port 3000. A Service of type ClusterIP exposes it inside the cluster, and an Ingress routes example.com to that service. Apply the three documents with kubectl apply -f and check with kubectl get pods.
Production habits
- Set CPU and memory requests and limits.
- Add readiness and liveness probes so traffic reaches only healthy pods.
- Use specific image tags and keep secrets out of the YAML.
