Engineering
k8s-yaml-generator avatar

k8s-yaml-generator

Generate production-ready Kubernetes manifests including Deployments, Services, CRDs, and more with built-in validation.

Introduction

The k8s-yaml-generator is a precision-oriented skill for DevOps engineers and platform operators who need to scaffold infrastructure-as-code artifacts rapidly without sacrificing stability. It moves beyond simple template creation by providing a deterministic workflow that includes preflight sanity checks, bounded CRD lookup, and mandatory validation stages. Whether you are generating complex StatefulSets with persistent volume claims, configuring ingress controllers, or scaffolding custom resource definitions for GitOps tools like Argo CD, this agent ensures your manifests adhere to modern Kubernetes best practices.

  • Generates diverse resource types including Deployments, Services, ConfigMaps, Ingress, RBAC, and complex CRDs.

  • Implements a deterministic execution model with pre-defined steps: preflight, input capture, CRD resolution, generation, and validation.

  • Enforces strict quality standards such as labels consistency, resource requests and limits, readiness/liveness probes, and securityContext settings.

  • Features a bounded CRD lookup workflow that leverages tool-specific documentation resolution to prevent infinite loops and ensure accuracy.

  • Performs mandatory post-generation validation using k8s-yaml-validator, kubeconform, and dry-run server-side application checks to catch syntax or schema errors before they reach a cluster.

  • Provides detailed validation reports, including syntax pass/fail, schema compliance, and dry-run status to maintain clear observability of the infrastructure creation process.

  • Users must provide clear intent for the resource type, image workload for pods, and namespace requirements to begin generation.

  • The skill maintains a safety-first approach; if tool-specific validation fails, it provides documented fallback paths or reports blocking issues explicitly.

  • Always define your target Kubernetes version if possible to ensure the generated YAML uses current, non-deprecated API groups and versions.

  • When working with CRDs, provide the API version and group if known, or allow the agent to perform a limited search using its configured Context7 tool chain.

  • This skill is strictly for generation and orchestration; for pure validation tasks, please utilize the separate k8s-yaml-validator skill to avoid redundant processing overhead.

Repository Stats

Stars
201
Forks
24
Open Issues
1
Language
Python
Default Branch
main
Sync Status
Idle
Last Synced
May 3, 2026, 04:56 PM
View on GitHub