@vfarcic/dot-ai 0.116.0 → 0.117.0

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 (129) hide show
  1. package/README.md +21 -18
  2. package/dist/core/ai-provider-factory.d.ts +4 -2
  3. package/dist/core/ai-provider-factory.d.ts.map +1 -1
  4. package/dist/core/ai-provider-factory.js +17 -6
  5. package/dist/core/capability-operations.js +1 -1
  6. package/dist/core/generic-session-manager.d.ts +67 -0
  7. package/dist/core/generic-session-manager.d.ts.map +1 -0
  8. package/dist/core/generic-session-manager.js +192 -0
  9. package/dist/core/pattern-operations.js +1 -1
  10. package/dist/core/providers/noop-provider.d.ts +47 -0
  11. package/dist/core/providers/noop-provider.d.ts.map +1 -0
  12. package/dist/core/providers/noop-provider.js +63 -0
  13. package/dist/core/schema.d.ts.map +1 -1
  14. package/dist/core/schema.js +13 -13
  15. package/dist/core/session-utils.d.ts +3 -6
  16. package/dist/core/session-utils.d.ts.map +1 -1
  17. package/dist/core/session-utils.js +5 -13
  18. package/dist/core/shared-prompt-loader.d.ts +15 -3
  19. package/dist/core/shared-prompt-loader.d.ts.map +1 -1
  20. package/dist/core/shared-prompt-loader.js +67 -14
  21. package/dist/core/unified-creation-session.d.ts +3 -10
  22. package/dist/core/unified-creation-session.d.ts.map +1 -1
  23. package/dist/core/unified-creation-session.js +34 -75
  24. package/dist/core/unified-creation-types.d.ts +31 -22
  25. package/dist/core/unified-creation-types.d.ts.map +1 -1
  26. package/dist/interfaces/mcp.d.ts.map +1 -1
  27. package/dist/interfaces/mcp.js +9 -34
  28. package/dist/tools/answer-question.d.ts.map +1 -1
  29. package/dist/tools/answer-question.js +12 -12
  30. package/dist/tools/choose-solution.js +1 -1
  31. package/dist/tools/generate-manifests.d.ts.map +1 -1
  32. package/dist/tools/generate-manifests.js +9 -10
  33. package/dist/tools/index.d.ts +1 -1
  34. package/dist/tools/index.d.ts.map +1 -1
  35. package/dist/tools/index.js +6 -6
  36. package/dist/tools/organizational-data.js +12 -12
  37. package/dist/tools/project-setup/discovery.d.ts +15 -0
  38. package/dist/tools/project-setup/discovery.d.ts.map +1 -0
  39. package/dist/tools/project-setup/discovery.js +104 -0
  40. package/dist/tools/project-setup/generate-scope.d.ts +15 -0
  41. package/dist/tools/project-setup/generate-scope.d.ts.map +1 -0
  42. package/dist/tools/project-setup/generate-scope.js +237 -0
  43. package/dist/tools/project-setup/report-scan.d.ts +15 -0
  44. package/dist/tools/project-setup/report-scan.d.ts.map +1 -0
  45. package/dist/tools/project-setup/report-scan.js +156 -0
  46. package/dist/tools/project-setup/types.d.ts +111 -0
  47. package/dist/tools/project-setup/types.d.ts.map +1 -0
  48. package/dist/tools/project-setup/types.js +8 -0
  49. package/dist/tools/project-setup.d.ts +28 -0
  50. package/dist/tools/project-setup.d.ts.map +1 -0
  51. package/dist/tools/project-setup.js +134 -0
  52. package/dist/tools/recommend.js +1 -1
  53. package/dist/tools/remediate.js +1 -1
  54. package/dist/tools/version.d.ts +0 -7
  55. package/dist/tools/version.d.ts.map +1 -1
  56. package/dist/tools/version.js +5 -34
  57. package/package.json +4 -2
  58. package/prompts/capability-inference.md +2 -2
  59. package/prompts/infrastructure-trigger-expansion.md +2 -2
  60. package/prompts/intent-analysis.md +2 -2
  61. package/prompts/kyverno-generation.md +14 -14
  62. package/prompts/manifest-generation.md +5 -5
  63. package/prompts/map-intent-to-operation.md +2 -2
  64. package/prompts/pattern-complete-error.md +1 -1
  65. package/prompts/pattern-complete-success.md +4 -4
  66. package/prompts/pattern-rationale.md +1 -1
  67. package/prompts/pattern-resources.md +1 -1
  68. package/prompts/pattern-review.md +5 -5
  69. package/prompts/policy-complete-apply.md +4 -4
  70. package/prompts/policy-complete-discard.md +1 -1
  71. package/prompts/policy-complete-error.md +1 -1
  72. package/prompts/policy-complete-save.md +4 -4
  73. package/prompts/policy-complete-success.md +4 -4
  74. package/prompts/policy-namespace-scope.md +1 -1
  75. package/prompts/question-generation.md +5 -5
  76. package/prompts/resource-analysis.md +3 -3
  77. package/prompts/resource-selection.md +3 -3
  78. package/prompts/solution-enhancement.md +4 -4
  79. package/scripts/anthropic.nu +9 -13
  80. package/scripts/common.nu +31 -33
  81. package/scripts/ingress.nu +5 -4
  82. package/scripts/kubernetes.nu +38 -53
  83. package/dist/core/doc-discovery.d.ts +0 -38
  84. package/dist/core/doc-discovery.d.ts.map +0 -1
  85. package/dist/core/doc-discovery.js +0 -231
  86. package/dist/core/doc-testing-session.d.ts +0 -109
  87. package/dist/core/doc-testing-session.d.ts.map +0 -1
  88. package/dist/core/doc-testing-session.js +0 -696
  89. package/dist/core/doc-testing-types.d.ts +0 -127
  90. package/dist/core/doc-testing-types.d.ts.map +0 -1
  91. package/dist/core/doc-testing-types.js +0 -53
  92. package/dist/core/nushell-runtime.d.ts +0 -39
  93. package/dist/core/nushell-runtime.d.ts.map +0 -1
  94. package/dist/core/nushell-runtime.js +0 -103
  95. package/dist/core/platform-operations.d.ts +0 -70
  96. package/dist/core/platform-operations.d.ts.map +0 -1
  97. package/dist/core/platform-operations.js +0 -294
  98. package/dist/tools/build-platform.d.ts +0 -25
  99. package/dist/tools/build-platform.d.ts.map +0 -1
  100. package/dist/tools/build-platform.js +0 -277
  101. package/dist/tools/test-docs.d.ts +0 -22
  102. package/dist/tools/test-docs.d.ts.map +0 -1
  103. package/dist/tools/test-docs.js +0 -351
  104. package/prompts/doc-testing-done.md +0 -51
  105. package/prompts/doc-testing-fix.md +0 -120
  106. package/prompts/doc-testing-scan.md +0 -140
  107. package/prompts/doc-testing-test-section.md +0 -169
  108. package/prompts/platform-operations-parse-script-help.md +0 -68
  109. package/scripts/ack.nu +0 -195
  110. package/scripts/argo-workflows.nu +0 -47
  111. package/scripts/argocd.nu +0 -85
  112. package/scripts/aso.nu +0 -74
  113. package/scripts/backstage.nu +0 -349
  114. package/scripts/cert-manager.nu +0 -13
  115. package/scripts/cnpg.nu +0 -14
  116. package/scripts/dot.nu +0 -32
  117. package/scripts/external-secrets.nu +0 -110
  118. package/scripts/gatekeeper.nu +0 -19
  119. package/scripts/github.nu +0 -42
  120. package/scripts/image.nu +0 -67
  121. package/scripts/kro.nu +0 -11
  122. package/scripts/kubevela.nu +0 -22
  123. package/scripts/port.nu +0 -71
  124. package/scripts/prometheus.nu +0 -21
  125. package/scripts/registry.nu +0 -55
  126. package/scripts/storage.nu +0 -210
  127. package/scripts/tests.nu +0 -12
  128. package/scripts/velero.nu +0 -45
  129. package/shared-prompts/validate-docs.md +0 -22
@@ -1,169 +0,0 @@
1
- # Documentation Testing - Section Test Phase (Functional + Semantic)
2
-
3
- You are testing a specific section of documentation to validate both functionality AND accuracy. You must verify that instructions work AND that the documentation text truthfully describes what actually happens.
4
-
5
- **Important**:
6
- - Skip content that has ignore comments containing "dotai-ignore" (e.g., `<!-- dotai-ignore -->`, `.. dotai-ignore`, `// dotai-ignore`). Do not generate issues for ignored content.
7
- - Look for testing hints in comments containing "dotai-test-hint" (e.g., `<!-- dotai-test-hint: use mcp__dot-ai__prompts to verify slash commands -->`, `.. dotai-test-hint: run command X to test claim Y`, `// dotai-test-hint: check actual behavior with tool Z`). Follow these hints when testing the associated content.
8
-
9
- ## CRITICAL MINDSET: User Behavior Simulation
10
-
11
- **You are simulating a real user following this documentation step-by-step.**
12
-
13
- ### User Journey Testing Requirements
14
-
15
- **Follow documented workflows exactly as users would:**
16
- - If docs say "Run this command to test" → Actually execute that command and verify it works
17
- - If docs say "Navigate to Settings page" → Verify that page/option exists and is accessible
18
- - If docs say "You should see output X" → Confirm you actually get output X
19
- - If docs say "Click the Install button" → Verify that button exists and functions
20
- - If docs say "This will automatically happen" → Test that it actually happens automatically
21
-
22
- **Key User Scenarios to Simulate:**
23
- 1. **Frustrated troubleshooting user** → Would run every suggested diagnostic command to find the problem
24
- 2. **New setup user** → Would expect every installation/configuration step to work as written
25
- 3. **Verification user** → Would run confirmation commands to ensure their setup is working
26
- 4. **Integration user** → Would follow workflow examples expecting them to produce stated results
27
-
28
- **Critical Testing Mindset Shifts:**
29
- - **From**: "This looks like an example command" → **To**: "A user would actually run this - does it work?"
30
- - **From**: "The JSON syntax is valid" → **To**: "If a user creates this config, does it actually work?"
31
- - **From**: "This seems reasonable" → **To**: "If I follow these exact steps, do I get the promised outcome?"
32
-
33
- ## Section to Test
34
- **File**: {filePath}
35
- **Session**: {sessionId}
36
- **Section**: {sectionTitle} (ID: {sectionId})
37
- **Progress**: {sectionsRemaining} of {totalSections} sections remaining after this one
38
-
39
- ## Your Task - Two-Phase Validation
40
-
41
- ### Phase 1: Execute and Test (Functional Validation)
42
- Execute everything testable as a real user would:
43
- - Follow step-by-step instructions exactly as written
44
- - Execute commands, code examples, procedures (adapt for safety: use `./tmp/` for file operations, test endpoints for URLs, etc.)
45
- - Test interactive elements and verify file operations work
46
- - Validate that examples produce expected results
47
-
48
- ### Phase 2: Analyze Claims vs Reality (Semantic Validation)
49
- Check every claim in the documentation:
50
- □ **Difficulty/Time Claims**: Does "easy," "simple," "quickly," "automatically" match reality?
51
- □ **Outcome Claims**: Do "you will see," "this enables," "results in" match what actually happens?
52
- □ **Prerequisite Claims**: Are stated requirements actually sufficient for success?
53
- □ **User Experience Claims**: Would a typical user get the promised experience?
54
- □ **Feature Claims**: Are described capabilities actually implemented in the codebase?
55
- □ **Architecture Claims**: Do system descriptions match actual implementation?
56
- □ **Integration Claims**: Do components actually work together as described?
57
- □ **Status Claims**: Are features marked as "available" actually working vs. "planned"?
58
-
59
- ### Additional Validation (When Applicable)
60
- **Cross-File Terminology**: If testing documentation that references related files, check for terminology consistency (same concepts using identical terms across files).
61
-
62
- **Code Claims**: When documentation makes claims about code, files, or system architecture, validate them against the actual codebase using available tools (Grep, Read, Task, etc.).
63
-
64
- ## Testing Approach
65
-
66
- ### EXECUTION REQUIREMENTS FOR TESTABLE CONTENT
67
- **When documentation contains executable examples, you MUST actually execute them:**
68
-
69
- **Types of executable content that require actual testing:**
70
- - **CLI Commands**: `kubectl get pods`, `npm install`, `docker run`
71
- - **API Calls**: HTTP requests, REST endpoints, GraphQL queries
72
- - **MCP Tool Calls**: `mcp__tool_name` with documented parameters
73
- - **Configuration Examples**: Creating files, environment variables, config files
74
- - **Web Navigation**: URLs, web interface interactions, form submissions
75
- - **Database Queries**: SQL commands, database operations
76
- - **Script Execution**: Shell scripts, Python scripts, automation workflows
77
-
78
- **Testing Protocol for Executable Content:**
79
- ✅ REQUIRED: Execute each example exactly as documented
80
- ✅ REQUIRED: Test with the exact parameters/inputs shown
81
- ✅ REQUIRED: Compare actual results with documented expected results
82
- ❌ FORBIDDEN: Analyze implementation code instead of running examples
83
- ❌ FORBIDDEN: Skip execution because "it looks similar to previous tests"
84
- ❌ FORBIDDEN: Rely on testing from other sections of the documentation
85
-
86
- ### NON-TESTABLE CONTENT (Testing Not Required)
87
- **These types of content should be analyzed but not executed:**
88
- - **Conceptual explanations**: Architecture descriptions, background theory
89
- - **Screenshots**: Visual examples that can't be directly executed
90
- - **Future roadmaps**: Planned features not yet implemented
91
- - **External dependencies**: Third-party services you don't control
92
- - **Destructive operations**: Commands that could damage systems
93
- - **Hardware-specific instructions**: When you lack the specific hardware
94
- - **Security credentials**: Examples containing sensitive information
95
-
96
- ### CRITICAL: Section-Specific Testing Required (When Testable)
97
- **Each documentation section with executable content requires independent validation:**
98
- - Execute the specific testable examples shown in the current section
99
- - Previous successful tests cannot substitute for current section validation
100
- - Clearly distinguish between testable and non-testable content in your analysis
101
-
102
- ### Functional Testing (Execute Documentation)
103
- **Execute documented examples first** - Always prioritize running the actual commands/procedures shown in the documentation, adapting for safety when needed. Use help commands only as supplements for understanding, not as substitutes for real testing.
104
-
105
- ### Claim Validation (Verify Descriptions)
106
- **For architectural/system claims**: Use Grep/Read tools to find relevant code and verify claims about system behavior, component relationships, and implementation details.
107
-
108
- **For feature availability claims**: Search codebase for actual implementations of described features. Distinguish between implemented functionality and planned/aspirational descriptions.
109
-
110
- **For integration claims**: Test that described component interactions actually work as documented, not just that individual components exist.
111
-
112
- **For file/directory claims**: Verify that referenced files, directories, and code structures actually exist and contain what's described.
113
-
114
- **Before submitting results:**
115
- - "If I were a real user following these docs, where would I get stuck?"
116
- - "Did I test the actual user workflows, not just validate syntax?"
117
- - "Would a user following these steps get the experience the docs promise?"
118
-
119
- ## Result Format
120
-
121
- Return your results as JSON in this exact format:
122
-
123
- ```json
124
- {
125
- "whatWasDone": "Brief summary of what you tested and executed in this section",
126
- "issues": [
127
- "In 'Section Name': Specific problem or issue you found while testing. Fix: Specific actionable solution to resolve this issue",
128
- "Under 'Code Example': Another issue that prevents users from succeeding. Fix: Detailed steps to correct this problem"
129
- ]
130
- }
131
- ```
132
-
133
- **Guidelines:**
134
-
135
- **whatWasDone** (string): Concise summary covering BOTH functional testing AND semantic analysis - what commands/procedures you executed and what claims you analyzed.
136
-
137
- **issues** (array): Each issue must contain BOTH the problem AND its solution in a single string using this exact format:
138
- - **Location**: Start with precise location: "In 'Section Name':", "Under 'Heading':", "At line X:", etc.
139
- - **Problem**: Clear description of what's wrong, broken, or prevents user success
140
- - **Solution**: Follow with " Fix: " and provide specific actionable steps to resolve the issue
141
-
142
- **Format Requirements:**
143
- - **Include both critical problems AND optional improvements** - All actionable findings go in the issues array
144
- - **Location specificity**: Every issue must identify exactly where the problem is found
145
- - **Complete solutions**: Each fix must be detailed enough for implementation
146
- - **User impact focus**: Emphasize how problems affect user success and how fixes improve experience
147
- - **Consistent pattern**: "[Location]: [Problem description]. Fix: [Detailed solution]"
148
-
149
- **ACTIONABILITY REQUIREMENT**: Every issue must be actionable with a concrete fix. Avoid validation statements like "X is correct." If something is working correctly, don't mention it unless suggesting a specific enhancement.
150
-
151
- **Examples:**
152
- - "In 'Installation' section: Missing kubectl prerequisite causes setup failure. Fix: Add 'kubectl installation required' note before cluster setup steps"
153
- - "Under 'API Examples': Outdated endpoint URL returns 404 errors. Fix: Update endpoint from '/v1/api' to '/v2/api' throughout examples"
154
-
155
- ## Instructions
156
-
157
- Complete BOTH phases for comprehensive testing:
158
-
159
- ### Phase 1 Execution Checklist:
160
- 1. Identify all testable content - discover commands, procedures, examples
161
- 2. Execute everything - run commands, test procedures, verify examples
162
- 3. Document what actually happens - capture real outcomes vs expected
163
-
164
- ### Phase 2 Analysis Checklist:
165
- 1. Find all claims - scan text for promises, expectations, descriptions
166
- 2. Evaluate each claim - does reality match what's written?
167
- 3. Check user perspective - would a typical user get the promised experience?
168
-
169
- Both phases are mandatory - functional testing without semantic analysis misses critical user experience gaps. Your goal is ensuring users get both working instructions AND accurate expectations about what will actually happen.
@@ -1,68 +0,0 @@
1
- # Parse Nu Shell Script Operations
2
-
3
- You are a specialized parser that extracts available operations from Nushell script help output.
4
-
5
- ## Task
6
-
7
- Parse the help output below and extract all available tools/resources with their operations into a structured JSON array.
8
-
9
- ## Help Output
10
-
11
- {helpOutput}
12
-
13
- ## Rules
14
-
15
- 1. Group operations by tool/resource (e.g., ArgoCD, Kubernetes cluster, Crossplane)
16
- 2. For each tool/resource, identify available operations (apply, delete, create, destroy, build, configure, etc.)
17
- 3. Extract:
18
- - `name`: Tool/resource name (e.g., "ArgoCD", "Kubernetes cluster", "Crossplane")
19
- - `description`: Description of what this tool/resource does
20
- - `operations`: Array of operation objects, each with:
21
- - `name`: Operation name extracted from help (e.g., "apply", "delete", "create")
22
- - `command`: Array of command parts from help output (e.g., ["apply", "argocd"])
23
- 4. **CRITICAL**: Extract command arrays EXACTLY as they appear in help - "dot.nu apply argocd" → `["apply", "argocd"]`
24
- 5. Do NOT include internal utility commands like "get", "print", "packages"
25
-
26
- ## Examples
27
-
28
- From help output like:
29
- ```sh
30
- dot.nu apply argocd - Installs ArgoCD with optional ingress
31
- dot.nu delete argocd - Removes ArgoCD
32
- dot.nu create kubernetes - Creates a Kubernetes cluster
33
- dot.nu destroy kubernetes - Destroys a Kubernetes cluster
34
- ```
35
-
36
- Extract:
37
- ```json
38
- [
39
- {
40
- "name": "ArgoCD",
41
- "description": "GitOps continuous delivery tool for Kubernetes",
42
- "operations": [
43
- {"name": "apply", "command": ["apply", "argocd"]},
44
- {"name": "delete", "command": ["delete", "argocd"]}
45
- ]
46
- },
47
- {
48
- "name": "Kubernetes cluster",
49
- "description": "Kubernetes cluster management",
50
- "operations": [
51
- {"name": "create", "command": ["create", "kubernetes"]},
52
- {"name": "destroy", "command": ["destroy", "kubernetes"]}
53
- ]
54
- }
55
- ]
56
- ```
57
-
58
- ## Output Format
59
-
60
- Return ONLY a JSON array with no additional text, markdown formatting, or explanation.
61
-
62
- ## Important
63
-
64
- - Return ONLY the JSON array
65
- - NO markdown code blocks (no ```json)
66
- - NO explanations
67
- - NO additional text
68
- - Just the raw JSON array starting with [ and ending with ]
package/scripts/ack.nu DELETED
@@ -1,195 +0,0 @@
1
- #!/usr/bin/env nu
2
-
3
- # Installs and configures AWS Controllers for Kubernetes (ACK)
4
- #
5
- # Examples:
6
- # > main apply ack --cluster_name my-cluster --region us-west-2
7
- def --env "main apply ack" [
8
- --cluster_name = "dot"
9
- --region = "us-east-1"
10
- --apply_irsa = true
11
- --aws-access-key-id: string, # AWS Access Key ID (optional, falls back to AWS_ACCESS_KEY_ID env var)
12
- --aws-secret-access-key: string # AWS Secret Access Key (optional, falls back to AWS_SECRET_ACCESS_KEY env var)
13
- ] {
14
-
15
- print $"\nApplying (ansi yellow_bold)ACK Controllers(ansi reset)...\n"
16
-
17
- mut access_key = $aws_access_key_id
18
- if ($access_key | is-empty) and ("AWS_ACCESS_KEY_ID" in $env) {
19
- $access_key = $env.AWS_ACCESS_KEY_ID
20
- } else if ($access_key | is-empty) {
21
- error make { msg: "AWS Access Key ID required via --aws-access-key-id parameter or AWS_ACCESS_KEY_ID environment variable" }
22
- }
23
- $env.AWS_ACCESS_KEY_ID = $access_key
24
- $"export AWS_ACCESS_KEY_ID=($env.AWS_ACCESS_KEY_ID)\n"
25
- | save --append .env
26
-
27
- mut secret_key = $aws_secret_access_key
28
- if ($secret_key | is-empty) and ("AWS_SECRET_ACCESS_KEY" in $env) {
29
- $secret_key = $env.AWS_SECRET_ACCESS_KEY
30
- } else if ($secret_key | is-empty) {
31
- error make { msg: "AWS Secret Access Key required via --aws-secret-access-key parameter or AWS_SECRET_ACCESS_KEY environment variable" }
32
- }
33
- $env.AWS_SECRET_ACCESS_KEY = $secret_key
34
- $"export AWS_SECRET_ACCESS_KEY=($env.AWS_SECRET_ACCESS_KEY)\n"
35
- | save --append .env
36
-
37
- let password = (
38
- aws ecr-public get-login-password --region us-east-1
39
- )
40
-
41
- (
42
- helm registry login --username AWS --password $password
43
- public.ecr.aws
44
- )
45
-
46
- mut aws_account_id = ""
47
- mut oidc_provider = ""
48
-
49
- if $apply_irsa {
50
-
51
- if AWS_ACCOUNT_ID in $env {
52
- $aws_account_id = $env.AWS_ACCOUNT_ID
53
- } else {
54
- $aws_account_id = (
55
- aws sts get-caller-identity --query "Account"
56
- --output text
57
- )
58
- }
59
-
60
- if OIDC_PROVIDER in $env {
61
- $oidc_provider = $env.OIDC_PROVIDER
62
- } else {
63
- $oidc_provider = (
64
- aws eks describe-cluster --name $cluster_name
65
- --region $region
66
- --query "cluster.identity.oidc.issuer"
67
- --output text | str replace "https://" ""
68
- )
69
- }
70
-
71
- }
72
-
73
- let controllers = [
74
- {name: "ec2", version: "1.3.7"},
75
- {name: "rds", version: "1.4.14"},
76
- ]
77
- for controller in $controllers {
78
-
79
- let ack_controller_iam_role = $"ack-($controller.name)-controller"
80
-
81
- (
82
- helm upgrade --install $ack_controller_iam_role
83
- oci://public.ecr.aws/aws-controllers-k8s/($controller.name)-chart
84
- $"--version=($controller.version)"
85
- --create-namespace --namespace ack-system
86
- --set aws.region=us-east-1
87
- )
88
-
89
- if $apply_irsa {
90
-
91
- {
92
- Version: "2012-10-17",
93
- Statement: [
94
- {
95
- Effect: "Allow",
96
- Principal: {
97
- Federated: $"arn:aws:iam::($aws_account_id):oidc-provider/($oidc_provider)"
98
- },
99
- "Action": "sts:AssumeRoleWithWebIdentity",
100
- "Condition": {
101
- "StringEquals": {
102
- $"($oidc_provider):sub": $"system:serviceaccount:ack-system:($ack_controller_iam_role)"
103
- }
104
- }
105
- }
106
- ]
107
- } | to json | save trust.json --force
108
-
109
- do --ignore-errors {(
110
- aws iam create-role
111
- --role-name $ack_controller_iam_role
112
- --assume-role-policy-document file://trust.json
113
- --description $"IRSA role for ACK ($controller.name) controller deployment on EKS cluster using Helm charts"
114
- )}
115
-
116
- let policy_arns = (
117
- get policy_arns --controller $controller.name
118
- )
119
-
120
- for policy_arn in $policy_arns {(
121
- aws iam attach-role-policy
122
- --role-name $ack_controller_iam_role
123
- --policy-arn $policy_arn
124
- )}
125
-
126
- let role_arn = (
127
- aws iam get-role --role-name $ack_controller_iam_role
128
- --query Role.Arn --output text
129
- )
130
-
131
- (
132
- kubectl --namespace ack-system
133
- annotate serviceaccount $ack_controller_iam_role
134
- $"eks.amazonaws.com/role-arn=($role_arn)"
135
- )
136
-
137
- (
138
- kubectl --namespace ack-system
139
- rollout restart deployment
140
- $"($ack_controller_iam_role)-($controller.name)-chart"
141
- )
142
-
143
- (
144
- kubectl --namespace ack-system wait
145
- --for=condition=ready pods
146
- --selector $"app.kubernetes.io/instance=($ack_controller_iam_role)"
147
- )
148
-
149
- }
150
-
151
- }
152
-
153
- }
154
-
155
- # Removes AWS Controllers for Kubernetes (ACK) and deletes associated IAM roles
156
- def --env "main delete ack" [] {
157
-
158
- let controllers = [
159
- "ec2",
160
- "rds"
161
- ]
162
- for controller in $controllers {
163
-
164
- let ack_controller_iam_role = $"ack-($controller)-controller"
165
-
166
- let policy_arns = (
167
- get policy_arns --controller $controller
168
- )
169
-
170
- for policy_arn in $policy_arns {
171
-
172
- do --ignore-errors {(
173
- aws iam detach-role-policy
174
- --role-name ($ack_controller_iam_role)
175
- --policy-arn ($policy_arn)
176
- )}
177
- }
178
-
179
- aws iam delete-role --role-name $ack_controller_iam_role
180
-
181
- }
182
-
183
- }
184
-
185
- def "get policy_arns" [
186
- --controller = "ec2"
187
- ] {
188
-
189
- let base_url = $"https://raw.githubusercontent.com/aws-controllers-k8s/($controller)-controller/main"
190
-
191
- let policy_arn_url = $"($base_url)/config/iam/recommended-policy-arn"
192
-
193
- http get $policy_arn_url | lines
194
-
195
- }
@@ -1,47 +0,0 @@
1
- #!/usr/bin/env nu
2
-
3
- # Installs Argo Workflows with container registry credentials
4
- #
5
- # Examples:
6
- # > main apply argoworkflows my-user my-password user@example.com --registry ghcr.io
7
- def "main apply argoworkflows" [
8
- registry_user: string # Container image registry user
9
- registry_password: string # Container image registry password
10
- registry_email: string # Container image registry email
11
- --registry = "ghcr.io" # Container image registry
12
- ] {
13
-
14
- kubectl create namespace argo
15
-
16
- (
17
- kubectl --namespace argo apply
18
- --filename "https://github.com/argoproj/argo-workflows/releases/download/v3.6.0/quick-start-minimal.yaml"
19
- )
20
-
21
- let auth = ( $"($registry_user):($registry_password)" | base64 )
22
-
23
- let json = {
24
- "auths": {
25
- $"($registry)": {
26
- "auth": $"($auth)"
27
- }
28
- }
29
- } | to json
30
-
31
- (
32
- kubectl --namespace argo create secret
33
- docker-registry regcred
34
- $"--docker-server=($registry)"
35
- --docker-username=($registry_user)
36
- --docker-password=($registry_password)
37
- --docker-email=($registry_email)
38
- )
39
-
40
- (
41
- kubectl --namespace argo create secret
42
- generic registry-creds
43
- --from-literal $"password=($registry_password)"
44
- --from-literal $"config.json=($json)"
45
- )
46
-
47
- }
package/scripts/argocd.nu DELETED
@@ -1,85 +0,0 @@
1
- #!/usr/bin/env nu
2
-
3
- # Installs ArgoCD with optional ingress and applications setup
4
- #
5
- # Examples:
6
- # > main apply argocd --host_name argocd.example.com --ingress_class_name nginx
7
- def "main apply argocd" [
8
- --host-name = "",
9
- --apply-apps = true,
10
- --ingress-class-name = "traefik"
11
- ] {
12
-
13
- let git_url = git config --get remote.origin.url
14
-
15
- {
16
- configs: {
17
- secret: {
18
- argocdServerAdminPassword: "$2a$10$m3eTlEdRen0nS86c5Zph5u/bDFQMcWZYdG3NVdiyaACCqoxLJaz16"
19
- argocdServerAdminPasswordMtime: "2021-11-08T15:04:05Z"
20
- }
21
- cm: {
22
- application.resourceTrackingMethod: annotation
23
- timeout.reconciliation: 60s
24
- }
25
- params: { "server.insecure": true }
26
- }
27
- server: {
28
- ingress: {
29
- enabled: true
30
- ingressClassName: $ingress_class_name
31
- hostname: $host_name
32
- }
33
- extraArgs: [
34
- --insecure
35
- ]
36
- }
37
- } | save argocd-values.yaml --force
38
-
39
- helm repo add argo https://argoproj.github.io/argo-helm
40
-
41
- helm repo update
42
-
43
- (
44
- helm upgrade --install argocd argo/argo-cd
45
- --namespace argocd --create-namespace
46
- --values argocd-values.yaml --wait
47
- )
48
-
49
- mkdir argocd
50
-
51
- {
52
- apiVersion: argoproj.io/v1alpha1
53
- kind: Application
54
- metadata: {
55
- name: apps
56
- namespace: argocd
57
- }
58
- spec: {
59
- project: default
60
- source: {
61
- repoURL: $git_url
62
- targetRevision: HEAD
63
- path: apps
64
- }
65
- destination: {
66
- server: "https://kubernetes.default.svc"
67
- namespace: a-team
68
- }
69
- syncPolicy: {
70
- automated: {
71
- selfHeal: true
72
- prune: true
73
- allowEmpty: true
74
- }
75
- }
76
- }
77
- } | save argocd/app.yaml --force
78
-
79
- if $apply_apps {
80
-
81
- kubectl apply --filename argocd/app.yaml
82
-
83
- }
84
-
85
- }
package/scripts/aso.nu DELETED
@@ -1,74 +0,0 @@
1
- #!/usr/bin/env nu
2
-
3
- def --env "main apply aso" [
4
- --namespace = "default"
5
- --apply_creds = true
6
- --sync_period = "1h"
7
- --azure-tenant: string # Azure Tenant ID (optional, falls back to AZURE_TENANT env var)
8
- ] {
9
-
10
- (
11
- helm upgrade --install aso2 azure-service-operator
12
- --repo https://raw.githubusercontent.com/Azure/azure-service-operator/main/v2/charts
13
- --namespace=azureserviceoperator-system
14
- --create-namespace
15
- --set crdPattern='resources.azure.com/*;dbforpostgresql.azure.com/*'
16
- --wait
17
- )
18
-
19
- if $apply_creds {
20
-
21
- mut tenant = $azure_tenant
22
- if ($tenant | is-empty) and ("AZURE_TENANT" in $env) {
23
- $tenant = $env.AZURE_TENANT
24
- } else if ($tenant | is-empty) {
25
- error make { msg: "Azure Tenant ID required via --azure-tenant parameter or AZURE_TENANT environment variable" }
26
- }
27
- $"export AZURE_TENANT=($tenant)\n" | save --append .env
28
-
29
- az login --tenant $tenant
30
-
31
- let subscription_id = (az account show --query id -o tsv)
32
-
33
- let azure_data = (
34
- az ad sp create-for-rbac --sdk-auth --role Owner
35
- --scopes $"/subscriptions/($subscription_id)" | from json
36
- )
37
-
38
- {
39
- apiVersion: "v1"
40
- kind: "Secret"
41
- metadata: {
42
- name: "aso-credential"
43
- namespace: $namespace
44
- }
45
- stringData: {
46
- AZURE_SUBSCRIPTION_ID: $azure_data.subscriptionId
47
- AZURE_TENANT_ID: $azure_data.tenantId
48
- AZURE_CLIENT_ID: $azure_data.clientId
49
- AZURE_CLIENT_SECRET: $azure_data.clientSecret
50
- }
51
- } | to yaml | kubectl apply --filename -
52
-
53
- {
54
- apiVersion: "v1"
55
- kind: "Secret"
56
- metadata: {
57
- name: "aso-controller-settings"
58
- namespace: "azureserviceoperator-system"
59
- }
60
- stringData: {
61
- MAX_CONCURRENT_RECONCILES: "1"
62
- AZURE_SYNC_PERIOD: $sync_period
63
- }
64
- } | to yaml | kubectl apply --filename -
65
-
66
- (
67
- kubectl --namespace azureserviceoperator-system
68
- rollout restart deployment
69
- azureserviceoperator-controller-manager
70
- )
71
-
72
- }
73
-
74
- }