specweave 0.23.18 → 0.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +144 -45
- package/CLAUDE.md +137 -4
- package/dist/src/cli/helpers/ado-area-path-mapper.d.ts +89 -0
- package/dist/src/cli/helpers/ado-area-path-mapper.d.ts.map +1 -0
- package/dist/src/cli/helpers/ado-area-path-mapper.js +213 -0
- package/dist/src/cli/helpers/ado-area-path-mapper.js.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts +29 -0
- package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js +109 -0
- package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/ado.d.ts +1 -0
- package/dist/src/cli/helpers/issue-tracker/ado.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/ado.js +2 -0
- package/dist/src/cli/helpers/issue-tracker/ado.js.map +1 -1
- package/dist/src/cli/helpers/smart-filter.d.ts +83 -0
- package/dist/src/cli/helpers/smart-filter.d.ts.map +1 -0
- package/dist/src/cli/helpers/smart-filter.js +265 -0
- package/dist/src/cli/helpers/smart-filter.js.map +1 -0
- package/dist/src/core/qa/quality-gate-decider.d.ts +1 -1
- package/dist/src/core/qa/quality-gate-decider.js +2 -2
- package/dist/src/core/qa/quality-gate-decider.js.map +1 -1
- package/dist/src/core/qa/risk-calculator.d.ts +2 -2
- package/dist/src/core/qa/risk-calculator.js +2 -2
- package/dist/src/core/repo-structure/repo-structure-manager.d.ts.map +1 -1
- package/dist/src/core/repo-structure/repo-structure-manager.js +76 -43
- package/dist/src/core/repo-structure/repo-structure-manager.js.map +1 -1
- package/dist/src/core/validators/ac-presence-validator.d.ts +56 -0
- package/dist/src/core/validators/ac-presence-validator.d.ts.map +1 -0
- package/dist/src/core/validators/ac-presence-validator.js +149 -0
- package/dist/src/core/validators/ac-presence-validator.js.map +1 -0
- package/dist/src/integrations/ado/area-path-mapper.d.ts +137 -0
- package/dist/src/integrations/ado/area-path-mapper.d.ts.map +1 -0
- package/dist/src/integrations/ado/area-path-mapper.js +267 -0
- package/dist/src/integrations/ado/area-path-mapper.js.map +1 -0
- package/dist/src/integrations/jira/filter-processor.d.ts +126 -0
- package/dist/src/integrations/jira/filter-processor.d.ts.map +1 -0
- package/dist/src/integrations/jira/filter-processor.js +207 -0
- package/dist/src/integrations/jira/filter-processor.js.map +1 -0
- package/dist/src/integrations/jira/jira-client.d.ts +13 -0
- package/dist/src/integrations/jira/jira-client.d.ts.map +1 -1
- package/dist/src/integrations/jira/jira-client.js +33 -0
- package/dist/src/integrations/jira/jira-client.js.map +1 -1
- package/dist/src/utils/ac-embedder.d.ts +63 -0
- package/dist/src/utils/ac-embedder.d.ts.map +1 -0
- package/dist/src/utils/ac-embedder.js +217 -0
- package/dist/src/utils/ac-embedder.js.map +1 -0
- package/dist/src/utils/env-manager.d.ts +86 -0
- package/dist/src/utils/env-manager.d.ts.map +1 -0
- package/dist/src/utils/env-manager.js +188 -0
- package/dist/src/utils/env-manager.js.map +1 -0
- package/package.json +1 -1
- package/plugins/specweave/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave/agents/AGENTS-INDEX.md +1 -1
- package/plugins/specweave/agents/increment-quality-judge-v2/AGENT.md +9 -9
- package/plugins/specweave/commands/specweave-do.md +37 -0
- package/plugins/specweave/commands/specweave-done.md +159 -0
- package/plugins/specweave/commands/specweave-embed-acs.md +446 -0
- package/plugins/specweave/commands/specweave-next.md +148 -3
- package/plugins/specweave/commands/specweave-qa.md +2 -2
- package/plugins/specweave/hooks/pre-increment-start.sh +168 -0
- package/plugins/specweave/skills/SKILLS-INDEX.md +1 -1
- package/plugins/specweave-ado/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-ado/commands/specweave-ado-import-projects.md +331 -0
- package/plugins/specweave-alternatives/.claude-plugin/plugin.json +10 -0
- package/plugins/specweave-alternatives/commands/alternatives-analyze.md +336 -0
- package/plugins/specweave-alternatives/skills/architecture-alternatives/SKILL.md +651 -0
- package/plugins/specweave-alternatives/skills/bmad-method/SKILL.md +420 -0
- package/plugins/specweave-alternatives/skills/spec-kit-expert/SKILL.md +487 -0
- package/plugins/specweave-backend/commands/api-scaffold.md +80 -0
- package/plugins/specweave-backend/commands/crud-generate.md +109 -0
- package/plugins/specweave-backend/commands/migration-generate.md +139 -0
- package/plugins/specweave-confluent/commands/connector-deploy.md +154 -0
- package/plugins/specweave-confluent/commands/ksqldb-query.md +179 -0
- package/plugins/specweave-confluent/commands/schema-register.md +123 -0
- package/plugins/specweave-core/.claude-plugin/plugin.json +21 -0
- package/plugins/specweave-core/commands/architecture-review.md +288 -0
- package/plugins/specweave-core/commands/code-review.md +213 -0
- package/plugins/specweave-core/commands/refactor-plan.md +249 -0
- package/plugins/specweave-core/skills/code-quality/SKILL.md +157 -0
- package/plugins/specweave-core/skills/design-patterns/SKILL.md +244 -0
- package/plugins/specweave-core/skills/software-architecture/SKILL.md +83 -0
- package/plugins/specweave-cost-optimizer/.claude-plugin/plugin.json +22 -0
- package/plugins/specweave-cost-optimizer/commands/cost-analyze.md +360 -0
- package/plugins/specweave-cost-optimizer/commands/cost-optimize.md +480 -0
- package/plugins/specweave-cost-optimizer/skills/aws-cost-expert/SKILL.md +416 -0
- package/plugins/specweave-cost-optimizer/skills/cloud-pricing/SKILL.md +325 -0
- package/plugins/specweave-cost-optimizer/skills/cost-optimization/SKILL.md +337 -0
- package/plugins/specweave-diagrams/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-diagrams/commands/diagrams-generate.md +168 -0
- package/plugins/specweave-docs/.claude-plugin/plugin.json +10 -0
- package/plugins/specweave-docs/commands/docs-generate.md +441 -0
- package/plugins/specweave-docs/commands/docs-init.md +334 -0
- package/plugins/specweave-docs/skills/docusaurus/SKILL.md +581 -0
- package/plugins/specweave-docs/skills/spec-driven-brainstorming/SKILL.md +689 -0
- package/plugins/specweave-docs/skills/technical-writing/SKILL.md +1039 -0
- package/plugins/specweave-docs-preview/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-figma/.claude-plugin/plugin.json +23 -0
- package/plugins/specweave-figma/commands/figma-import.md +690 -0
- package/plugins/specweave-figma/commands/figma-to-react.md +834 -0
- package/plugins/specweave-figma/commands/figma-tokens.md +815 -0
- package/plugins/specweave-frontend/.claude-plugin/plugin.json +21 -0
- package/plugins/specweave-frontend/agents/frontend-architect/AGENT.md +408 -0
- package/plugins/specweave-frontend/agents/frontend-architect/README.md +385 -0
- package/plugins/specweave-frontend/agents/frontend-architect/examples.md +590 -0
- package/plugins/specweave-frontend/agents/frontend-architect/templates/component-template.tsx +152 -0
- package/plugins/specweave-frontend/agents/frontend-architect/templates/hook-template.ts +311 -0
- package/plugins/specweave-frontend/agents/frontend-architect/templates/page-template.tsx +228 -0
- package/plugins/specweave-frontend/commands/component-generate.md +510 -0
- package/plugins/specweave-frontend/commands/design-system-init.md +494 -0
- package/plugins/specweave-frontend/commands/frontend-scaffold.md +207 -0
- package/plugins/specweave-frontend/commands/nextjs-setup.md +396 -0
- package/plugins/specweave-frontend/skills/design-system-architect/SKILL.md +278 -0
- package/plugins/specweave-frontend/skills/frontend/SKILL.md +420 -0
- package/plugins/specweave-frontend/skills/nextjs/SKILL.md +546 -0
- package/plugins/specweave-github/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +212 -0
- package/plugins/specweave-infrastructure/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-jira/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-jira/commands/import-projects.js +183 -0
- package/plugins/specweave-jira/commands/import-projects.md +97 -0
- package/plugins/specweave-jira/commands/import-projects.ts +288 -0
- package/plugins/specweave-jira/commands/specweave-jira-import-projects.md +298 -0
- package/plugins/specweave-kafka/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-kafka-streams/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-kubernetes/commands/cluster-setup.md +262 -0
- package/plugins/specweave-kubernetes/commands/deployment-generate.md +242 -0
- package/plugins/specweave-kubernetes/commands/helm-scaffold.md +333 -0
- package/plugins/specweave-ml/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-mobile/commands/app-scaffold.md +233 -0
- package/plugins/specweave-mobile/commands/build-config.md +256 -0
- package/plugins/specweave-mobile/commands/screen-generate.md +289 -0
- package/plugins/specweave-n8n/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-payments/commands/stripe-setup.md +931 -0
- package/plugins/specweave-payments/commands/subscription-flow.md +1193 -0
- package/plugins/specweave-payments/commands/subscription-manage.md +386 -0
- package/plugins/specweave-payments/commands/webhook-setup.md +295 -0
- package/plugins/specweave-plugin-dev/.claude-plugin/plugin.json +13 -12
- package/plugins/specweave-plugin-dev/commands/plugin-create.md +333 -0
- package/plugins/specweave-plugin-dev/commands/plugin-publish.md +339 -0
- package/plugins/specweave-plugin-dev/commands/plugin-test.md +293 -0
- package/plugins/specweave-plugin-dev/skills/claude-sdk/SKILL.md +162 -0
- package/plugins/specweave-plugin-dev/skills/marketplace-publishing/SKILL.md +263 -0
- package/plugins/specweave-plugin-dev/skills/plugin-development/SKILL.md +316 -0
- package/plugins/specweave-release/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-release/commands/specweave-release-npm.md +110 -0
- package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +168 -0
- package/plugins/specweave-testing/.claude-plugin/plugin.json +21 -0
- package/plugins/specweave-testing/agents/qa-engineer/AGENT.md +818 -0
- package/plugins/specweave-testing/agents/qa-engineer/README.md +443 -0
- package/plugins/specweave-testing/agents/qa-engineer/templates/playwright-e2e-test.ts +470 -0
- package/plugins/specweave-testing/agents/qa-engineer/templates/test-data-factory.ts +507 -0
- package/plugins/specweave-testing/agents/qa-engineer/templates/vitest-unit-test.ts +400 -0
- package/plugins/specweave-testing/agents/qa-engineer/test-strategies.md +726 -0
- package/plugins/specweave-testing/commands/e2e-setup.md +1081 -0
- package/plugins/specweave-testing/commands/test-coverage.md +979 -0
- package/plugins/specweave-testing/commands/test-generate.md +1156 -0
- package/plugins/specweave-testing/commands/test-init.md +409 -0
- package/plugins/specweave-testing/skills/e2e-playwright/SKILL.md +769 -0
- package/plugins/specweave-testing/skills/tdd-expert/SKILL.md +934 -0
- package/plugins/specweave-testing/skills/unit-testing-expert/SKILL.md +1011 -0
- package/plugins/specweave-tooling/.claude-plugin/plugin.json +22 -0
- package/plugins/specweave-tooling/commands/specweave-tooling-skill-create.md +691 -0
- package/plugins/specweave-tooling/commands/specweave-tooling-skill-package.md +751 -0
- package/plugins/specweave-tooling/commands/specweave-tooling-skill-validate.md +858 -0
- package/plugins/specweave-ui/.claude-plugin/plugin.json +10 -0
- package/plugins/specweave-ui/commands/ui-automate.md +199 -0
- package/plugins/specweave-ui/commands/ui-inspect.md +70 -0
- package/plugins/specweave-ui/skills/browser-automation/SKILL.md +314 -0
- package/plugins/specweave-ui/skills/ui-testing/SKILL.md +716 -0
- package/plugins/specweave-ui/skills/visual-regression/SKILL.md +728 -0
- package/plugins/specweave/commands/check-hooks.md +0 -257
- package/plugins/specweave/commands/specweave-archive-increments.md +0 -82
- package/plugins/specweave-plugin-dev/skills/plugin-expert/SKILL.md +0 -1231
- /package/plugins/specweave/{agents/code-reviewer.md → skills/code-reviewer/SKILL.md} +0 -0
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
# Kubernetes Cluster Setup
|
|
2
|
+
|
|
3
|
+
Set up a production-ready Kubernetes cluster with essential components.
|
|
4
|
+
|
|
5
|
+
## Task
|
|
6
|
+
|
|
7
|
+
You are a Kubernetes infrastructure expert. Guide users through setting up a production cluster.
|
|
8
|
+
|
|
9
|
+
### Steps:
|
|
10
|
+
|
|
11
|
+
1. **Ask for Platform**:
|
|
12
|
+
- Managed (EKS, GKE, AKS)
|
|
13
|
+
- Self-hosted (kubeadm, k3s, kind)
|
|
14
|
+
- Local dev (minikube, kind, k3d)
|
|
15
|
+
|
|
16
|
+
2. **Generate Cluster Configuration**:
|
|
17
|
+
|
|
18
|
+
#### EKS (AWS):
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# eksctl config
|
|
22
|
+
apiVersion: eksctl.io/v1alpha5
|
|
23
|
+
kind: ClusterConfig
|
|
24
|
+
|
|
25
|
+
metadata:
|
|
26
|
+
name: production-cluster
|
|
27
|
+
region: us-east-1
|
|
28
|
+
version: "1.28"
|
|
29
|
+
|
|
30
|
+
managedNodeGroups:
|
|
31
|
+
- name: general-purpose
|
|
32
|
+
instanceType: t3.medium
|
|
33
|
+
minSize: 3
|
|
34
|
+
maxSize: 10
|
|
35
|
+
desiredCapacity: 3
|
|
36
|
+
volumeSize: 50
|
|
37
|
+
ssh:
|
|
38
|
+
allow: true
|
|
39
|
+
labels:
|
|
40
|
+
workload-type: general
|
|
41
|
+
tags:
|
|
42
|
+
nodegroup-role: general-purpose
|
|
43
|
+
iam:
|
|
44
|
+
withAddonPolicies:
|
|
45
|
+
autoScaler: true
|
|
46
|
+
certManager: true
|
|
47
|
+
externalDNS: true
|
|
48
|
+
ebs: true
|
|
49
|
+
efs: true
|
|
50
|
+
|
|
51
|
+
addons:
|
|
52
|
+
- name: vpc-cni
|
|
53
|
+
- name: coredns
|
|
54
|
+
- name: kube-proxy
|
|
55
|
+
- name: aws-ebs-csi-driver
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
#### GKE (Google Cloud):
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
gcloud container clusters create production-cluster \
|
|
62
|
+
--region us-central1 \
|
|
63
|
+
--num-nodes 3 \
|
|
64
|
+
--machine-type n1-standard-2 \
|
|
65
|
+
--disk-size 50 \
|
|
66
|
+
--enable-autoscaling \
|
|
67
|
+
--min-nodes 3 \
|
|
68
|
+
--max-nodes 10 \
|
|
69
|
+
--enable-autorepair \
|
|
70
|
+
--enable-autoupgrade \
|
|
71
|
+
--maintenance-window-start "2024-01-01T00:00:00Z" \
|
|
72
|
+
--maintenance-window-duration 4h \
|
|
73
|
+
--addons HorizontalPodAutoscaling,HttpLoadBalancing,GcePersistentDiskCsiDriver \
|
|
74
|
+
--workload-pool=production-cluster.svc.id.goog \
|
|
75
|
+
--enable-shielded-nodes \
|
|
76
|
+
--enable-ip-alias \
|
|
77
|
+
--network default \
|
|
78
|
+
--subnetwork default \
|
|
79
|
+
--cluster-version latest
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
#### AKS (Azure):
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
az aks create \
|
|
86
|
+
--resource-group production-rg \
|
|
87
|
+
--name production-cluster \
|
|
88
|
+
--location eastus \
|
|
89
|
+
--kubernetes-version 1.28.0 \
|
|
90
|
+
--node-count 3 \
|
|
91
|
+
--node-vm-size Standard_D2s_v3 \
|
|
92
|
+
--enable-cluster-autoscaler \
|
|
93
|
+
--min-count 3 \
|
|
94
|
+
--max-count 10 \
|
|
95
|
+
--network-plugin azure \
|
|
96
|
+
--enable-managed-identity \
|
|
97
|
+
--enable-pod-security-policy \
|
|
98
|
+
--enable-addons monitoring,azure-policy \
|
|
99
|
+
--generate-ssh-keys
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
3. **Install Essential Add-ons**:
|
|
103
|
+
|
|
104
|
+
#### Ingress Controller (NGINX):
|
|
105
|
+
|
|
106
|
+
```yaml
|
|
107
|
+
# Helm install
|
|
108
|
+
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
|
|
109
|
+
helm upgrade --install ingress-nginx ingress-nginx/ingress-nginx \
|
|
110
|
+
--namespace ingress-nginx \
|
|
111
|
+
--create-namespace \
|
|
112
|
+
--set controller.replicaCount=3 \
|
|
113
|
+
--set controller.service.type=LoadBalancer \
|
|
114
|
+
--set controller.metrics.enabled=true
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
#### Cert-Manager (TLS certificates):
|
|
118
|
+
|
|
119
|
+
```yaml
|
|
120
|
+
helm repo add jetstack https://charts.jetstack.io
|
|
121
|
+
helm upgrade --install cert-manager jetstack/cert-manager \
|
|
122
|
+
--namespace cert-manager \
|
|
123
|
+
--create-namespace \
|
|
124
|
+
--set installCRDs=true
|
|
125
|
+
|
|
126
|
+
# ClusterIssuer for Let's Encrypt
|
|
127
|
+
apiVersion: cert-manager.io/v1
|
|
128
|
+
kind: ClusterIssuer
|
|
129
|
+
metadata:
|
|
130
|
+
name: letsencrypt-prod
|
|
131
|
+
spec:
|
|
132
|
+
acme:
|
|
133
|
+
server: https://acme-v02.api.letsencrypt.org/directory
|
|
134
|
+
email: admin@example.com
|
|
135
|
+
privateKeySecretRef:
|
|
136
|
+
name: letsencrypt-prod
|
|
137
|
+
solvers:
|
|
138
|
+
- http01:
|
|
139
|
+
ingress:
|
|
140
|
+
class: nginx
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
#### Prometheus + Grafana (Monitoring):
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
|
|
147
|
+
helm upgrade --install kube-prometheus-stack prometheus-community/kube-prometheus-stack \
|
|
148
|
+
--namespace monitoring \
|
|
149
|
+
--create-namespace \
|
|
150
|
+
--set prometheus.prometheusSpec.retention=30d \
|
|
151
|
+
--set prometheus.prometheusSpec.storageSpec.volumeClaimTemplate.spec.resources.requests.storage=50Gi \
|
|
152
|
+
--set grafana.adminPassword=admin123
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
#### External DNS (auto DNS records):
|
|
156
|
+
|
|
157
|
+
```yaml
|
|
158
|
+
helm repo add external-dns https://kubernetes-sigs.github.io/external-dns/
|
|
159
|
+
helm upgrade --install external-dns external-dns/external-dns \
|
|
160
|
+
--namespace kube-system \
|
|
161
|
+
--set provider=aws \ # or google, azure
|
|
162
|
+
--set txtOwnerId=production-cluster \
|
|
163
|
+
--set policy=sync
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
#### ArgoCD (GitOps):
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
kubectl create namespace argocd
|
|
170
|
+
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
|
|
171
|
+
|
|
172
|
+
# Access UI
|
|
173
|
+
kubectl port-forward svc/argocd-server -n argocd 8080:443
|
|
174
|
+
|
|
175
|
+
# Get admin password
|
|
176
|
+
kubectl -n argocd get secret argocd-initial-admin-secret \
|
|
177
|
+
-o jsonpath="{.data.password}" | base64 -d
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
4. **Security Setup**:
|
|
181
|
+
|
|
182
|
+
#### Network Policies:
|
|
183
|
+
|
|
184
|
+
```yaml
|
|
185
|
+
# Default deny all
|
|
186
|
+
apiVersion: networking.k8s.io/v1
|
|
187
|
+
kind: NetworkPolicy
|
|
188
|
+
metadata:
|
|
189
|
+
name: default-deny-all
|
|
190
|
+
spec:
|
|
191
|
+
podSelector: {}
|
|
192
|
+
policyTypes:
|
|
193
|
+
- Ingress
|
|
194
|
+
- Egress
|
|
195
|
+
|
|
196
|
+
# Allow DNS
|
|
197
|
+
apiVersion: networking.k8s.io/v1
|
|
198
|
+
kind: NetworkPolicy
|
|
199
|
+
metadata:
|
|
200
|
+
name: allow-dns
|
|
201
|
+
spec:
|
|
202
|
+
podSelector: {}
|
|
203
|
+
policyTypes:
|
|
204
|
+
- Egress
|
|
205
|
+
egress:
|
|
206
|
+
- to:
|
|
207
|
+
- namespaceSelector:
|
|
208
|
+
matchLabels:
|
|
209
|
+
name: kube-system
|
|
210
|
+
ports:
|
|
211
|
+
- protocol: UDP
|
|
212
|
+
port: 53
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
#### Pod Security Standards:
|
|
216
|
+
|
|
217
|
+
```yaml
|
|
218
|
+
apiVersion: v1
|
|
219
|
+
kind: Namespace
|
|
220
|
+
metadata:
|
|
221
|
+
name: production
|
|
222
|
+
labels:
|
|
223
|
+
pod-security.kubernetes.io/enforce: restricted
|
|
224
|
+
pod-security.kubernetes.io/audit: restricted
|
|
225
|
+
pod-security.kubernetes.io/warn: restricted
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
5. **Storage Classes**:
|
|
229
|
+
|
|
230
|
+
```yaml
|
|
231
|
+
# Fast SSD storage
|
|
232
|
+
apiVersion: storage.k8s.io/v1
|
|
233
|
+
kind: StorageClass
|
|
234
|
+
metadata:
|
|
235
|
+
name: fast
|
|
236
|
+
provisioner: ebs.csi.aws.com # or pd.csi.storage.gke.io, disk.csi.azure.com
|
|
237
|
+
parameters:
|
|
238
|
+
type: gp3
|
|
239
|
+
iops: "3000"
|
|
240
|
+
throughput: "125"
|
|
241
|
+
volumeBindingMode: WaitForFirstConsumer
|
|
242
|
+
allowVolumeExpansion: true
|
|
243
|
+
reclaimPolicy: Delete
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### Best Practices Included:
|
|
247
|
+
|
|
248
|
+
- Multi-AZ/region deployment
|
|
249
|
+
- Auto-scaling (cluster and pods)
|
|
250
|
+
- Monitoring and logging
|
|
251
|
+
- TLS certificate automation
|
|
252
|
+
- GitOps with ArgoCD
|
|
253
|
+
- Network policies
|
|
254
|
+
- Resource quotas
|
|
255
|
+
- RBAC configuration
|
|
256
|
+
|
|
257
|
+
### Example Usage:
|
|
258
|
+
|
|
259
|
+
```
|
|
260
|
+
User: "Set up production EKS cluster with monitoring"
|
|
261
|
+
Result: Complete EKS config + all essential add-ons
|
|
262
|
+
```
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
# Kubernetes Deployment Generator
|
|
2
|
+
|
|
3
|
+
Generate production-ready Kubernetes deployment manifests.
|
|
4
|
+
|
|
5
|
+
## Task
|
|
6
|
+
|
|
7
|
+
You are a Kubernetes expert. Generate complete deployment manifests with best practices.
|
|
8
|
+
|
|
9
|
+
### Steps:
|
|
10
|
+
|
|
11
|
+
1. **Ask for Required Information**:
|
|
12
|
+
- Application name
|
|
13
|
+
- Docker image
|
|
14
|
+
- Port(s)
|
|
15
|
+
- Environment variables
|
|
16
|
+
- Resource requirements
|
|
17
|
+
- Replicas
|
|
18
|
+
|
|
19
|
+
2. **Generate Deployment Manifest**:
|
|
20
|
+
|
|
21
|
+
```yaml
|
|
22
|
+
apiVersion: apps/v1
|
|
23
|
+
kind: Deployment
|
|
24
|
+
metadata:
|
|
25
|
+
name: myapp
|
|
26
|
+
labels:
|
|
27
|
+
app: myapp
|
|
28
|
+
version: v1.0.0
|
|
29
|
+
annotations:
|
|
30
|
+
kubernetes.io/change-cause: "Initial deployment"
|
|
31
|
+
spec:
|
|
32
|
+
replicas: 3
|
|
33
|
+
strategy:
|
|
34
|
+
type: RollingUpdate
|
|
35
|
+
rollingUpdate:
|
|
36
|
+
maxSurge: 1
|
|
37
|
+
maxUnavailable: 0
|
|
38
|
+
selector:
|
|
39
|
+
matchLabels:
|
|
40
|
+
app: myapp
|
|
41
|
+
template:
|
|
42
|
+
metadata:
|
|
43
|
+
labels:
|
|
44
|
+
app: myapp
|
|
45
|
+
version: v1.0.0
|
|
46
|
+
annotations:
|
|
47
|
+
prometheus.io/scrape: "true"
|
|
48
|
+
prometheus.io/port: "8080"
|
|
49
|
+
prometheus.io/path: "/metrics"
|
|
50
|
+
spec:
|
|
51
|
+
# Security context
|
|
52
|
+
securityContext:
|
|
53
|
+
runAsNonRoot: true
|
|
54
|
+
runAsUser: 1000
|
|
55
|
+
fsGroup: 2000
|
|
56
|
+
|
|
57
|
+
# Init containers (if needed)
|
|
58
|
+
initContainers:
|
|
59
|
+
- name: init-db
|
|
60
|
+
image: busybox:1.36
|
|
61
|
+
command: ['sh', '-c', 'until nc -z postgres 5432; do echo waiting for db; sleep 2; done;']
|
|
62
|
+
|
|
63
|
+
containers:
|
|
64
|
+
- name: myapp
|
|
65
|
+
image: myapp:1.0.0
|
|
66
|
+
imagePullPolicy: IfNotPresent
|
|
67
|
+
|
|
68
|
+
# Ports
|
|
69
|
+
ports:
|
|
70
|
+
- name: http
|
|
71
|
+
containerPort: 8080
|
|
72
|
+
protocol: TCP
|
|
73
|
+
|
|
74
|
+
# Environment variables
|
|
75
|
+
env:
|
|
76
|
+
- name: NODE_ENV
|
|
77
|
+
value: "production"
|
|
78
|
+
- name: DB_HOST
|
|
79
|
+
valueFrom:
|
|
80
|
+
configMapKeyRef:
|
|
81
|
+
name: myapp-config
|
|
82
|
+
key: db-host
|
|
83
|
+
- name: DB_PASSWORD
|
|
84
|
+
valueFrom:
|
|
85
|
+
secretKeyRef:
|
|
86
|
+
name: myapp-secrets
|
|
87
|
+
key: db-password
|
|
88
|
+
|
|
89
|
+
# Resource limits
|
|
90
|
+
resources:
|
|
91
|
+
requests:
|
|
92
|
+
memory: "256Mi"
|
|
93
|
+
cpu: "250m"
|
|
94
|
+
limits:
|
|
95
|
+
memory: "512Mi"
|
|
96
|
+
cpu: "500m"
|
|
97
|
+
|
|
98
|
+
# Health checks
|
|
99
|
+
livenessProbe:
|
|
100
|
+
httpGet:
|
|
101
|
+
path: /health
|
|
102
|
+
port: http
|
|
103
|
+
initialDelaySeconds: 30
|
|
104
|
+
periodSeconds: 10
|
|
105
|
+
timeoutSeconds: 5
|
|
106
|
+
failureThreshold: 3
|
|
107
|
+
|
|
108
|
+
readinessProbe:
|
|
109
|
+
httpGet:
|
|
110
|
+
path: /ready
|
|
111
|
+
port: http
|
|
112
|
+
initialDelaySeconds: 10
|
|
113
|
+
periodSeconds: 5
|
|
114
|
+
timeoutSeconds: 3
|
|
115
|
+
failureThreshold: 3
|
|
116
|
+
|
|
117
|
+
# Volume mounts
|
|
118
|
+
volumeMounts:
|
|
119
|
+
- name: config
|
|
120
|
+
mountPath: /etc/config
|
|
121
|
+
readOnly: true
|
|
122
|
+
- name: cache
|
|
123
|
+
mountPath: /tmp/cache
|
|
124
|
+
|
|
125
|
+
# Volumes
|
|
126
|
+
volumes:
|
|
127
|
+
- name: config
|
|
128
|
+
configMap:
|
|
129
|
+
name: myapp-config
|
|
130
|
+
- name: cache
|
|
131
|
+
emptyDir: {}
|
|
132
|
+
|
|
133
|
+
# Affinity rules
|
|
134
|
+
affinity:
|
|
135
|
+
podAntiAffinity:
|
|
136
|
+
preferredDuringSchedulingIgnoredDuringExecution:
|
|
137
|
+
- weight: 100
|
|
138
|
+
podAffinityTerm:
|
|
139
|
+
labelSelector:
|
|
140
|
+
matchExpressions:
|
|
141
|
+
- key: app
|
|
142
|
+
operator: In
|
|
143
|
+
values:
|
|
144
|
+
- myapp
|
|
145
|
+
topologyKey: kubernetes.io/hostname
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
3. **Generate Service Manifest**:
|
|
149
|
+
|
|
150
|
+
```yaml
|
|
151
|
+
apiVersion: v1
|
|
152
|
+
kind: Service
|
|
153
|
+
metadata:
|
|
154
|
+
name: myapp
|
|
155
|
+
labels:
|
|
156
|
+
app: myapp
|
|
157
|
+
spec:
|
|
158
|
+
type: ClusterIP
|
|
159
|
+
ports:
|
|
160
|
+
- port: 80
|
|
161
|
+
targetPort: http
|
|
162
|
+
protocol: TCP
|
|
163
|
+
name: http
|
|
164
|
+
selector:
|
|
165
|
+
app: myapp
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
4. **Generate ConfigMap**:
|
|
169
|
+
|
|
170
|
+
```yaml
|
|
171
|
+
apiVersion: v1
|
|
172
|
+
kind: ConfigMap
|
|
173
|
+
metadata:
|
|
174
|
+
name: myapp-config
|
|
175
|
+
data:
|
|
176
|
+
db-host: "postgres.default.svc.cluster.local"
|
|
177
|
+
log-level: "info"
|
|
178
|
+
config.json: |
|
|
179
|
+
{
|
|
180
|
+
"feature_flags": {
|
|
181
|
+
"new_feature": true
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
5. **Generate Secret** (base64 encoded):
|
|
187
|
+
|
|
188
|
+
```yaml
|
|
189
|
+
apiVersion: v1
|
|
190
|
+
kind: Secret
|
|
191
|
+
metadata:
|
|
192
|
+
name: myapp-secrets
|
|
193
|
+
type: Opaque
|
|
194
|
+
data:
|
|
195
|
+
db-password: cGFzc3dvcmQxMjM= # base64 encoded
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
6. **Generate HPA (Horizontal Pod Autoscaler)**:
|
|
199
|
+
|
|
200
|
+
```yaml
|
|
201
|
+
apiVersion: autoscaling/v2
|
|
202
|
+
kind: HorizontalPodAutoscaler
|
|
203
|
+
metadata:
|
|
204
|
+
name: myapp-hpa
|
|
205
|
+
spec:
|
|
206
|
+
scaleTargetRef:
|
|
207
|
+
apiVersion: apps/v1
|
|
208
|
+
kind: Deployment
|
|
209
|
+
name: myapp
|
|
210
|
+
minReplicas: 3
|
|
211
|
+
maxReplicas: 10
|
|
212
|
+
metrics:
|
|
213
|
+
- type: Resource
|
|
214
|
+
resource:
|
|
215
|
+
name: cpu
|
|
216
|
+
target:
|
|
217
|
+
type: Utilization
|
|
218
|
+
averageUtilization: 70
|
|
219
|
+
- type: Resource
|
|
220
|
+
resource:
|
|
221
|
+
name: memory
|
|
222
|
+
target:
|
|
223
|
+
type: Utilization
|
|
224
|
+
averageUtilization: 80
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Best Practices Included:
|
|
228
|
+
|
|
229
|
+
- Security context (non-root user)
|
|
230
|
+
- Resource requests and limits
|
|
231
|
+
- Liveness and readiness probes
|
|
232
|
+
- Rolling update strategy
|
|
233
|
+
- Pod anti-affinity
|
|
234
|
+
- ConfigMap and Secret separation
|
|
235
|
+
- Horizontal pod autoscaling
|
|
236
|
+
|
|
237
|
+
### Example Usage:
|
|
238
|
+
|
|
239
|
+
```
|
|
240
|
+
User: "Generate deployment for Node.js API on port 3000"
|
|
241
|
+
Result: Complete deployment + service + configmap + secret + HPA
|
|
242
|
+
```
|