Kubernetes Manifest Generator
Expert in generating production-grade Kubernetes manifests, Helm charts, and Kustomize overlays with security and reliability built in.
Activation Triggers
Activate on: "Kubernetes manifest", "K8s YAML", "Helm chart", "HPA", "PodDisruptionBudget", "Ingress", "NetworkPolicy", "Kustomize", "deployment config", "service mesh", "resource limits"
NOT for: Docker image building → docker-multi-stage-optimizer | Cluster provisioning → terraform-module-builder | CI/CD → github-actions-pipeline-builder
Quick Start
- Define the workload — Deployment, StatefulSet, or Job based on use case
- Set resource requests/limits — always specify both CPU and memory
- Add reliability primitives — HPA, PDB, health probes, topology spread
- Secure the workload — NetworkPolicy, SecurityContext, RBAC
- Package for environments — Helm chart or Kustomize overlays for dev/staging/prod
Core Capabilities
| Domain |
Technologies |
| Workloads |
Deployment, StatefulSet, DaemonSet, Job, CronJob |
| Autoscaling |
HPA (CPU/memory/custom), VPA, KEDA event-driven |
| Networking |
Ingress (nginx/traefik), Gateway API, NetworkPolicy, Service Mesh |
| Reliability |
PDB, TopologySpreadConstraints, PriorityClasses, Pod Anti-Affinity |
| Packaging |
Helm 3, Kustomize, Timoni (CUE-based) |
Architecture Patterns
Production Deployment Template
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .name }}
labels:
app.kubernetes.io/name: {{ .name }}
app.kubernetes.io/version: {{ .version }}
spec:
replicas: 3
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0 # Zero-downtime deploys
selector:
matchLabels:
app.kubernetes.io/name: {{ .name }}
template:
spec:
securityContext:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
containers:
- name: {{ .name }}
image: {{ .image }}
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
livenessProbe:
httpGet: { path: /healthz, port: 8080 }
initialDelaySeconds: 10
readinessProbe:
httpGet: { path: /readyz, port: 8080 }
initialDelaySeconds: 5
topologySpreadConstraints:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
HPA + PDB Pairing
HPA ensures enough pods exist for load:
minReplicas: 3 → maxReplicas: 20
├─ CPU target: 70%
└─ Custom metric: requests_per_second target 1000
PDB ensures enough pods survive disruptions:
minAvailable: 2 (or maxUnavailable: 1)
└─ Guarantees service during node drains, upgrades
Gateway API (replaces Ingress, K8s 1.31+)
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: api-routes
spec:
parentRefs:
- name: main-gateway
rules:
- matches:
- path: { type: PathPrefix, value: /api/v1 }
backendRefs:
- name: api-service
port: 8080
weight: 90
- name: api-service-canary
port: 8080
weight: 10 # 10% canary traffic
Anti-Patterns
- No resource limits — pods consume unbounded resources and starve neighbors. Always set both requests and limits.
- Missing health probes — K8s cannot detect unhealthy pods. Define both liveness (restart stuck pods) and readiness (stop routing to unready pods).
- PDB without HPA — PDB alone does not scale. Pair with HPA so disruptions do not reduce capacity below minimum.
- Privileged containers —
privileged: true grants host-level access. Use securityContext.runAsNonRoot: true and drop all capabilities.
- Hardcoded image tags —
:latest in production is non-reproducible. Use digest or semver tags.
Quality Checklist
[ ] All containers have resource requests AND limits
[ ] Liveness and readiness probes defined
[ ] SecurityContext sets runAsNonRoot: true
[ ] NetworkPolicy restricts ingress/egress
[ ] PodDisruptionBudget defined for stateless workloads
[ ] HPA configured with appropriate min/max replicas
[ ] TopologySpreadConstraints for multi-zone resilience
[ ] Image tags pinned (no :latest in prod)
[ ] Labels follow app.kubernetes.io conventions
[ ] Secrets mounted as volumes, not environment variables
[ ] Helm chart passes `helm lint` and `helm template` validation
[ ] Kustomize overlays tested for dev, staging, and prod
1---2license: Apache-2.03name: kubernetes-manifest-generator4description: "Kubernetes manifest and Helm chart generator for production workloads. Activate on: K8s config, Deployment YAML, HPA autoscaling, PodDisruptionBudget, Ingress rules, NetworkPolicy, Helm chart, Kustomize. NOT for: Docker image building (use docker-multi-stage-optimizer), IaC provisioning of clusters (use terraform-module-builder), CI/CD pipeline config (use github-actions-pipeline-builder)."5allowed-tools: Read,Write,Edit,Bash(docker:*,kubectl:*,terraform:*,npm:*,npx:*)6category: DevOps & Infrastructure7tags:8 - kubernetes9 - helm10 - infrastructure11 - orchestration12pairs-with:13 - skill: devops-automator14 reason: Broader infrastructure automation that K8s manifests plug into15 - skill: docker-multi-stage-optimizer16 reason: Produces the images these manifests deploy17metadata:18 source: https://skillmd.com/skills/curiositech/kubernetes-manifest-generator19---2021# Kubernetes Manifest Generator2223Expert in generating production-grade Kubernetes manifests, Helm charts, and Kustomize overlays with security and reliability built in.2425## Activation Triggers2627**Activate on:** "Kubernetes manifest", "K8s YAML", "Helm chart", "HPA", "PodDisruptionBudget", "Ingress", "NetworkPolicy", "Kustomize", "deployment config", "service mesh", "resource limits"2829**NOT for:** Docker image building → `docker-multi-stage-optimizer` | Cluster provisioning → `terraform-module-builder` | CI/CD → `github-actions-pipeline-builder`3031## Quick Start32331. **Define the workload** — Deployment, StatefulSet, or Job based on use case342. **Set resource requests/limits** — always specify both CPU and memory353. **Add reliability primitives** — HPA, PDB, health probes, topology spread364. **Secure the workload** — NetworkPolicy, SecurityContext, RBAC375. **Package for environments** — Helm chart or Kustomize overlays for dev/staging/prod3839## Core Capabilities4041| Domain | Technologies |42|--------|-------------|43| **Workloads** | Deployment, StatefulSet, DaemonSet, Job, CronJob |44| **Autoscaling** | HPA (CPU/memory/custom), VPA, KEDA event-driven |45| **Networking** | Ingress (nginx/traefik), Gateway API, NetworkPolicy, Service Mesh |46| **Reliability** | PDB, TopologySpreadConstraints, PriorityClasses, Pod Anti-Affinity |47| **Packaging** | Helm 3, Kustomize, Timoni (CUE-based) |4849## Architecture Patterns5051### Production Deployment Template5253```yaml54apiVersion: apps/v155kind: Deployment56metadata:57 name: {{ .name }}58 labels:59 app.kubernetes.io/name: {{ .name }}60 app.kubernetes.io/version: {{ .version }}61spec:62 replicas: 363 strategy:64 rollingUpdate:65 maxSurge: 166 maxUnavailable: 0 # Zero-downtime deploys67 selector:68 matchLabels:69 app.kubernetes.io/name: {{ .name }}70 template:71 spec:72 securityContext:73 runAsNonRoot: true74 seccompProfile:75 type: RuntimeDefault76 containers:77 - name: {{ .name }}78 image: {{ .image }}79 resources:80 requests:81 cpu: 100m82 memory: 128Mi83 limits:84 cpu: 500m85 memory: 512Mi86 livenessProbe:87 httpGet: { path: /healthz, port: 8080 }88 initialDelaySeconds: 1089 readinessProbe:90 httpGet: { path: /readyz, port: 8080 }91 initialDelaySeconds: 592 topologySpreadConstraints:93 - maxSkew: 194 topologyKey: topology.kubernetes.io/zone95 whenUnsatisfiable: DoNotSchedule96```9798### HPA + PDB Pairing99100```101HPA ensures enough pods exist for load:102 minReplicas: 3 → maxReplicas: 20103 ├─ CPU target: 70%104 └─ Custom metric: requests_per_second target 1000105106PDB ensures enough pods survive disruptions:107 minAvailable: 2 (or maxUnavailable: 1)108 └─ Guarantees service during node drains, upgrades109```110111### Gateway API (replaces Ingress, K8s 1.31+)112113```yaml114apiVersion: gateway.networking.k8s.io/v1115kind: HTTPRoute116metadata:117 name: api-routes118spec:119 parentRefs:120 - name: main-gateway121 rules:122 - matches:123 - path: { type: PathPrefix, value: /api/v1 }124 backendRefs:125 - name: api-service126 port: 8080127 weight: 90128 - name: api-service-canary129 port: 8080130 weight: 10 # 10% canary traffic131```132133## Anti-Patterns1341351. **No resource limits** — pods consume unbounded resources and starve neighbors. Always set both requests and limits.1362. **Missing health probes** — K8s cannot detect unhealthy pods. Define both liveness (restart stuck pods) and readiness (stop routing to unready pods).1373. **PDB without HPA** — PDB alone does not scale. Pair with HPA so disruptions do not reduce capacity below minimum.1384. **Privileged containers** — `privileged: true` grants host-level access. Use `securityContext.runAsNonRoot: true` and drop all capabilities.1395. **Hardcoded image tags** — `:latest` in production is non-reproducible. Use digest or semver tags.140141## Quality Checklist142143```144[ ] All containers have resource requests AND limits145[ ] Liveness and readiness probes defined146[ ] SecurityContext sets runAsNonRoot: true147[ ] NetworkPolicy restricts ingress/egress148[ ] PodDisruptionBudget defined for stateless workloads149[ ] HPA configured with appropriate min/max replicas150[ ] TopologySpreadConstraints for multi-zone resilience151[ ] Image tags pinned (no :latest in prod)152[ ] Labels follow app.kubernetes.io conventions153[ ] Secrets mounted as volumes, not environment variables154[ ] Helm chart passes `helm lint` and `helm template` validation155[ ] Kustomize overlays tested for dev, staging, and prod156```