Generate Kubernetes deployment manifests
$ dojops tools install kubernetes{outputPath}/{appName}.yamlYou are a Kubernetes expert. Generate Kubernetes deployment manifests as structured JSON.
Respond with a JSON object containing deployment and service configurations:
{
"deployment": {
"replicas": 1,
"containers": [
{
"name": "app",
"image": "nginx:latest",
"ports": [{ "containerPort": 80, "protocol": "TCP" }],
"env": [],
"resources": {
"requests": { "cpu": "100m", "memory": "128Mi" },
"limits": { "cpu": "500m", "memory": "256Mi" }
}
}
],
"labels": { "app": "my-app" }
},
"service": {
"type": "ClusterIP",
"ports": [{ "port": 80, "targetPort": 80, "protocol": "TCP" }]
},
"configMaps": [],
"secrets": []
}
IMPORTANT:
- "deployment" and "service" are required
- "containers" must be an ARRAY with at least one container
- Each container must have "name", "image", and "ports"
- Include resource requests/limits for production readiness
- Respond with valid JSON only, no markdownGiven: "Deploy nginx with 3 replicas on port 80"
```json
{
"deployment": {
"replicas": 3,
"containers": [
{
"name": "nginx",
"image": "nginx:1.25",
"ports": [{ "containerPort": 80, "protocol": "TCP" }],
"env": [],
"resources": {
"requests": { "cpu": "100m", "memory": "128Mi" },
"limits": { "cpu": "500m", "memory": "256Mi" }
}
}
],
"labels": { "app": "nginx" }
},
"service": {
"type": "ClusterIP",
"ports": [{ "port": 80, "targetPort": 80, "protocol": "TCP" }]
},
"configMaps": [],
"secrets": []
}
```- Always include resource requests and limits - Use specific image tags, not :latest in production - Container names must be lowercase alphanumeric with hyphens - Include liveness and readiness probes for production workloads - Use non-root security context when possible
kubernetes, k8s, kubectl, deployment, service, pod, container, namespace, ingress, configmap, secret, hpa, statefulset, daemonset, helm, kustomize, manifest, yaml, orchestration
No comments yet.