CommandOpen
Devops (k8s-manifest)
Generate Kubernetes manifests for deploying the current application.
Generate Kubernetes manifests for deploying the current application.
Steps
- Analyze the project to determine deployment requirements:
- Read
Dockerfilefor container configuration, exposed ports, health checks. - Read
docker-compose.ymlfor service dependencies. - Read
.env.examplefor required environment variables.
- Generate core manifests:
- Deployment: Container spec, resource limits, readiness/liveness probes, replicas.
- Service: ClusterIP, NodePort, or LoadBalancer based on access pattern.
- ConfigMap: Non-sensitive configuration values.
- Secret: Sensitive values (templated, not with real values).
- Ingress: If the service needs external access, with TLS config.
- Add operational manifests as needed:
- HorizontalPodAutoscaler: CPU/memory-based scaling rules.
- PodDisruptionBudget: Minimum availability during updates.
- NetworkPolicy: Restrict traffic to necessary paths.
- ServiceAccount: With minimal RBAC permissions.
- Set resource requests and limits based on the application type.
- Write manifests to
k8s/ordeploy/k8s/directory. - Validate with
kubectl --dry-run=client -f <file>if kubectl is available.
Format
apiVersion: apps/v1
kind: Deployment
metadata:
name: <app-name>
namespace: <namespace>
labels:
app: <app-name>
spec:
replicas: <count>
selector:
matchLabels:
app: <app-name>
template:
spec:
containers:
- name: <app-name>
image: <registry>/<image>:<tag>
ports:
- containerPort: <port>
resources:
requests:
cpu: "100m"
memory: "128Mi"
limits:
cpu: "500m"
memory: "512Mi"Rules
- Always set resource requests and limits on every container.
- Never hardcode secrets in manifests; use Secret references or external secret managers.
- Include readiness and liveness probes for every service container.
- Use
RollingUpdatestrategy withmaxSurge: 1andmaxUnavailable: 0by default. - Add namespace to every resource manifest.
Source: https://github.com/rohitg00/awesome-claude-code-toolkit/blob/main/commands/devops/k8s-manifest.md
Author: rohitg00, Claude Code toolkit (rohitg00). License: Apache-2.0.
Shown here with formatting for the web. Keep the author and license notice when you reuse it.
Related entries
There are more like this in the members library
The Codex library holds 7,009 entries. Members can search all of them by meaning and read every one in full.