Skip to content

Commit 081c1f6

Browse files
authored
update skills docs (#488)
Signed-off-by: Wei Liu <liuweixa@redhat.com>
1 parent 0154ff4 commit 081c1f6

File tree

3 files changed

+40
-12
lines changed

3 files changed

+40
-12
lines changed

.claude/skills/trace-manifestwork/SKILL.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ This skill traces these relationships bidirectionally, combining database querie
4343

4444
## Key Concepts
4545

46+
### Terminology
47+
48+
**IMPORTANT**: In Maestro colloquial usage, **ManifestWork** and **resource bundle** are the same concept and are used interchangeably:
49+
50+
- **ManifestWork**: The formal Kubernetes Custom Resource Definition (CRD) name used by the Open Cluster Management SDK
51+
- **Resource bundle**: The term used in Maestro's RESTful API endpoints (e.g., `/api/maestro/v1/resource-bundles`)
52+
53+
When users refer to "resource bundles," they are talking about ManifestWork resources. Both terms describe a collection of Kubernetes manifests packaged together for delivery to target clusters. The database stores these in the `resources` table, while the Kubernetes cluster manages them as ManifestWork/AppliedManifestWork CRs.
54+
4655
### Cluster Architecture
4756

4857
**CRITICAL**: Maestro uses a dual-cluster architecture:

.claude/skills/trace-manifestwork/scripts/trace.sh

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,32 @@ query_db() {
182182
echo ""
183183
fi
184184

185-
# Check for postgres-breakglass (ARO-HCP INT - CRITICAL ENVIRONMENT)
185+
# Check for maestro-db first (normal database pod)
186+
pod_name=$(kubectl_svc -n maestro get pods -l name=maestro-db -o jsonpath='{.items[0].metadata.name}' 2>/dev/null || echo "")
187+
188+
if [[ -n "$pod_name" ]]; then
189+
echo "Database: maestro-db"
190+
echo ""
191+
192+
# Try to detect the postgres user
193+
local db_user
194+
db_user=$(kubectl_svc -n maestro exec -i "$pod_name" -- env 2>/dev/null | grep '^POSTGRES_USER=' | cut -d= -f2)
195+
196+
if [[ -z "$db_user" ]]; then
197+
db_user="maestro"
198+
fi
199+
200+
kubectl_svc -n maestro exec -i "$pod_name" -- psql -U "$db_user" -d maestro -c "$sql_query"
201+
return 0
202+
fi
203+
204+
# Fallback: Check for postgres-breakglass (ARO-HCP INT - CRITICAL ENVIRONMENT)
186205
local breakglass_deployment
187206
breakglass_deployment=$(kubectl_svc -n maestro get deployment postgres-breakglass -o jsonpath='{.metadata.name}' 2>/dev/null || echo "")
188207

189208
if [[ -n "$breakglass_deployment" ]]; then
209+
echo "Database: postgres-breakglass (fallback - maestro-db not found)"
190210
echo "Environment: ARO-HCP INT (CRITICAL)"
191-
echo "Database: postgres-breakglass"
192211
echo ""
193212

194213
# Check if pod is running
@@ -257,16 +276,6 @@ query_db() {
257276
return 0
258277
fi
259278

260-
# Check for maestro-db (Service cluster)
261-
pod_name=$(kubectl_svc -n maestro get pods -l name=maestro-db -o jsonpath='{.items[0].metadata.name}' 2>/dev/null || echo "")
262-
263-
if [[ -n "$pod_name" ]]; then
264-
echo "Database: maestro-db (Service cluster)"
265-
echo ""
266-
kubectl_svc -n maestro exec -i "$pod_name" -- psql -U maestro -d maestro -c "$sql_query"
267-
return 0
268-
fi
269-
270279
echo "ERROR: No database pod found on service cluster"
271280
echo "Checked for:"
272281
echo " - postgres-breakglass deployment (ARO-HCP INT)"

.claude/skills/trace-resource-request/SKILL.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ Use this skill when:
3535

3636
**Common scenario**: You know a deployment or service isn't working, but only know its Kubernetes name. Use `trace-manifestwork` to find the associated resource ID and work name, then use this skill to trace through server and agent logs to identify where the request failed or stalled.
3737

38+
## Terminology
39+
40+
**IMPORTANT**: In Maestro colloquial usage, **ManifestWork** and **resource bundle** are the same concept and are used interchangeably:
41+
42+
- **ManifestWork**: The formal Kubernetes Custom Resource Definition (CRD) name used by the Open Cluster Management SDK
43+
- **Resource bundle**: The term used in Maestro's RESTful API endpoints (e.g., `/api/maestro/v1/resource-bundles`)
44+
- **Resource**: The term used in database tables (`resources` table) and some internal code
45+
46+
When users refer to "resource bundles," "resources," or "ManifestWorks," they are all talking about the same thing: a collection of Kubernetes manifests packaged together for delivery to target clusters. In log messages and traces, you'll see all three terms used to refer to this concept.
47+
3848
## Request Flow Overview
3949

4050
Understanding the complete request flow is critical for effective troubleshooting:

0 commit comments

Comments
 (0)