@techwavedev/agi-agent-kit 1.1.7 → 1.2.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.
Potentially problematic release.
This version of @techwavedev/agi-agent-kit might be problematic. Click here for more details.
- package/CHANGELOG.md +82 -1
- package/README.md +190 -12
- package/bin/init.js +30 -2
- package/package.json +6 -3
- package/templates/base/AGENTS.md +54 -23
- package/templates/base/README.md +325 -0
- package/templates/base/directives/memory_integration.md +95 -0
- package/templates/base/execution/memory_manager.py +309 -0
- package/templates/base/execution/session_boot.py +218 -0
- package/templates/base/execution/session_init.py +320 -0
- package/templates/base/skill-creator/SKILL_skillcreator.md +23 -36
- package/templates/base/skill-creator/scripts/init_skill.py +18 -135
- package/templates/skills/ec/README.md +31 -0
- package/templates/skills/ec/aws/SKILL.md +1020 -0
- package/templates/skills/ec/aws/defaults.yaml +13 -0
- package/templates/skills/ec/aws/references/common_patterns.md +80 -0
- package/templates/skills/ec/aws/references/mcp_servers.md +98 -0
- package/templates/skills/ec/aws-terraform/SKILL.md +349 -0
- package/templates/skills/ec/aws-terraform/references/best_practices.md +394 -0
- package/templates/skills/ec/aws-terraform/references/checkov_reference.md +337 -0
- package/templates/skills/ec/aws-terraform/scripts/configure_mcp.py +150 -0
- package/templates/skills/ec/confluent-kafka/SKILL.md +655 -0
- package/templates/skills/ec/confluent-kafka/references/ansible_playbooks.md +792 -0
- package/templates/skills/ec/confluent-kafka/references/ec_deployment.md +579 -0
- package/templates/skills/ec/confluent-kafka/references/kraft_migration.md +490 -0
- package/templates/skills/ec/confluent-kafka/references/troubleshooting.md +778 -0
- package/templates/skills/ec/confluent-kafka/references/upgrade_7x_to_8x.md +488 -0
- package/templates/skills/ec/confluent-kafka/scripts/kafka_health_check.py +435 -0
- package/templates/skills/ec/confluent-kafka/scripts/upgrade_preflight.py +568 -0
- package/templates/skills/ec/confluent-kafka/scripts/validate_config.py +455 -0
- package/templates/skills/ec/consul/SKILL.md +427 -0
- package/templates/skills/ec/consul/references/acl_setup.md +168 -0
- package/templates/skills/ec/consul/references/ha_config.md +196 -0
- package/templates/skills/ec/consul/references/troubleshooting.md +267 -0
- package/templates/skills/ec/consul/references/upgrades.md +213 -0
- package/templates/skills/ec/consul/scripts/consul_health_report.py +530 -0
- package/templates/skills/ec/consul/scripts/consul_status.py +264 -0
- package/templates/skills/ec/consul/scripts/generate_values.py +170 -0
- package/templates/skills/ec/documentation/SKILL.md +351 -0
- package/templates/skills/ec/documentation/references/best_practices.md +201 -0
- package/templates/skills/ec/documentation/scripts/analyze_code.py +307 -0
- package/templates/skills/ec/documentation/scripts/detect_changes.py +460 -0
- package/templates/skills/ec/documentation/scripts/generate_changelog.py +312 -0
- package/templates/skills/ec/documentation/scripts/sync_docs.py +272 -0
- package/templates/skills/ec/documentation/scripts/update_skill_docs.py +366 -0
- package/templates/skills/ec/gitlab/SKILL.md +529 -0
- package/templates/skills/ec/gitlab/references/agent_installation.md +416 -0
- package/templates/skills/ec/gitlab/references/api_reference.md +508 -0
- package/templates/skills/ec/gitlab/references/gitops_flux.md +465 -0
- package/templates/skills/ec/gitlab/references/troubleshooting.md +518 -0
- package/templates/skills/ec/gitlab/scripts/generate_agent_values.py +329 -0
- package/templates/skills/ec/gitlab/scripts/gitlab_agent_status.py +414 -0
- package/templates/skills/ec/jira/SKILL.md +484 -0
- package/templates/skills/ec/jira/references/jql_reference.md +148 -0
- package/templates/skills/ec/jira/scripts/add_comment.py +91 -0
- package/templates/skills/ec/jira/scripts/bulk_log_work.py +124 -0
- package/templates/skills/ec/jira/scripts/create_ticket.py +162 -0
- package/templates/skills/ec/jira/scripts/get_ticket.py +191 -0
- package/templates/skills/ec/jira/scripts/jira_client.py +383 -0
- package/templates/skills/ec/jira/scripts/log_work.py +154 -0
- package/templates/skills/ec/jira/scripts/search_tickets.py +104 -0
- package/templates/skills/ec/jira/scripts/update_comment.py +67 -0
- package/templates/skills/ec/jira/scripts/update_ticket.py +161 -0
- package/templates/skills/ec/karpenter/SKILL.md +301 -0
- package/templates/skills/ec/karpenter/references/ec2nodeclasses.md +421 -0
- package/templates/skills/ec/karpenter/references/migration.md +396 -0
- package/templates/skills/ec/karpenter/references/nodepools.md +400 -0
- package/templates/skills/ec/karpenter/references/troubleshooting.md +359 -0
- package/templates/skills/ec/karpenter/scripts/generate_ec2nodeclass.py +187 -0
- package/templates/skills/ec/karpenter/scripts/generate_nodepool.py +245 -0
- package/templates/skills/ec/karpenter/scripts/karpenter_status.py +359 -0
- package/templates/skills/ec/opensearch/SKILL.md +720 -0
- package/templates/skills/ec/opensearch/references/ml_neural_search.md +576 -0
- package/templates/skills/ec/opensearch/references/operator.md +532 -0
- package/templates/skills/ec/opensearch/references/query_dsl.md +532 -0
- package/templates/skills/ec/opensearch/scripts/configure_mcp.py +148 -0
- package/templates/skills/ec/victoriametrics/SKILL.md +598 -0
- package/templates/skills/ec/victoriametrics/references/kubernetes.md +531 -0
- package/templates/skills/ec/victoriametrics/references/prometheus_migration.md +333 -0
- package/templates/skills/ec/victoriametrics/references/troubleshooting.md +442 -0
- package/templates/skills/knowledge/SKILLS_CATALOG.md +274 -4
- package/templates/skills/knowledge/intelligent-routing/SKILL.md +237 -164
- package/templates/skills/knowledge/parallel-agents/SKILL.md +345 -73
- package/templates/skills/knowledge/plugin-discovery/SKILL.md +582 -0
- package/templates/skills/knowledge/plugin-discovery/scripts/platform_setup.py +1083 -0
- package/templates/skills/knowledge/design-md/README.md +0 -34
- package/templates/skills/knowledge/design-md/SKILL.md +0 -193
- package/templates/skills/knowledge/design-md/examples/DESIGN.md +0 -154
- package/templates/skills/knowledge/notebooklm-mcp/SKILL.md +0 -71
- package/templates/skills/knowledge/notebooklm-mcp/assets/example_asset.txt +0 -24
- package/templates/skills/knowledge/notebooklm-mcp/references/api_reference.md +0 -34
- package/templates/skills/knowledge/notebooklm-mcp/scripts/example.py +0 -19
- package/templates/skills/knowledge/react-components/README.md +0 -36
- package/templates/skills/knowledge/react-components/SKILL.md +0 -53
- package/templates/skills/knowledge/react-components/examples/gold-standard-card.tsx +0 -80
- package/templates/skills/knowledge/react-components/package-lock.json +0 -231
- package/templates/skills/knowledge/react-components/package.json +0 -16
- package/templates/skills/knowledge/react-components/resources/architecture-checklist.md +0 -15
- package/templates/skills/knowledge/react-components/resources/component-template.tsx +0 -37
- package/templates/skills/knowledge/react-components/resources/stitch-api-reference.md +0 -14
- package/templates/skills/knowledge/react-components/resources/style-guide.json +0 -27
- package/templates/skills/knowledge/react-components/scripts/fetch-stitch.sh +0 -30
- package/templates/skills/knowledge/react-components/scripts/validate.js +0 -68
- package/templates/skills/knowledge/self-update/SKILL.md +0 -60
- package/templates/skills/knowledge/self-update/scripts/update_kit.py +0 -103
- package/templates/skills/knowledge/stitch-loop/README.md +0 -54
- package/templates/skills/knowledge/stitch-loop/SKILL.md +0 -235
- package/templates/skills/knowledge/stitch-loop/examples/SITE.md +0 -73
- package/templates/skills/knowledge/stitch-loop/examples/next-prompt.md +0 -25
- package/templates/skills/knowledge/stitch-loop/resources/baton-schema.md +0 -61
- package/templates/skills/knowledge/stitch-loop/resources/site-template.md +0 -104
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
# GitLab Agent Installation Guide
|
|
2
|
+
|
|
3
|
+
Detailed guide for installing and configuring the GitLab Agent for Kubernetes on EKS clusters with on-prem self-managed GitLab.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Prerequisites
|
|
8
|
+
|
|
9
|
+
### GitLab Requirements
|
|
10
|
+
|
|
11
|
+
- GitLab version 15.0+ (for API-based token management)
|
|
12
|
+
- KAS (Kubernetes Agent Server) enabled on your GitLab instance
|
|
13
|
+
- Personal Access Token or Project Access Token with:
|
|
14
|
+
- `api` scope (for agent management)
|
|
15
|
+
- `read_repository` scope (for GitOps)
|
|
16
|
+
|
|
17
|
+
### Cluster Requirements
|
|
18
|
+
|
|
19
|
+
- Kubernetes 1.32-1.34 (check GitLab version compatibility)
|
|
20
|
+
- Helm 3.x compatible with your Kubernetes version
|
|
21
|
+
- kubectl access to target cluster
|
|
22
|
+
- Network connectivity from cluster to GitLab KAS endpoint
|
|
23
|
+
|
|
24
|
+
### Verify KAS Availability
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# KAS should respond on this endpoint (self-managed)
|
|
28
|
+
curl -v "https://${GITLAB_HOST}/-/kubernetes-agent/"
|
|
29
|
+
|
|
30
|
+
# Expected: HTTP 101 Switching Protocols (WebSocket upgrade) or HTTP 400
|
|
31
|
+
# Error: Connection refused means KAS is not properly configured
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Installation Methods
|
|
37
|
+
|
|
38
|
+
### Method 1: Helm with API Registration (Recommended)
|
|
39
|
+
|
|
40
|
+
**Step 1: Set Environment Variables**
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
export GITLAB_HOST="gitlab.example.com"
|
|
44
|
+
export GITLAB_TOKEN="glpat-xxxxxxxxxxxxxxxxxxxx"
|
|
45
|
+
export PROJECT_ID="123" # Your project ID
|
|
46
|
+
export AGENT_NAME="eks-nonprod-agent"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Step 2: Register Agent via API**
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
AGENT_RESPONSE=$(curl --silent --request POST \
|
|
53
|
+
--header "PRIVATE-TOKEN: ${GITLAB_TOKEN}" \
|
|
54
|
+
--header "Content-Type: application/json" \
|
|
55
|
+
--url "https://${GITLAB_HOST}/api/v4/projects/${PROJECT_ID}/cluster_agents" \
|
|
56
|
+
--data "{\"name\":\"${AGENT_NAME}\"}")
|
|
57
|
+
|
|
58
|
+
export AGENT_ID=$(echo $AGENT_RESPONSE | jq -r '.id')
|
|
59
|
+
echo "Agent ID: ${AGENT_ID}"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Step 3: Create Agent Token**
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
TOKEN_RESPONSE=$(curl --silent --request POST \
|
|
66
|
+
--header "PRIVATE-TOKEN: ${GITLAB_TOKEN}" \
|
|
67
|
+
--header "Content-Type: application/json" \
|
|
68
|
+
--url "https://${GITLAB_HOST}/api/v4/projects/${PROJECT_ID}/cluster_agents/${AGENT_ID}/tokens" \
|
|
69
|
+
--data '{"name":"initial-token","description":"Initial installation token"}')
|
|
70
|
+
|
|
71
|
+
export AGENT_TOKEN=$(echo $TOKEN_RESPONSE | jq -r '.token')
|
|
72
|
+
echo "Token created (save this, it cannot be retrieved again!)"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**Step 4: Get CA Certificate (for self-signed)**
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# Extract CA certificate
|
|
79
|
+
openssl s_client -connect ${GITLAB_HOST}:443 -showcerts </dev/null 2>/dev/null | \
|
|
80
|
+
openssl x509 -outform PEM > gitlab-ca.pem
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Step 5: Install with Helm**
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# Add repo
|
|
87
|
+
helm repo add gitlab https://charts.gitlab.io
|
|
88
|
+
helm repo update
|
|
89
|
+
|
|
90
|
+
# Install
|
|
91
|
+
helm upgrade --install gitlab-agent gitlab/gitlab-agent \
|
|
92
|
+
--namespace gitlab-agent \
|
|
93
|
+
--create-namespace \
|
|
94
|
+
--set config.token="${AGENT_TOKEN}" \
|
|
95
|
+
--set config.kasAddress="wss://${GITLAB_HOST}/-/kubernetes-agent/" \
|
|
96
|
+
--set-file config.kasCaCert=./gitlab-ca.pem \
|
|
97
|
+
--set image.tag=v17.6.0
|
|
98
|
+
|
|
99
|
+
# Verify
|
|
100
|
+
kubectl get pods -n gitlab-agent
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Method 2: GitLab UI Registration
|
|
104
|
+
|
|
105
|
+
1. Navigate to your project → **Operate** → **Kubernetes clusters**
|
|
106
|
+
2. Click **Connect a cluster**
|
|
107
|
+
3. Enter agent name (e.g., `eks-nonprod-agent`)
|
|
108
|
+
4. Click **Register**
|
|
109
|
+
5. Copy the generated Helm install command
|
|
110
|
+
6. Modify for self-signed certificates:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
# Add --set-file config.kasCaCert=./gitlab-ca.pem to the command
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Configuration Options
|
|
119
|
+
|
|
120
|
+
### Agent Configuration File
|
|
121
|
+
|
|
122
|
+
Create `.gitlab/agents/<agent-name>/config.yaml` in your project:
|
|
123
|
+
|
|
124
|
+
```yaml
|
|
125
|
+
# Full configuration reference
|
|
126
|
+
|
|
127
|
+
# CI/CD workflow access
|
|
128
|
+
ci_access:
|
|
129
|
+
# Projects that can use this agent in CI/CD
|
|
130
|
+
projects:
|
|
131
|
+
- id: path/to/project1
|
|
132
|
+
- id: path/to/project2
|
|
133
|
+
# Groups - all projects in group can access
|
|
134
|
+
groups:
|
|
135
|
+
- id: path/to/group
|
|
136
|
+
|
|
137
|
+
# User access for Kubernetes dashboard (Premium/Ultimate)
|
|
138
|
+
user_access:
|
|
139
|
+
projects:
|
|
140
|
+
- id: path/to/project
|
|
141
|
+
groups:
|
|
142
|
+
- id: path/to/group
|
|
143
|
+
access_as:
|
|
144
|
+
agent: {}
|
|
145
|
+
|
|
146
|
+
# GitOps with Flux integration
|
|
147
|
+
flux:
|
|
148
|
+
# Resources Flux can manage
|
|
149
|
+
resource_inclusions:
|
|
150
|
+
- api_groups:
|
|
151
|
+
- "*"
|
|
152
|
+
resources:
|
|
153
|
+
- "*"
|
|
154
|
+
|
|
155
|
+
# Observability settings
|
|
156
|
+
observability:
|
|
157
|
+
logging:
|
|
158
|
+
level: info # debug, info, warn, error
|
|
159
|
+
metrics:
|
|
160
|
+
enabled: true
|
|
161
|
+
address: ":8080"
|
|
162
|
+
|
|
163
|
+
# Remote development workspaces (Premium/Ultimate)
|
|
164
|
+
remote_development:
|
|
165
|
+
enabled: false
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Helm Values Reference
|
|
169
|
+
|
|
170
|
+
```yaml
|
|
171
|
+
# Complete gitlab-agent Helm values
|
|
172
|
+
|
|
173
|
+
# Image configuration
|
|
174
|
+
image:
|
|
175
|
+
repository: registry.gitlab.com/gitlab-org/cluster-integration/gitlab-agent/agentk
|
|
176
|
+
tag: v17.6.0 # Should match GitLab version
|
|
177
|
+
pullPolicy: IfNotPresent
|
|
178
|
+
|
|
179
|
+
# Replica count for HA
|
|
180
|
+
replicaCount: 1 # Use 2 for production
|
|
181
|
+
|
|
182
|
+
# Agent configuration
|
|
183
|
+
config:
|
|
184
|
+
token: "" # Agent token (required)
|
|
185
|
+
kasAddress: "" # KAS WebSocket URL (required)
|
|
186
|
+
kasCaCert: "" # CA certificate for self-signed (optional)
|
|
187
|
+
observability:
|
|
188
|
+
logging:
|
|
189
|
+
level: info
|
|
190
|
+
|
|
191
|
+
# RBAC configuration
|
|
192
|
+
rbac:
|
|
193
|
+
create: true
|
|
194
|
+
# Use existing role instead of cluster-admin
|
|
195
|
+
useExistingRole: "" # e.g., gitlab-agent-role
|
|
196
|
+
|
|
197
|
+
# Service account
|
|
198
|
+
serviceAccount:
|
|
199
|
+
create: true
|
|
200
|
+
name: "" # Auto-generated if empty
|
|
201
|
+
annotations: {}
|
|
202
|
+
|
|
203
|
+
# Resource limits
|
|
204
|
+
resources:
|
|
205
|
+
requests:
|
|
206
|
+
cpu: 100m
|
|
207
|
+
memory: 128Mi
|
|
208
|
+
limits:
|
|
209
|
+
cpu: 500m
|
|
210
|
+
memory: 512Mi
|
|
211
|
+
|
|
212
|
+
# Pod disruption budget
|
|
213
|
+
podDisruptionBudget:
|
|
214
|
+
enabled: false
|
|
215
|
+
minAvailable: 1
|
|
216
|
+
|
|
217
|
+
# Node selector
|
|
218
|
+
nodeSelector: {}
|
|
219
|
+
|
|
220
|
+
# Tolerations
|
|
221
|
+
tolerations: []
|
|
222
|
+
|
|
223
|
+
# Affinity rules
|
|
224
|
+
affinity: {}
|
|
225
|
+
|
|
226
|
+
# Additional environment variables
|
|
227
|
+
extraEnv: []
|
|
228
|
+
|
|
229
|
+
# Additional volumes
|
|
230
|
+
extraVolumes: []
|
|
231
|
+
extraVolumeMounts: []
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## Production Installation
|
|
237
|
+
|
|
238
|
+
### Create Restricted RBAC Role
|
|
239
|
+
|
|
240
|
+
```yaml
|
|
241
|
+
# gitlab-agent-rbac.yaml
|
|
242
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
|
243
|
+
kind: ClusterRole
|
|
244
|
+
metadata:
|
|
245
|
+
name: gitlab-agent-role
|
|
246
|
+
rules:
|
|
247
|
+
# Minimal permissions for GitOps
|
|
248
|
+
- apiGroups: [""]
|
|
249
|
+
resources:
|
|
250
|
+
- namespaces
|
|
251
|
+
- pods
|
|
252
|
+
- services
|
|
253
|
+
- configmaps
|
|
254
|
+
- secrets
|
|
255
|
+
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
|
|
256
|
+
- apiGroups: ["apps"]
|
|
257
|
+
resources:
|
|
258
|
+
- deployments
|
|
259
|
+
- statefulsets
|
|
260
|
+
- daemonsets
|
|
261
|
+
- replicasets
|
|
262
|
+
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
|
|
263
|
+
- apiGroups: ["networking.k8s.io"]
|
|
264
|
+
resources:
|
|
265
|
+
- ingresses
|
|
266
|
+
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
|
|
267
|
+
# Add more as needed for your workloads
|
|
268
|
+
---
|
|
269
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
|
270
|
+
kind: ClusterRoleBinding
|
|
271
|
+
metadata:
|
|
272
|
+
name: gitlab-agent-binding
|
|
273
|
+
roleRef:
|
|
274
|
+
apiGroup: rbac.authorization.k8s.io
|
|
275
|
+
kind: ClusterRole
|
|
276
|
+
name: gitlab-agent-role
|
|
277
|
+
subjects:
|
|
278
|
+
- kind: ServiceAccount
|
|
279
|
+
name: gitlab-agent
|
|
280
|
+
namespace: gitlab-agent
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
```bash
|
|
284
|
+
# Apply RBAC
|
|
285
|
+
kubectl apply -f gitlab-agent-rbac.yaml
|
|
286
|
+
|
|
287
|
+
# Install with restricted role
|
|
288
|
+
helm upgrade --install gitlab-agent gitlab/gitlab-agent \
|
|
289
|
+
--namespace gitlab-agent \
|
|
290
|
+
--create-namespace \
|
|
291
|
+
-f production-values.yaml \
|
|
292
|
+
--set rbac.useExistingRole=gitlab-agent-role \
|
|
293
|
+
--set config.token="${AGENT_TOKEN}" \
|
|
294
|
+
--set config.kasAddress="wss://${GITLAB_HOST}/-/kubernetes-agent/" \
|
|
295
|
+
--set-file config.kasCaCert=./gitlab-ca.pem
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### Production Values File
|
|
299
|
+
|
|
300
|
+
```yaml
|
|
301
|
+
# production-values.yaml
|
|
302
|
+
replicaCount: 2
|
|
303
|
+
|
|
304
|
+
image:
|
|
305
|
+
tag: v17.6.0
|
|
306
|
+
|
|
307
|
+
resources:
|
|
308
|
+
requests:
|
|
309
|
+
cpu: 100m
|
|
310
|
+
memory: 128Mi
|
|
311
|
+
limits:
|
|
312
|
+
cpu: 500m
|
|
313
|
+
memory: 256Mi
|
|
314
|
+
|
|
315
|
+
podDisruptionBudget:
|
|
316
|
+
enabled: true
|
|
317
|
+
minAvailable: 1
|
|
318
|
+
|
|
319
|
+
affinity:
|
|
320
|
+
podAntiAffinity:
|
|
321
|
+
preferredDuringSchedulingIgnoredDuringExecution:
|
|
322
|
+
- weight: 100
|
|
323
|
+
podAffinityTerm:
|
|
324
|
+
labelSelector:
|
|
325
|
+
matchLabels:
|
|
326
|
+
app.kubernetes.io/name: gitlab-agent
|
|
327
|
+
topologyKey: topology.kubernetes.io/zone
|
|
328
|
+
|
|
329
|
+
config:
|
|
330
|
+
observability:
|
|
331
|
+
logging:
|
|
332
|
+
level: warn
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
## Multi-Cluster Setup
|
|
338
|
+
|
|
339
|
+
### One Agent Per Cluster
|
|
340
|
+
|
|
341
|
+
GitLab recommends running one agent per cluster with impersonation for multi-tenancy:
|
|
342
|
+
|
|
343
|
+
```
|
|
344
|
+
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
|
|
345
|
+
│ EKS-nonprod │ │ EKS-staging │ │ EKS-prod │
|
|
346
|
+
│ ┌────────────┐ │ │ ┌────────────┐ │ │ ┌────────────┐ │
|
|
347
|
+
│ │ agentk │ │ │ │ agentk │ │ │ │ agentk │ │
|
|
348
|
+
│ │ (nonprod) │ │ │ │ (staging) │ │ │ │ (prod) │ │
|
|
349
|
+
│ └─────┬──────┘ │ │ └─────┬──────┘ │ │ └─────┬──────┘ │
|
|
350
|
+
└────────┼─────────┘ └────────┼─────────┘ └────────┼─────────┘
|
|
351
|
+
│ │ │
|
|
352
|
+
└───────────────────────┼───────────────────────┘
|
|
353
|
+
│
|
|
354
|
+
┌────────────┴────────────┐
|
|
355
|
+
│ GitLab KAS Server │
|
|
356
|
+
│ (on-prem GitLab) │
|
|
357
|
+
└─────────────────────────┘
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
### Register Multiple Agents
|
|
361
|
+
|
|
362
|
+
```bash
|
|
363
|
+
# Create agents for each environment
|
|
364
|
+
for ENV in nonprod staging prod; do
|
|
365
|
+
curl --request POST \
|
|
366
|
+
--header "PRIVATE-TOKEN: ${GITLAB_TOKEN}" \
|
|
367
|
+
--header "Content-Type: application/json" \
|
|
368
|
+
--url "https://${GITLAB_HOST}/api/v4/projects/${PROJECT_ID}/cluster_agents" \
|
|
369
|
+
--data "{\"name\":\"eks-${ENV}-agent\"}"
|
|
370
|
+
done
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
### Use Different Release Names
|
|
374
|
+
|
|
375
|
+
```bash
|
|
376
|
+
# Non-prod cluster
|
|
377
|
+
helm upgrade --install gitlab-agent-nonprod gitlab/gitlab-agent \
|
|
378
|
+
--namespace gitlab-agent \
|
|
379
|
+
--set config.token="${NONPROD_TOKEN}" \
|
|
380
|
+
...
|
|
381
|
+
|
|
382
|
+
# Staging cluster (same namespace, different release)
|
|
383
|
+
helm upgrade --install gitlab-agent-staging gitlab/gitlab-agent \
|
|
384
|
+
--namespace gitlab-agent \
|
|
385
|
+
--set config.token="${STAGING_TOKEN}" \
|
|
386
|
+
...
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
---
|
|
390
|
+
|
|
391
|
+
## Uninstallation
|
|
392
|
+
|
|
393
|
+
```bash
|
|
394
|
+
# Uninstall Helm release
|
|
395
|
+
helm uninstall gitlab-agent --namespace gitlab-agent
|
|
396
|
+
|
|
397
|
+
# Delete namespace (optional)
|
|
398
|
+
kubectl delete namespace gitlab-agent
|
|
399
|
+
|
|
400
|
+
# Delete agent registration from GitLab
|
|
401
|
+
curl --request DELETE \
|
|
402
|
+
--header "PRIVATE-TOKEN: ${GITLAB_TOKEN}" \
|
|
403
|
+
--url "https://${GITLAB_HOST}/api/v4/projects/${PROJECT_ID}/cluster_agents/${AGENT_ID}"
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
---
|
|
407
|
+
|
|
408
|
+
## Verification Checklist
|
|
409
|
+
|
|
410
|
+
After installation, verify:
|
|
411
|
+
|
|
412
|
+
- [ ] Agent pod is Running: `kubectl get pods -n gitlab-agent`
|
|
413
|
+
- [ ] No errors in logs: `kubectl logs -f -l=app.kubernetes.io/name=gitlab-agent -n gitlab-agent`
|
|
414
|
+
- [ ] Agent shows "Connected" in GitLab UI: Project → Operate → Kubernetes clusters
|
|
415
|
+
- [ ] Token status is "active": Check via API
|
|
416
|
+
- [ ] CI/CD can access cluster: Run a test pipeline with `kubectl get pods`
|