claude-autopm 2.8.1 → 2.8.2

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.
Files changed (273) hide show
  1. package/README.md +116 -8
  2. package/bin/autopm.js +2 -0
  3. package/bin/commands/plugin.js +395 -0
  4. package/bin/commands/team.js +184 -10
  5. package/install/install.js +223 -4
  6. package/lib/plugins/PluginManager.js +1328 -0
  7. package/lib/plugins/PluginManager.old.js +400 -0
  8. package/package.json +4 -1
  9. package/scripts/publish-plugins.sh +166 -0
  10. package/autopm/.claude/agents/cloud/README.md +0 -55
  11. package/autopm/.claude/agents/cloud/aws-cloud-architect.md +0 -521
  12. package/autopm/.claude/agents/cloud/azure-cloud-architect.md +0 -436
  13. package/autopm/.claude/agents/cloud/gcp-cloud-architect.md +0 -385
  14. package/autopm/.claude/agents/cloud/gcp-cloud-functions-engineer.md +0 -306
  15. package/autopm/.claude/agents/cloud/gemini-api-expert.md +0 -880
  16. package/autopm/.claude/agents/cloud/kubernetes-orchestrator.md +0 -566
  17. package/autopm/.claude/agents/cloud/openai-python-expert.md +0 -1087
  18. package/autopm/.claude/agents/cloud/terraform-infrastructure-expert.md +0 -454
  19. package/autopm/.claude/agents/core/agent-manager.md +0 -296
  20. package/autopm/.claude/agents/core/code-analyzer.md +0 -131
  21. package/autopm/.claude/agents/core/file-analyzer.md +0 -162
  22. package/autopm/.claude/agents/core/test-runner.md +0 -200
  23. package/autopm/.claude/agents/data/airflow-orchestration-expert.md +0 -52
  24. package/autopm/.claude/agents/data/kedro-pipeline-expert.md +0 -50
  25. package/autopm/.claude/agents/data/langgraph-workflow-expert.md +0 -520
  26. package/autopm/.claude/agents/databases/README.md +0 -50
  27. package/autopm/.claude/agents/databases/bigquery-expert.md +0 -392
  28. package/autopm/.claude/agents/databases/cosmosdb-expert.md +0 -368
  29. package/autopm/.claude/agents/databases/mongodb-expert.md +0 -398
  30. package/autopm/.claude/agents/databases/postgresql-expert.md +0 -321
  31. package/autopm/.claude/agents/databases/redis-expert.md +0 -52
  32. package/autopm/.claude/agents/devops/README.md +0 -52
  33. package/autopm/.claude/agents/devops/azure-devops-specialist.md +0 -308
  34. package/autopm/.claude/agents/devops/docker-containerization-expert.md +0 -298
  35. package/autopm/.claude/agents/devops/github-operations-specialist.md +0 -335
  36. package/autopm/.claude/agents/devops/mcp-context-manager.md +0 -319
  37. package/autopm/.claude/agents/devops/observability-engineer.md +0 -574
  38. package/autopm/.claude/agents/devops/ssh-operations-expert.md +0 -1093
  39. package/autopm/.claude/agents/devops/traefik-proxy-expert.md +0 -444
  40. package/autopm/.claude/agents/frameworks/README.md +0 -64
  41. package/autopm/.claude/agents/frameworks/e2e-test-engineer.md +0 -360
  42. package/autopm/.claude/agents/frameworks/nats-messaging-expert.md +0 -254
  43. package/autopm/.claude/agents/frameworks/react-frontend-engineer.md +0 -217
  44. package/autopm/.claude/agents/frameworks/react-ui-expert.md +0 -226
  45. package/autopm/.claude/agents/frameworks/tailwindcss-expert.md +0 -770
  46. package/autopm/.claude/agents/frameworks/ux-design-expert.md +0 -244
  47. package/autopm/.claude/agents/integration/message-queue-engineer.md +0 -794
  48. package/autopm/.claude/agents/languages/README.md +0 -50
  49. package/autopm/.claude/agents/languages/bash-scripting-expert.md +0 -541
  50. package/autopm/.claude/agents/languages/javascript-frontend-engineer.md +0 -197
  51. package/autopm/.claude/agents/languages/nodejs-backend-engineer.md +0 -226
  52. package/autopm/.claude/agents/languages/python-backend-engineer.md +0 -214
  53. package/autopm/.claude/agents/languages/python-backend-expert.md +0 -289
  54. package/autopm/.claude/agents/testing/frontend-testing-engineer.md +0 -395
  55. package/autopm/.claude/commands/ai/langgraph-workflow.md +0 -65
  56. package/autopm/.claude/commands/ai/openai-chat.md +0 -65
  57. package/autopm/.claude/commands/azure/COMMANDS.md +0 -107
  58. package/autopm/.claude/commands/azure/COMMAND_MAPPING.md +0 -252
  59. package/autopm/.claude/commands/azure/INTEGRATION_FIX.md +0 -103
  60. package/autopm/.claude/commands/azure/README.md +0 -246
  61. package/autopm/.claude/commands/azure/active-work.md +0 -198
  62. package/autopm/.claude/commands/azure/aliases.md +0 -143
  63. package/autopm/.claude/commands/azure/blocked-items.md +0 -287
  64. package/autopm/.claude/commands/azure/clean.md +0 -93
  65. package/autopm/.claude/commands/azure/docs-query.md +0 -48
  66. package/autopm/.claude/commands/azure/feature-decompose.md +0 -380
  67. package/autopm/.claude/commands/azure/feature-list.md +0 -61
  68. package/autopm/.claude/commands/azure/feature-new.md +0 -115
  69. package/autopm/.claude/commands/azure/feature-show.md +0 -205
  70. package/autopm/.claude/commands/azure/feature-start.md +0 -130
  71. package/autopm/.claude/commands/azure/fix-integration-example.md +0 -93
  72. package/autopm/.claude/commands/azure/help.md +0 -150
  73. package/autopm/.claude/commands/azure/import-us.md +0 -269
  74. package/autopm/.claude/commands/azure/init.md +0 -211
  75. package/autopm/.claude/commands/azure/next-task.md +0 -262
  76. package/autopm/.claude/commands/azure/search.md +0 -160
  77. package/autopm/.claude/commands/azure/sprint-status.md +0 -235
  78. package/autopm/.claude/commands/azure/standup.md +0 -260
  79. package/autopm/.claude/commands/azure/sync-all.md +0 -99
  80. package/autopm/.claude/commands/azure/task-analyze.md +0 -186
  81. package/autopm/.claude/commands/azure/task-close.md +0 -329
  82. package/autopm/.claude/commands/azure/task-edit.md +0 -145
  83. package/autopm/.claude/commands/azure/task-list.md +0 -263
  84. package/autopm/.claude/commands/azure/task-new.md +0 -84
  85. package/autopm/.claude/commands/azure/task-reopen.md +0 -79
  86. package/autopm/.claude/commands/azure/task-show.md +0 -126
  87. package/autopm/.claude/commands/azure/task-start.md +0 -301
  88. package/autopm/.claude/commands/azure/task-status.md +0 -65
  89. package/autopm/.claude/commands/azure/task-sync.md +0 -67
  90. package/autopm/.claude/commands/azure/us-edit.md +0 -164
  91. package/autopm/.claude/commands/azure/us-list.md +0 -202
  92. package/autopm/.claude/commands/azure/us-new.md +0 -265
  93. package/autopm/.claude/commands/azure/us-parse.md +0 -253
  94. package/autopm/.claude/commands/azure/us-show.md +0 -188
  95. package/autopm/.claude/commands/azure/us-status.md +0 -320
  96. package/autopm/.claude/commands/azure/validate.md +0 -86
  97. package/autopm/.claude/commands/azure/work-item-sync.md +0 -47
  98. package/autopm/.claude/commands/cloud/infra-deploy.md +0 -38
  99. package/autopm/.claude/commands/github/workflow-create.md +0 -42
  100. package/autopm/.claude/commands/infrastructure/ssh-security.md +0 -65
  101. package/autopm/.claude/commands/infrastructure/traefik-setup.md +0 -65
  102. package/autopm/.claude/commands/kubernetes/deploy.md +0 -37
  103. package/autopm/.claude/commands/playwright/test-scaffold.md +0 -38
  104. package/autopm/.claude/commands/pm/blocked.md +0 -28
  105. package/autopm/.claude/commands/pm/clean.md +0 -119
  106. package/autopm/.claude/commands/pm/context-create.md +0 -136
  107. package/autopm/.claude/commands/pm/context-prime.md +0 -170
  108. package/autopm/.claude/commands/pm/context-update.md +0 -292
  109. package/autopm/.claude/commands/pm/context.md +0 -28
  110. package/autopm/.claude/commands/pm/epic-close.md +0 -86
  111. package/autopm/.claude/commands/pm/epic-decompose.md +0 -370
  112. package/autopm/.claude/commands/pm/epic-edit.md +0 -83
  113. package/autopm/.claude/commands/pm/epic-list.md +0 -30
  114. package/autopm/.claude/commands/pm/epic-merge.md +0 -222
  115. package/autopm/.claude/commands/pm/epic-oneshot.md +0 -119
  116. package/autopm/.claude/commands/pm/epic-refresh.md +0 -119
  117. package/autopm/.claude/commands/pm/epic-show.md +0 -28
  118. package/autopm/.claude/commands/pm/epic-split.md +0 -120
  119. package/autopm/.claude/commands/pm/epic-start.md +0 -195
  120. package/autopm/.claude/commands/pm/epic-status.md +0 -28
  121. package/autopm/.claude/commands/pm/epic-sync-modular.md +0 -338
  122. package/autopm/.claude/commands/pm/epic-sync-original.md +0 -473
  123. package/autopm/.claude/commands/pm/epic-sync.md +0 -486
  124. package/autopm/.claude/commands/pm/help.md +0 -28
  125. package/autopm/.claude/commands/pm/import.md +0 -115
  126. package/autopm/.claude/commands/pm/in-progress.md +0 -28
  127. package/autopm/.claude/commands/pm/init.md +0 -28
  128. package/autopm/.claude/commands/pm/issue-analyze.md +0 -202
  129. package/autopm/.claude/commands/pm/issue-close.md +0 -119
  130. package/autopm/.claude/commands/pm/issue-edit.md +0 -93
  131. package/autopm/.claude/commands/pm/issue-reopen.md +0 -87
  132. package/autopm/.claude/commands/pm/issue-show.md +0 -41
  133. package/autopm/.claude/commands/pm/issue-start.md +0 -234
  134. package/autopm/.claude/commands/pm/issue-status.md +0 -95
  135. package/autopm/.claude/commands/pm/issue-sync.md +0 -411
  136. package/autopm/.claude/commands/pm/next.md +0 -28
  137. package/autopm/.claude/commands/pm/prd-edit.md +0 -82
  138. package/autopm/.claude/commands/pm/prd-list.md +0 -28
  139. package/autopm/.claude/commands/pm/prd-new.md +0 -55
  140. package/autopm/.claude/commands/pm/prd-parse.md +0 -42
  141. package/autopm/.claude/commands/pm/prd-status.md +0 -28
  142. package/autopm/.claude/commands/pm/search.md +0 -28
  143. package/autopm/.claude/commands/pm/standup.md +0 -28
  144. package/autopm/.claude/commands/pm/status.md +0 -28
  145. package/autopm/.claude/commands/pm/sync.md +0 -99
  146. package/autopm/.claude/commands/pm/test-reference-update.md +0 -151
  147. package/autopm/.claude/commands/pm/validate.md +0 -28
  148. package/autopm/.claude/commands/pm/what-next.md +0 -28
  149. package/autopm/.claude/commands/python/api-scaffold.md +0 -50
  150. package/autopm/.claude/commands/python/docs-query.md +0 -48
  151. package/autopm/.claude/commands/react/app-scaffold.md +0 -50
  152. package/autopm/.claude/commands/testing/prime.md +0 -314
  153. package/autopm/.claude/commands/testing/run.md +0 -125
  154. package/autopm/.claude/commands/ui/bootstrap-scaffold.md +0 -65
  155. package/autopm/.claude/commands/ui/tailwind-system.md +0 -64
  156. package/autopm/.claude/rules/ai-integration-patterns.md +0 -219
  157. package/autopm/.claude/rules/ci-cd-kubernetes-strategy.md +0 -25
  158. package/autopm/.claude/rules/database-management-strategy.md +0 -17
  159. package/autopm/.claude/rules/database-pipeline.md +0 -94
  160. package/autopm/.claude/rules/devops-troubleshooting-playbook.md +0 -450
  161. package/autopm/.claude/rules/docker-first-development.md +0 -404
  162. package/autopm/.claude/rules/infrastructure-pipeline.md +0 -128
  163. package/autopm/.claude/rules/performance-guidelines.md +0 -403
  164. package/autopm/.claude/rules/ui-development-standards.md +0 -281
  165. package/autopm/.claude/rules/ui-framework-rules.md +0 -151
  166. package/autopm/.claude/rules/ux-design-rules.md +0 -209
  167. package/autopm/.claude/rules/visual-testing.md +0 -223
  168. package/autopm/.claude/scripts/azure/README.md +0 -192
  169. package/autopm/.claude/scripts/azure/active-work.js +0 -524
  170. package/autopm/.claude/scripts/azure/active-work.sh +0 -20
  171. package/autopm/.claude/scripts/azure/blocked.js +0 -520
  172. package/autopm/.claude/scripts/azure/blocked.sh +0 -20
  173. package/autopm/.claude/scripts/azure/daily.js +0 -533
  174. package/autopm/.claude/scripts/azure/daily.sh +0 -20
  175. package/autopm/.claude/scripts/azure/dashboard.js +0 -970
  176. package/autopm/.claude/scripts/azure/dashboard.sh +0 -20
  177. package/autopm/.claude/scripts/azure/feature-list.js +0 -254
  178. package/autopm/.claude/scripts/azure/feature-list.sh +0 -20
  179. package/autopm/.claude/scripts/azure/feature-show.js +0 -7
  180. package/autopm/.claude/scripts/azure/feature-show.sh +0 -20
  181. package/autopm/.claude/scripts/azure/feature-status.js +0 -604
  182. package/autopm/.claude/scripts/azure/feature-status.sh +0 -20
  183. package/autopm/.claude/scripts/azure/help.js +0 -342
  184. package/autopm/.claude/scripts/azure/help.sh +0 -20
  185. package/autopm/.claude/scripts/azure/next-task.js +0 -508
  186. package/autopm/.claude/scripts/azure/next-task.sh +0 -20
  187. package/autopm/.claude/scripts/azure/search.js +0 -469
  188. package/autopm/.claude/scripts/azure/search.sh +0 -20
  189. package/autopm/.claude/scripts/azure/setup.js +0 -745
  190. package/autopm/.claude/scripts/azure/setup.sh +0 -20
  191. package/autopm/.claude/scripts/azure/sprint-report.js +0 -1012
  192. package/autopm/.claude/scripts/azure/sprint-report.sh +0 -20
  193. package/autopm/.claude/scripts/azure/sync.js +0 -563
  194. package/autopm/.claude/scripts/azure/sync.sh +0 -20
  195. package/autopm/.claude/scripts/azure/us-list.js +0 -210
  196. package/autopm/.claude/scripts/azure/us-list.sh +0 -20
  197. package/autopm/.claude/scripts/azure/us-status.js +0 -238
  198. package/autopm/.claude/scripts/azure/us-status.sh +0 -20
  199. package/autopm/.claude/scripts/azure/validate.js +0 -626
  200. package/autopm/.claude/scripts/azure/validate.sh +0 -20
  201. package/autopm/.claude/scripts/azure/wrapper-template.sh +0 -20
  202. package/autopm/.claude/scripts/github/dependency-tracker.js +0 -554
  203. package/autopm/.claude/scripts/github/dependency-validator.js +0 -545
  204. package/autopm/.claude/scripts/github/dependency-visualizer.js +0 -477
  205. package/autopm/.claude/scripts/pm/analytics.js +0 -425
  206. package/autopm/.claude/scripts/pm/blocked.js +0 -164
  207. package/autopm/.claude/scripts/pm/blocked.sh +0 -78
  208. package/autopm/.claude/scripts/pm/clean.js +0 -464
  209. package/autopm/.claude/scripts/pm/context-create.js +0 -216
  210. package/autopm/.claude/scripts/pm/context-prime.js +0 -335
  211. package/autopm/.claude/scripts/pm/context-update.js +0 -344
  212. package/autopm/.claude/scripts/pm/context.js +0 -338
  213. package/autopm/.claude/scripts/pm/epic-close.js +0 -347
  214. package/autopm/.claude/scripts/pm/epic-edit.js +0 -382
  215. package/autopm/.claude/scripts/pm/epic-list.js +0 -273
  216. package/autopm/.claude/scripts/pm/epic-list.sh +0 -109
  217. package/autopm/.claude/scripts/pm/epic-show.js +0 -291
  218. package/autopm/.claude/scripts/pm/epic-show.sh +0 -105
  219. package/autopm/.claude/scripts/pm/epic-split.js +0 -522
  220. package/autopm/.claude/scripts/pm/epic-start/epic-start.js +0 -183
  221. package/autopm/.claude/scripts/pm/epic-start/epic-start.sh +0 -94
  222. package/autopm/.claude/scripts/pm/epic-status.js +0 -291
  223. package/autopm/.claude/scripts/pm/epic-status.sh +0 -104
  224. package/autopm/.claude/scripts/pm/epic-sync/README.md +0 -208
  225. package/autopm/.claude/scripts/pm/epic-sync/create-epic-issue.sh +0 -77
  226. package/autopm/.claude/scripts/pm/epic-sync/create-task-issues.sh +0 -86
  227. package/autopm/.claude/scripts/pm/epic-sync/update-epic-file.sh +0 -79
  228. package/autopm/.claude/scripts/pm/epic-sync/update-references.sh +0 -89
  229. package/autopm/.claude/scripts/pm/epic-sync.sh +0 -137
  230. package/autopm/.claude/scripts/pm/help.js +0 -92
  231. package/autopm/.claude/scripts/pm/help.sh +0 -90
  232. package/autopm/.claude/scripts/pm/in-progress.js +0 -178
  233. package/autopm/.claude/scripts/pm/in-progress.sh +0 -93
  234. package/autopm/.claude/scripts/pm/init.js +0 -321
  235. package/autopm/.claude/scripts/pm/init.sh +0 -178
  236. package/autopm/.claude/scripts/pm/issue-close.js +0 -232
  237. package/autopm/.claude/scripts/pm/issue-edit.js +0 -310
  238. package/autopm/.claude/scripts/pm/issue-show.js +0 -272
  239. package/autopm/.claude/scripts/pm/issue-start.js +0 -181
  240. package/autopm/.claude/scripts/pm/issue-sync/format-comment.sh +0 -468
  241. package/autopm/.claude/scripts/pm/issue-sync/gather-updates.sh +0 -460
  242. package/autopm/.claude/scripts/pm/issue-sync/post-comment.sh +0 -330
  243. package/autopm/.claude/scripts/pm/issue-sync/preflight-validation.sh +0 -348
  244. package/autopm/.claude/scripts/pm/issue-sync/update-frontmatter.sh +0 -387
  245. package/autopm/.claude/scripts/pm/lib/README.md +0 -85
  246. package/autopm/.claude/scripts/pm/lib/epic-discovery.js +0 -119
  247. package/autopm/.claude/scripts/pm/lib/logger.js +0 -78
  248. package/autopm/.claude/scripts/pm/next.js +0 -189
  249. package/autopm/.claude/scripts/pm/next.sh +0 -72
  250. package/autopm/.claude/scripts/pm/optimize.js +0 -407
  251. package/autopm/.claude/scripts/pm/pr-create.js +0 -337
  252. package/autopm/.claude/scripts/pm/pr-list.js +0 -257
  253. package/autopm/.claude/scripts/pm/prd-list.js +0 -242
  254. package/autopm/.claude/scripts/pm/prd-list.sh +0 -103
  255. package/autopm/.claude/scripts/pm/prd-new.js +0 -684
  256. package/autopm/.claude/scripts/pm/prd-parse.js +0 -547
  257. package/autopm/.claude/scripts/pm/prd-status.js +0 -152
  258. package/autopm/.claude/scripts/pm/prd-status.sh +0 -63
  259. package/autopm/.claude/scripts/pm/release.js +0 -460
  260. package/autopm/.claude/scripts/pm/search.js +0 -192
  261. package/autopm/.claude/scripts/pm/search.sh +0 -89
  262. package/autopm/.claude/scripts/pm/standup.js +0 -362
  263. package/autopm/.claude/scripts/pm/standup.sh +0 -95
  264. package/autopm/.claude/scripts/pm/status.js +0 -148
  265. package/autopm/.claude/scripts/pm/status.sh +0 -59
  266. package/autopm/.claude/scripts/pm/sync-batch.js +0 -337
  267. package/autopm/.claude/scripts/pm/sync.js +0 -343
  268. package/autopm/.claude/scripts/pm/template-list.js +0 -141
  269. package/autopm/.claude/scripts/pm/template-new.js +0 -366
  270. package/autopm/.claude/scripts/pm/validate.js +0 -274
  271. package/autopm/.claude/scripts/pm/validate.sh +0 -106
  272. package/autopm/.claude/scripts/pm/what-next.js +0 -660
  273. package/bin/node/azure-feature-show.js +0 -7
@@ -1,450 +0,0 @@
1
- # DevOps Troubleshooting Playbook
2
-
3
- This document contains standard procedures for resolving common issues in our CI/CD and Kubernetes environments. All DevOps agents MUST follow these guidelines.
4
-
5
- ---
6
-
7
- ## 🚀 Kubernetes CI/CD Error Debugging
8
-
9
- ### Error: `PodInitializing` or `ImagePullBackOff`
10
-
11
- **Diagnosis:** This error means the Pod cannot start. The most common cause is an issue with the init container or missing resources.
12
-
13
- **Debugging Procedure:**
14
-
15
- 1. **Add debug step to workflow:** In the workflow file (`.github/workflows/*.yml`), after the failed step, add a conditional step (`if: failure()`).
16
-
17
- 2. **Collect diagnostic information:** In the debug step, use the following commands to gather logs before the pod is deleted:
18
-
19
- ```yaml
20
- - name: 🐞 Debug Pod on Failure
21
- if: failure()
22
- run: |
23
- POD_NAME=$(kubectl get pods --selector=job-name=YOUR_JOB_NAME -o jsonpath='{.items[0].metadata.name}')
24
- echo "--- Pod Description ($POD_NAME) ---"
25
- kubectl describe pod $POD_NAME
26
- echo "--- Init Container Logs ---"
27
- kubectl logs $POD_NAME -c INIT_CONTAINER_NAME
28
- echo "--- Main Container Logs (if available) ---"
29
- kubectl logs $POD_NAME -c main || echo "Main container not yet started"
30
- echo "--- Pod Events ---"
31
- kubectl get events --field-selector involvedObject.name=$POD_NAME
32
- ```
33
-
34
- ### Error: `field is immutable`
35
-
36
- **Diagnosis:** This error indicates an attempt to modify an existing, immutable Kubernetes resource (e.g., Job).
37
-
38
- **Solution (MANDATORY):** Always delete the old resource before creating a new one. This ensures each CI/CD run is clean.
39
-
40
- **Implementation Pattern in Workflow:**
41
-
42
- ```yaml
43
- - name: 🏗️ Deploy Job with Cleanup
44
- run: |
45
- echo "🧹 Cleaning up previous job (if any)..."
46
- kubectl delete job YOUR_JOB_NAME --ignore-not-found=true
47
-
48
- # Wait for cleanup to complete
49
- kubectl wait --for=delete job/YOUR_JOB_NAME --timeout=30s 2>/dev/null || true
50
-
51
- echo "🚀 Creating new job..."
52
- cat <<EOF | kubectl apply -f -
53
- apiVersion: batch/v1
54
- kind: Job
55
- metadata:
56
- name: YOUR_JOB_NAME
57
- spec:
58
- # ... your job definition ...
59
- EOF
60
- ```
61
-
62
- ### Error: `CreateContainerConfigError`
63
-
64
- **Diagnosis:** Configuration issue preventing container creation, often related to secrets or configmaps.
65
-
66
- **Debugging Steps:**
67
-
68
- 1. Check if referenced secrets/configmaps exist:
69
-
70
- ```bash
71
- kubectl get secret YOUR_SECRET_NAME
72
- kubectl get configmap YOUR_CONFIG_NAME
73
- ```
74
-
75
- 2. Verify secret keys match what's expected:
76
-
77
- ```bash
78
- kubectl describe secret YOUR_SECRET_NAME
79
- ```
80
-
81
- 3. Check pod events for detailed error:
82
-
83
- ```bash
84
- kubectl describe pod POD_NAME | grep -A 10 Events
85
- ```
86
-
87
- ### Error: ConfigMap "..." is invalid: Too long
88
-
89
- **Diagnosis:** This error means you're trying to store data in a `ConfigMap` that exceeds the 1MB size limit.
90
-
91
- **Root Cause (Anti-pattern):** Packaging entire source code (e.g., as `.tar.gz` archive) into a `ConfigMap` to use as build context for Kaniko. ConfigMaps are designed for small configuration files, not for storing entire applications.
92
-
93
- **Solution (MANDATORY):** Deliver build context to the pod using a volume. Best practice is to use an `initContainer` that clones the repository into a shared `emptyDir` volume.
94
-
95
- **Implementation Pattern in Workflow:**
96
-
97
- ```yaml
98
- apiVersion: batch/v1
99
- kind: Job
100
- metadata:
101
- name: kaniko-build-job
102
- spec:
103
- template:
104
- spec:
105
- restartPolicy: Never
106
- initContainers:
107
- - name: prepare-build-context
108
- image: alpine/git:latest
109
- command: ['sh', '-c']
110
- args:
111
- - |
112
- git clone --depth 1 https://github.com/YOUR/REPO.git /workspace
113
- cd /workspace && git checkout $COMMIT_SHA
114
- volumeMounts:
115
- - name: workspace
116
- mountPath: /workspace
117
- containers:
118
- - name: kaniko
119
- image: gcr.io/kaniko-project/executor:latest
120
- args:
121
- - --dockerfile=/workspace/Dockerfile
122
- - --context=dir:///workspace
123
- - --destination=YOUR_REGISTRY/IMAGE:TAG
124
- - --cache=true
125
- - --cache-ttl=24h
126
- volumeMounts:
127
- - name: workspace
128
- mountPath: /workspace
129
- volumes:
130
- - name: workspace
131
- emptyDir: {}
132
- ```
133
-
134
- **Alternative Solutions:**
135
-
136
- 1. **Git Context (Recommended for public repos):**
137
-
138
- ```yaml
139
- args:
140
- - --context=git://github.com/YOUR/REPO.git#refs/heads/main
141
- - --dockerfile=Dockerfile
142
- ```
143
-
144
- 2. **S3/GCS Bucket for build context:**
145
-
146
- ```yaml
147
- args:
148
- - --context=s3://your-bucket/build-context.tar.gz
149
- - --dockerfile=Dockerfile
150
- ```
151
-
152
- 3. **Registry-based builds (for layer caching):**
153
-
154
- ```yaml
155
- args:
156
- - --cache-repo=YOUR_REGISTRY/cache
157
- - --cache=true
158
- ```
159
-
160
- ---
161
-
162
- ## 📊 Database Management Strategy
163
-
164
- Database management strategy MUST align with environment purpose:
165
-
166
- | Environment | Tool | Purpose | Persistence | Backup Strategy |
167
- |------------|------|---------|-------------|-----------------|
168
- | **Local (Dev)** | docker compose | Convenience | Yes (Named Volume) | Optional |
169
- | **Testing (CI/CD)** | kubectl | Isolation | No (Ephemeral) | Not Required |
170
- | **Staging** | Managed DB | Pre-prod Testing | Yes (PVC) | Daily |
171
- | **Production** | Managed Service | Reliability | Yes (HA + Backups) | Continuous |
172
-
173
- ### Development Database Setup
174
-
175
- ```yaml
176
- # docker-compose.yml
177
- services:
178
- postgres:
179
- image: postgres:15-alpine
180
- volumes:
181
- - postgres_data:/var/lib/postgresql/data # Named volume for persistence
182
- environment:
183
- POSTGRES_DB: ${DB_NAME:-devdb}
184
- POSTGRES_USER: ${DB_USER:-developer}
185
- POSTGRES_PASSWORD: ${DB_PASSWORD:-localpass}
186
- ports:
187
- - "5432:5432"
188
- healthcheck:
189
- test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-developer}"]
190
- interval: 10s
191
- timeout: 5s
192
- retries: 5
193
-
194
- volumes:
195
- postgres_data: # Persistent across container restarts
196
- ```
197
-
198
- ### CI/CD Database Setup
199
-
200
- ```yaml
201
- # Ephemeral database for testing
202
- apiVersion: v1
203
- kind: Service
204
- metadata:
205
- name: test-postgres
206
- spec:
207
- selector:
208
- app: test-postgres
209
- ports:
210
- - port: 5432
211
- ---
212
- apiVersion: apps/v1
213
- kind: Deployment
214
- metadata:
215
- name: test-postgres
216
- spec:
217
- replicas: 1
218
- selector:
219
- matchLabels:
220
- app: test-postgres
221
- template:
222
- metadata:
223
- labels:
224
- app: test-postgres
225
- spec:
226
- containers:
227
- - name: postgres
228
- image: postgres:15-alpine
229
- env:
230
- - name: POSTGRES_DB
231
- value: testdb
232
- - name: POSTGRES_USER
233
- value: testuser
234
- - name: POSTGRES_PASSWORD
235
- value: testpass
236
- - name: POSTGRES_HOST_AUTH_METHOD
237
- value: trust # For CI/CD only!
238
- # No volume mount - data is ephemeral
239
- ```
240
-
241
- ---
242
-
243
- ## 🔄 CI/CD Pipeline Best Practices
244
-
245
- ### GitHub Actions Kubernetes Debugging
246
-
247
- **ALWAYS include these debug steps in Kubernetes workflows:**
248
-
249
- ```yaml
250
- jobs:
251
- deploy:
252
- runs-on: ubuntu-latest
253
- steps:
254
- - name: 🎯 Deploy Application
255
- id: deploy
256
- run: |
257
- # Your deployment commands
258
- kubectl apply -f manifests/
259
-
260
- - name: 🔍 Debug on Failure
261
- if: failure()
262
- run: |
263
- echo "=== Pod Status ==="
264
- kubectl get pods -o wide
265
-
266
- echo "=== Recent Events ==="
267
- kubectl get events --sort-by='.lastTimestamp' | tail -20
268
-
269
- echo "=== Failed Pods Details ==="
270
- kubectl get pods --field-selector=status.phase!=Running,status.phase!=Succeeded -o json | \
271
- jq -r '.items[] | "\(.metadata.name): \(.status.containerStatuses[0].state)"'
272
-
273
- echo "=== Resource Usage ==="
274
- kubectl top nodes || echo "Metrics not available"
275
- kubectl top pods || echo "Metrics not available"
276
- ```
277
-
278
- ### Container Build Optimization
279
-
280
- **Cache layers effectively in CI/CD:**
281
-
282
- ```dockerfile
283
- # Good: Dependencies first (cached often)
284
- FROM node:18-alpine AS deps
285
- WORKDIR /app
286
- COPY package*.json ./
287
- RUN npm ci --only=production
288
-
289
- # Bad: Everything at once (cache busted on any change)
290
- FROM node:18-alpine
291
- COPY . .
292
- RUN npm install
293
- ```
294
-
295
- ---
296
-
297
- ## 🛡️ Security Best Practices
298
-
299
- ### Secret Management
300
-
301
- **NEVER hardcode secrets. Use this hierarchy:**
302
-
303
- 1. **Local Development:** `.env` files (gitignored)
304
- 2. **CI/CD:** GitHub Secrets / Environment Variables
305
- 3. **Kubernetes:** Secrets or External Secrets Operator
306
- 4. **Production:** Vault, AWS Secrets Manager, or Azure Key Vault
307
-
308
- **Example Secret Injection Pattern:**
309
-
310
- ```yaml
311
- # GitHub Actions
312
- - name: 🔐 Inject Secrets
313
- run: |
314
- kubectl create secret generic app-secrets \
315
- --from-literal=db-password=${{ secrets.DB_PASSWORD }} \
316
- --from-literal=api-key=${{ secrets.API_KEY }} \
317
- --dry-run=client -o yaml | kubectl apply -f -
318
- ```
319
-
320
- ---
321
-
322
- ## 🔧 Common Debugging Commands
323
-
324
- ### Quick Diagnostics Checklist
325
-
326
- ```bash
327
- # 1. Check pod status
328
- kubectl get pods -A | grep -v Running
329
-
330
- # 2. Get pod logs
331
- kubectl logs POD_NAME --previous # If pod restarted
332
- kubectl logs POD_NAME -f # Follow logs
333
-
334
- # 3. Shell into pod
335
- kubectl exec -it POD_NAME -- /bin/sh
336
-
337
- # 4. Check resource consumption
338
- kubectl top pods
339
- kubectl describe node
340
-
341
- # 5. Check recent errors
342
- kubectl get events --sort-by='.lastTimestamp' | grep Warning
343
-
344
- # 6. Verify service endpoints
345
- kubectl get endpoints
346
-
347
- # 7. Test service connectivity
348
- kubectl run debug --image=busybox:1.28 --rm -it --restart=Never -- wget -O- SERVICE_NAME:PORT
349
- ```
350
-
351
- ### Emergency Rollback Procedure
352
-
353
- ```bash
354
- # 1. Quick rollback to previous deployment
355
- kubectl rollout undo deployment/APP_NAME
356
-
357
- # 2. Check rollback status
358
- kubectl rollout status deployment/APP_NAME
359
-
360
- # 3. Verify pods are healthy
361
- kubectl get pods -l app=APP_NAME
362
-
363
- # 4. If still broken, scale to zero and debug
364
- kubectl scale deployment/APP_NAME --replicas=0
365
- # Fix issues...
366
- kubectl scale deployment/APP_NAME --replicas=3
367
- ```
368
-
369
- ---
370
-
371
- ## 📝 Logging and Monitoring
372
-
373
- ### Structured Logging Requirements
374
-
375
- All applications MUST:
376
-
377
- 1. Log in JSON format for parsing
378
- 2. Include correlation IDs for request tracing
379
- 3. Use appropriate log levels (DEBUG, INFO, WARN, ERROR)
380
- 4. Never log sensitive data (passwords, tokens, PII)
381
-
382
- **Example Structured Log:**
383
-
384
- ```json
385
- {
386
- "timestamp": "2024-01-15T10:30:00Z",
387
- "level": "ERROR",
388
- "correlation_id": "abc-123-def",
389
- "service": "api-gateway",
390
- "message": "Database connection failed",
391
- "error": "connection timeout after 30s",
392
- "retry_count": 3
393
- }
394
- ```
395
-
396
- ---
397
-
398
- ## 🚨 Incident Response Template
399
-
400
- When production issues occur, follow this template:
401
-
402
- ```markdown
403
- ## Incident Report
404
-
405
- **Date:** YYYY-MM-DD HH:MM UTC
406
- **Severity:** Critical | High | Medium | Low
407
- **Duration:** XX minutes
408
-
409
- ### Impact
410
- - What broke and who was affected
411
-
412
- ### Root Cause
413
- - Technical reason for the failure
414
-
415
- ### Resolution
416
- - Steps taken to fix
417
-
418
- ### Prevention
419
- - Changes to prevent recurrence
420
-
421
- ### Timeline
422
- - HH:MM - Issue detected
423
- - HH:MM - Team notified
424
- - HH:MM - Root cause identified
425
- - HH:MM - Fix deployed
426
- - HH:MM - Service restored
427
- ```
428
-
429
- ---
430
-
431
- ## 🎯 Golden Rules
432
-
433
- 1. **Always clean before create** - Delete old resources before creating new ones
434
- 2. **Debug immediately on failure** - Add conditional debug steps to all CI/CD workflows
435
- 3. **Never assume, always verify** - Check that resources exist before using them
436
- 4. **Fail fast, recover faster** - Quick detection and rollback procedures
437
- 5. **Document everything** - If it's not documented, it didn't happen
438
-
439
- ---
440
-
441
- ## 📚 References
442
-
443
- - [Kubernetes Troubleshooting Guide](https://kubernetes.io/docs/tasks/debug/)
444
- - [GitHub Actions Best Practices](https://docs.github.com/en/actions/guides)
445
- - [12 Factor App Methodology](https://12factor.net/)
446
- - [SRE Principles](https://sre.google/sre-book/table-of-contents/)
447
-
448
- ---
449
-
450
- **Remember:** This playbook is a living document. Update it with new solutions as we discover them.