Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .claude/skills/trace-manifestwork/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ This skill traces these relationships bidirectionally, combining database querie

## Key Concepts

### Terminology

**IMPORTANT**: In Maestro colloquial usage, **ManifestWork** and **resource bundle** are the same concept and are used interchangeably:

- **ManifestWork**: The formal Kubernetes Custom Resource Definition (CRD) name used by the Open Cluster Management SDK
- **Resource bundle**: The term used in Maestro's RESTful API endpoints (e.g., `/api/maestro/v1/resource-bundles`)

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we do not have ManifestWork CR, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have, it just exist in memory


### Cluster Architecture

**CRITICAL**: Maestro uses a dual-cluster architecture:
Expand Down
33 changes: 21 additions & 12 deletions .claude/skills/trace-manifestwork/scripts/trace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,32 @@ query_db() {
echo ""
fi

# Check for postgres-breakglass (ARO-HCP INT - CRITICAL ENVIRONMENT)
# Check for maestro-db first (normal database pod)
pod_name=$(kubectl_svc -n maestro get pods -l name=maestro-db -o jsonpath='{.items[0].metadata.name}' 2>/dev/null || echo "")

if [[ -n "$pod_name" ]]; then
echo "Database: maestro-db"
echo ""

# Try to detect the postgres user
local db_user
db_user=$(kubectl_svc -n maestro exec -i "$pod_name" -- env 2>/dev/null | grep '^POSTGRES_USER=' | cut -d= -f2)

if [[ -z "$db_user" ]]; then
db_user="maestro"
fi

kubectl_svc -n maestro exec -i "$pod_name" -- psql -U "$db_user" -d maestro -c "$sql_query"
return 0
fi

# Fallback: Check for postgres-breakglass (ARO-HCP INT - CRITICAL ENVIRONMENT)
local breakglass_deployment
breakglass_deployment=$(kubectl_svc -n maestro get deployment postgres-breakglass -o jsonpath='{.metadata.name}' 2>/dev/null || echo "")

if [[ -n "$breakglass_deployment" ]]; then
echo "Database: postgres-breakglass (fallback - maestro-db not found)"
echo "Environment: ARO-HCP INT (CRITICAL)"
echo "Database: postgres-breakglass"
echo ""

# Check if pod is running
Expand Down Expand Up @@ -257,16 +276,6 @@ query_db() {
return 0
fi

# Check for maestro-db (Service cluster)
pod_name=$(kubectl_svc -n maestro get pods -l name=maestro-db -o jsonpath='{.items[0].metadata.name}' 2>/dev/null || echo "")

if [[ -n "$pod_name" ]]; then
echo "Database: maestro-db (Service cluster)"
echo ""
kubectl_svc -n maestro exec -i "$pod_name" -- psql -U maestro -d maestro -c "$sql_query"
return 0
fi

echo "ERROR: No database pod found on service cluster"
echo "Checked for:"
echo " - postgres-breakglass deployment (ARO-HCP INT)"
Expand Down
10 changes: 10 additions & 0 deletions .claude/skills/trace-resource-request/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ Use this skill when:

**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.

## Terminology

**IMPORTANT**: In Maestro colloquial usage, **ManifestWork** and **resource bundle** are the same concept and are used interchangeably:

- **ManifestWork**: The formal Kubernetes Custom Resource Definition (CRD) name used by the Open Cluster Management SDK
- **Resource bundle**: The term used in Maestro's RESTful API endpoints (e.g., `/api/maestro/v1/resource-bundles`)
- **Resource**: The term used in database tables (`resources` table) and some internal code

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.

## Request Flow Overview

Understanding the complete request flow is critical for effective troubleshooting:
Expand Down
Loading