AI Generates K8s YAML in 30 Seconds: What's Left for Ops Engineers?
The author tests AI tools like DeepSeek for generating Kubernetes YAML, finding them adequate for standard templates but lacking cluster-specific context, security hardening, realistic probe values, accurate resource quotas, and complex multi-CRD scenarios. The article argues ops engineers' core value lies in troubleshooting, architecture decisions, platform building, and deep system understanding — not writing YAML — and advises embracing AI for drafts while moving up the stack to higher-leverage work.
Reading font

AI Writes YAML: What Level Has It Reached?
The author spent a week testing DeepSeek and ChatGPT with various K8s YAML requests. Conclusion: AI is already good enough for standardized YAML. For example, asking for a Spring Boot Deployment with HPA produces a complete manifest including resources, readiness/liveness probes, and an HPA resource targeting 70% CPU utilization.
apiVersion: apps/v1
kind: Deployment
metadata:
name: devapp
labels:
app: devapp
spec:
replicas: 3
selector:
matchLabels:
app: devapp
template:
metadata:
labels:
app: devapp
spec:
containers:
- name: devapp
image: devapp:latest
ports:
- containerPort: 8080
resources:
requests:
cpu: 250m
memory: 512Mi
limits:
cpu: 500m
memory: 1Gi
readinessProbe:
httpGet:
path: /actuator/health
port: 8080
initialDelaySeconds: 30
periodSeconds: 10
livenessProbe:
httpGet:
path: /actuator/health
port: 8080
initialDelaySeconds: 60
periodSeconds: 30
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: devapp-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: devapp
minReplicas: 2
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70However, the author identifies five typical problems when asking AI for production-ready YAML:
No knowledge of your cluster reality — AI may assume storageClassName: standard while your cluster uses nfs-client or local-path; it may suggest hostPort which can conflict with Calico/IPVS.
Security configs often missing — AI rarely adds securityContext with runAsNonRoot: true, runAsUser: 1000, readOnlyRootFilesystem: true, allowPrivilegeEscalation: false, nor Pod-level securityContext, NetworkPolicy, or PodDisruptionBudget unless explicitly asked.
Probe values are too templated — initialDelaySeconds: 30 for every service ignores that a lightweight API gateway and a cache-heavy microservice have vastly different startup profiles.
Resource quotas are guessed — Requests like cpu: 250m, memory: 512Mi have no basis in actual service consumption; the author saw AI assign 256Mi to a data-analysis service that promptly OOMKilled.
Complex multi-CRD scenarios fail — Examples: ArgoCD Application with blue-green deployment, cross-namespace ServiceAccount+RBAC, cert-manager-backed Ingress, StatefulSet with PodTopologySpread across AZs. AI output for these is largely unusable without heavy rewriting.
Where Is the Ops Engineer's Real Value?
Writing YAML was never the core value. The time-consuming, high-value work is:
Troubleshooting — Diagnosing CrashLoopBackOff by examining logs, events, resource usage, network policies, DNS. AI cannot see real-time cluster state, architecture topology, or recent ConfigMap changes.
Architecture decisions — Deployment vs StatefulSet, need for PDB, HPA metrics (CPU vs custom), ClusterIP vs Headless Service. These require business understanding, cluster knowledge, and cost/reliability trade-offs. AI can list options but cannot decide.
Handling "dirty work" — Recovering from full etcd disk, debugging NotReady nodes, intermittent CoreDNS timeouts, iptables/IPVS migration pitfalls. These demand on-site experience AI lacks.
Establishing standards and guardrails — Defining YAML standards, writing admission webhooks for validation, setting resource quota policies, designing naming/label conventions. This infrastructure-level work matters more than any single manifest.
How the Author Now Uses AI
Shifted from "write YAML for me" to "accelerate me":
Rapid drafts — Provide explicit parameters in the prompt (e.g., exact resource limits, probe paths, non-root requirement, PDB minAvailable) and let AI generate a baseline, saving ~60% time.
Explanation and debugging aid — Paste unfamiliar CRD specs or error events (e.g.,
0/3 nodes are available: 1 node(s) had taint {node.kubernetes.io/not-ready: }, that the pod didn't tolerate.) for instant clarification.
Documentation and scripts — Generate runbooks, oncall flowcharts, bulk-operation shell scripts.
Learning new tech — Ask for Gateway API concepts and examples instead of reading raw docs.
What Ops Engineers Should Actually Worry About
Two-track polarization:
Stronger ops — Treat AI as a tool for repetitive tasks; reinvest saved time in architecture, performance tuning, observability, cost optimization.
At-risk ops — If daily work is copy-paste YAML, tweak configs, restart services, that niche will shrink.
AI also lowers the barrier for developers to write their own YAML. Developers can now generate manifests and kubectl apply themselves, reducing "write YAML" tickets. But AI-generated YAML often works on local minikube and breaks in production because AI doesn't know the CNI (Calico vs Flannel), StorageClass names, or node topology. The ops role shifts from "write YAML for devs" to "ensure dev-written YAML doesn't break the cluster" — via platforms, tooling, standards, and automation.
Advice for Anxious Peers
Adopt AI, don't resist — Early adopters gain an efficiency edge; resistance won't stop the trend.
Move up, not down — YAML-level work will automate. Focus on architecture, SRE practices, observability, cost optimization — areas AI can't replace soon.
Deepen fundamentals — AI can't explain why a Pod sticks in ContainerCreating, why Service traffic is uneven, or why rolling updates drop connections. That systems knowledge is your moat.
Build platforms and tooling — Codify team K8s experience into self-service platforms, automated YAML generation/validation. Your value becomes "enabling the whole team to move fast safely."
Keep learning — Gateway API, WASM, Serverless, eBPF... each wave brings new leverage. AI writes YAML; it can't tell you what to learn next.
Final thought: Don't fear AI. Fear the peer who masters AI before you do. Tools don't replace people; people who use tools replace those who don't.
Closing Story
The new colleague's AI-generated YAML ran — until a Pod wouldn't start. He couldn't diagnose it. The author found the root cause: securityContext.runAsNonRoot: true conflicted with host directory permissions. The colleague had the setting but didn't understand when it causes failures.
AI can help you write YAML, but it can't help you understand the YAML you wrote.
That's the ops engineer's path forward: not racing AI on YAML speed, but outpacing everyone on understanding what lies behind the YAML.
For questions about attribution, corrections or content rights, please contactand we will review it promptly.