Skip to content

Commit 8451eb8

Browse files
committed
Update docs, schemas and tests to v2
Signed-off-by: Alberto Gutierrez <aljesusg@gmail.com>
1 parent c4c28bb commit 8451eb8

45 files changed

Lines changed: 1295 additions & 53 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,8 @@ In case multi-cluster support is enabled (default) and you have access to multip
442442
- **kiali_manage_istio_config_read** - Read-only Istio config: list or get objects. For action 'list', returns an array of objects with {name, namespace, type, validation}. For create, patch, or delete use manage_istio_config.
443443
- `action` (`string`) **(required)** - Action to perform (read-only)
444444
- `clusterName` (`string`) - Optional cluster name. Defaults to the cluster name in the Kiali configuration.
445-
- `group` (`string`) - API group of the Istio object (e.g., 'networking.istio.io', 'gateway.networking.k8s.io'). Required for 'get' action.
446-
- `kind` (`string`) - Kind of the Istio object (e.g., 'VirtualService', 'DestinationRule'). Required for 'get' action.
445+
- `group` (`string`) - API group of the Istio object. Required for 'get' action.
446+
- `kind` (`string`) - Kind of the Istio object. Required for 'get' action.
447447
- `namespace` (`string`) - Namespace containing the Istio object. For 'list', if not provided, returns objects across all namespaces. For 'get', required.
448448
- `object` (`string`) - Name of the Istio object. Required for 'get' action.
449449
- `serviceName` (`string`) - Filter Istio configurations (VirtualServices, DestinationRules, and their referenced Gateways) that affect a specific service. Only applicable for 'list' action
@@ -452,9 +452,8 @@ In case multi-cluster support is enabled (default) and you have access to multip
452452
- **kiali_manage_istio_config** - Create, patch, or delete Istio config. For list and get (read-only) use manage_istio_config_read.
453453
- `action` (`string`) **(required)** - Action to perform (write)
454454
- `clusterName` (`string`) - Optional cluster name. Defaults to the cluster name in the Kiali configuration.
455-
- `confirmed` (`boolean`) - CRITICAL: If 'true', the destructive action (create/patch/delete) is executed. If 'false' (or omitted) for create/patch, the tool returns a YAML PREVIEW. Display it to the user and ask for confirmation before calling again with confirmed=true.
456455
- `data` (`string`) - Complete JSON or YAML data to apply or create the object. Required for create and patch actions. You MUST provide a COMPLETE and VALID manifest with ALL required fields for the resource type. Arrays (like servers, http, etc.) are REPLACED entirely, so you must include ALL required fields within each array element.
457-
- `group` (`string`) **(required)** - API group of the Istio object (e.g., 'networking.istio.io', 'gateway.networking.k8s.io').
456+
- `group` (`string`) **(required)** - API group of the Istio object
458457
- `kind` (`string`) **(required)** - Kind of the Istio object (e.g., 'VirtualService', 'DestinationRule').
459458
- `namespace` (`string`) **(required)** - Namespace containing the Istio object
460459
- `object` (`string`) **(required)** - Name of the Istio object
@@ -466,6 +465,17 @@ In case multi-cluster support is enabled (default) and you have access to multip
466465
- `resourceName` (`string`) - Optional. The specific name of the resource. If left empty, the tool returns a list of all resources of the specified type. If provided, the tool returns deep details for this specific resource.
467466
- `resourceType` (`string`) **(required)** - The type of resource to query.
468467

468+
- **kiali_list_traces** - Lists distributed traces for a service in a namespace. Returns a summary (namespace, service, total_found, avg_duration_ms) and a list of traces with id, duration_ms, spans_count, root_op, slowest_service, has_errors. Use get_trace_details with a trace id to get full hierarchy.
469+
- `clusterName` (`string`) - Optional cluster name. Defaults to the cluster name in the Kiali configuration.
470+
- `errorOnly` (`boolean`) - If true, only consider traces that contain errors. Default false.
471+
- `limit` (`integer`) - Maximum number of traces to return. Default 10.
472+
- `lookbackSeconds` (`integer`) - How far back to search. Default 600 (10m).
473+
- `namespace` (`string`) **(required)** - Kubernetes namespace of the service.
474+
- `serviceName` (`string`) **(required)** - Service name to search traces for (required). Returns multiple traces up to limit.
475+
476+
- **kiali_get_trace_details** - Fetches a single distributed trace by trace_id and returns its call hierarchy (service tree with duration, status, and nested calls). Use this after list_traces to drill into a specific trace.
477+
- `traceId` (`string`) **(required)** - Trace ID to fetch and summarize. If provided, namespace/service_name are ignored.
478+
469479
- **kiali_get_pod_performance** - Returns a human-readable text summary with current Pod CPU/memory usage (from Prometheus) compared to Kubernetes requests/limits (from the Pod spec). Useful to answer questions like 'Is this workload using too much memory?'
470480
- `clusterName` (`string`) - Optional. Name of the cluster to get resources from. If not provided, will use the default cluster name in the Kiali KubeConfig
471481
- `namespace` (`string`) **(required)** - Kubernetes namespace of the Pod.
@@ -474,16 +484,6 @@ In case multi-cluster support is enabled (default) and you have access to multip
474484
- `timeRange` (`string`) - Time window used to compute CPU rate (Prometheus duration like '5m', '10m', '1h', '1d'). Defaults to '10m'.
475485
- `workloadName` (`string`) - Kubernetes Workload name (e.g. Deployment/StatefulSet/etc). Tool will look up the workload and pick one of its Pods. If not found, it will fall back to treating this value as a podName.
476486

477-
- **kiali_get_traces** - Fetches a distributed trace (Jaeger/Tempo) by trace_id or searches by service_name (optionally only error traces) and summarizes bottlenecks and error spans.
478-
- `clusterName` (`string`) - Optional cluster name. Defaults to the cluster name in the Kiali configuration.
479-
- `errorOnly` (`boolean`) - If true, only consider traces that contain errors (e.g. error=true / non-200 status). Default false.
480-
- `limit` (`integer`) - Max number of traces to consider when searching by service_name. Default 10.
481-
- `lookbackSeconds` (`integer`) - How far back to search when using service_name. Default 600 (10m).
482-
- `maxSpans` (`integer`) - Max number of spans to return in each summary section (bottlenecks, errors, roots). Default 7.
483-
- `namespace` (`string`) - Kubernetes namespace of the service (required when trace_id is not provided).
484-
- `serviceName` (`string`) - Service name to search traces for (required when trace_id is not provided).
485-
- `traceId` (`string`) - Trace ID to fetch and summarize. If provided, namespace/service_name are ignored.
486-
487487
- **kiali_get_logs** - Get the logs of a Kubernetes Pod (or workload name that will be resolved to a pod) in a namespace. Output is plain text, matching kubernetes-mcp-server pods_log.
488488
- `clusterName` (`string`) - Optional. Name of the cluster to get the logs from. If not provided, will use the default cluster name in the Kiali KubeConfig
489489
- `container` (`string`) - Optional. Name of the Pod container to get the logs fro
@@ -495,7 +495,7 @@ In case multi-cluster support is enabled (default) and you have access to multip
495495
- `tail` (`integer`) - Number of lines to retrieve from the end of the logs (Optional, defaults to 50). Cannot exceed 200 lines.
496496
- `workload` (`string`) - Optional. Workload name override (used when name lookup fails).
497497

498-
- **kiali_get_metrics** - Returns metrics for the given resource type, namespaces and resource name.
498+
- **kiali_get_metrics** - Returns a compact JSON summary of Istio metrics (latency quantiles, traffic trends, throughput, payload sizes) for the given resource.
499499
- `byLabels` (`string`) - Comma-separated list of labels to group metrics by (e.g., 'source_workload,destination_service'). Optional
500500
- `clusterName` (`string`) - Cluster name to get metrics from. Optional, defaults to the cluster name in the Kiali configuration (KubeConfig)
501501
- `direction` (`string`) - Traffic direction. Optional, defaults to 'outbound'

evals/tasks/kiali/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
SHELL := /usr/bin/bash
2+
3+
.PHONY: update-tasks
4+
5+
update-tasks:
6+
@./scripts/update_tasks.sh

evals/tasks/kiali/README.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Kiali Task Stack
2+
3+
Kiali-focused MCP tasks live here. Each folder under this directory represents a self-contained scenario that exercises the Kiali toolset (Istio config, topology, observability, troubleshooting).
4+
5+
## Adding a New Task
6+
7+
1. Create a new subdirectory (e.g., `status-foo/`) and place the scenario YAML plus any helper scripts or artifacts inside it.
8+
2. Make sure the YAML’s `metadata` block includes `name`, `category`, and `difficulty` so it shows up correctly in the catalog below.
9+
3. Keep prompts concise and action-oriented; verification commands should rely on Kiali MCP tools whenever possible.
10+
11+
## Updating the Catalog
12+
13+
After adding or editing tasks, regenerate this README’s catalog with:
14+
15+
```bash
16+
make update_tasks
17+
```
18+
19+
The `update_tasks` target runs `scripts/update_tasks.sh`, which parses every scenario and rewrites the section below automatically. Always run it before committing so the list stays in sync.
20+
21+
## Tasks defined
22+
<!-- TASKS-START -->
23+
- Configuration Management
24+
- [easy] istio-list (List and Validate VirtualServices)
25+
**Prompt:** *|*
26+
- [easy] istio-list-destination-rules (List and Validate DestinationRules)
27+
**Prompt:** *"List all DestinationRules in the 'bookinfo' namespace and report if any of them have validation errors."*
28+
- [medium] istio-create (Create Istio Gateway)
29+
**Prompt:** *"Create a new Istio Gateway named 'my-gateway' in the 'istio-system' namespace."*
30+
- [medium] istio-delete (Remove Fault Injection)
31+
**Prompt:** *"The 'bookinfo' namespace seems to have some fault injection configured that's causing issues. Please identify and remove any fault injection from the 'ratings' VirtualService."*
32+
- [medium] istio-patch (Update Traffic Shifting)
33+
**Prompt:** *"I need to implement a 50/50 traffic split between versions for the 'reviews' service in the 'bookinfo' namespace. Apply the necessary patch to the 'reviews' VirtualService without asking for confirmation."*
34+
- Mesh Health & Status
35+
- [easy] obs-unhealthy-namespaces (Identify Degraded Namespaces)
36+
**Prompt:** *"Check the health of my mesh and let me know if there are any unhealthy namespaces right now."*
37+
- [easy] resource-mesh-status (Comprehensive Mesh Health Audit)
38+
**Prompt:** *|*
39+
- [easy] status-kiali-istio (Audit Control Plane Connectivity)
40+
**Prompt:** *"Report on the current status and connectivity between Kiali and the Istio control plane components."*
41+
- Performance Analysis
42+
- [easy] metrics-service-request-rate (Analyze Service Traffic Volume)
43+
**Prompt:** *|*
44+
- [easy] metrics-workload-latency (Analyze Workload Response Times)
45+
**Prompt:** *|*
46+
- Resource Inspection
47+
- [easy] resource-get-namespaces (List Mesh-Enabled Namespaces)
48+
**Prompt:** *"Provide a list of all namespaces currently included in my Istio service mesh."*
49+
- [easy] resource-get-service-detail (Inspect Service Details)
50+
**Prompt:** *"Get the full configuration details and current health status for the 'reviews' service in the 'bookinfo' namespace."*
51+
- [easy] resource-get-workload-detail (Inspect Workload Details)
52+
**Prompt:** *"Inspect the 'reviews-v1' workload in the 'bookinfo' namespace and provide its detailed status and health information."*
53+
- [easy] resource-list-services (Inventory Namespace Services)
54+
**Prompt:** *"List all services available in the 'bookinfo' namespace."*
55+
- [easy] resource-list-workloads (Inventory Workloads with Sidecar Status)
56+
**Prompt:** *"Identify any workloads in the 'bookinfo' namespace that are missing the Istio sidecar proxy."*
57+
- Traffic Observability
58+
- [easy] show-topology (Visualize Namespace Traffic)
59+
**Prompt:** *"Show me the traffic topology graph for the 'bookinfo' namespace."*
60+
- [easy] topology-mesh-namespaces (Visualize Cross-Namespace Traffic)
61+
**Prompt:** *|*
62+
- [easy] topology-workload-graph (Visualize Workload-Level Topology)
63+
**Prompt:** *|*
64+
- Troubleshooting & Diagnostics
65+
- [easy] troubleshooting-log (Debug Service Errors via Logs)
66+
**Prompt:** *|*
67+
- [easy] troubleshooting-trace-lagging (Analyze Latency with Distributed Tracing)
68+
**Prompt:** *|*
69+
- [easy] troubleshooting-workload-logs (Retrieve Recent Workload Logs)
70+
**Prompt:** *"Retrieve the last 20 log lines for the 'productpage-v1' workload in the 'bookinfo' namespace."*
71+
<!-- TASKS-END -->
72+
73+
74+
<!-- SUMMARY-OUTPUT-START -->
75+
=== Evaluation Summary ===
76+
77+
✓ Create Istio Gateway (assertions: 3/3)
78+
✓ Remove Fault Injection (assertions: 3/3)
79+
✓ List and Validate VirtualServices (assertions: 3/3)
80+
✓ List and Validate DestinationRules (assertions: 3/3)
81+
✓ Update Traffic Shifting (assertions: 3/3)
82+
✓ Analyze Service Traffic Volume (assertions: 3/3)
83+
✓ Analyze Workload Response Times (assertions: 3/3)
84+
✓ Identify Degraded Namespaces (assertions: 3/3)
85+
✓ List Mesh-Enabled Namespaces (assertions: 3/3)
86+
✓ Inspect Service Details (assertions: 3/3)
87+
✓ Inspect Workload Details (assertions: 3/3)
88+
✓ Inventory Namespace Services (assertions: 3/3)
89+
✓ Inventory Workloads with Sidecar Status (assertions: 3/3)
90+
✓ Comprehensive Mesh Health Audit (assertions: 3/3)
91+
✓ Visualize Namespace Traffic (assertions: 3/3)
92+
✓ Audit Control Plane Connectivity (assertions: 3/3)
93+
✓ Visualize Cross-Namespace Traffic (assertions: 3/3)
94+
✓ Visualize Workload-Level Topology (assertions: 3/3)
95+
✓ Debug Service Errors via Logs (assertions: 3/3)
96+
✓ Analyze Latency with Distributed Tracing (assertions: 3/3)
97+
✓ Retrieve Recent Workload Logs (assertions: 3/3)
98+
99+
Tasks: 21/21 passed (100.00%)
100+
Assertions: 63/63 passed (100.00%)
101+
Tokens: ~82147 (incomplete - some counts failed)
102+
MCP schemas: ~59787 (included in token total)
103+
Judge used tokens:
104+
Input: 98980 tokens
105+
Output: 3199 tokens
106+
<!-- SUMMARY-OUTPUT-END -->
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
kind: Task
2+
apiVersion: mcpchecker/v1alpha2
3+
metadata:
4+
labels:
5+
suite: kiali
6+
name: "Create Istio Gateway"
7+
category: "Configuration Management"
8+
description: "Creates a new Istio Gateway in the istio-system namespace to manage ingress traffic."
9+
difficulty: medium
10+
spec:
11+
requires:
12+
- extension: kubernetes
13+
as: k8s
14+
verify:
15+
- script:
16+
file: ./verify.sh
17+
timeout: 10s
18+
cleanup:
19+
- script:
20+
inline: |
21+
#!/usr/bin/env bash
22+
kubectl delete gw my-gateway -n istio-system --ignore-not-found
23+
prompt:
24+
inline: "Create a new Istio Gateway named 'my-gateway' in the 'istio-system' namespace."
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
NS="istio-system"
4+
NAME="my-gateway"
5+
if kubectl get gw "$NAME" -n "$NS" >/dev/null 2>&1; then
6+
echo "Verified: Gateway '$NAME' exists in namespace '$NS'."
7+
else
8+
echo "Gateway '$NAME' not found in namespace '$NS'."
9+
exit 1
10+
fi
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
NS="bookinfo"
4+
LABEL="gevals.kiali.io/test=gevals-testing"
5+
kubectl delete virtualservice -n "$NS" -l "$LABEL" --ignore-not-found
6+
kubectl delete destinationrule -n "$NS" -l "$LABEL" --ignore-not-found
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
kind: Task
2+
apiVersion: mcpchecker/v1alpha2
3+
metadata:
4+
labels:
5+
suite: kiali
6+
name: "Remove Fault Injection"
7+
category: "Configuration Management"
8+
description: "Identifies and removes fault injection configurations (aborts/delays) from a VirtualService."
9+
difficulty: medium
10+
spec:
11+
requires:
12+
- extension: kubernetes
13+
as: k8s
14+
setup:
15+
- k8s.create:
16+
apiVersion: networking.istio.io/v1
17+
kind: DestinationRule
18+
metadata:
19+
namespace: bookinfo
20+
name: ratings
21+
labels:
22+
gevals.kiali.io/test: gevals-testing
23+
spec:
24+
host: ratings.bookinfo.svc.cluster.local
25+
subsets:
26+
- name: v1
27+
labels:
28+
version: v1
29+
- k8s.create:
30+
apiVersion: networking.istio.io/v1
31+
kind: VirtualService
32+
metadata:
33+
namespace: bookinfo
34+
name: ratings
35+
labels:
36+
gevals.kiali.io/test: gevals-testing
37+
spec:
38+
hosts:
39+
- ratings.bookinfo.svc.cluster.local
40+
http:
41+
- route:
42+
- destination:
43+
host: ratings.bookinfo.svc.cluster.local
44+
subset: v1
45+
weight: 100
46+
fault:
47+
abort:
48+
percentage:
49+
value: 100
50+
httpStatus: 503
51+
verify:
52+
- script:
53+
file: ./verify.sh
54+
timeout: 10s
55+
cleanup:
56+
- k8s.delete:
57+
apiVersion: networking.istio.io/v1
58+
kind: VirtualService
59+
metadata:
60+
name: ratings
61+
namespace: bookinfo
62+
ignoreNotFound: true
63+
- k8s.delete:
64+
apiVersion: networking.istio.io/v1
65+
kind: DestinationRule
66+
metadata:
67+
name: ratings
68+
namespace: bookinfo
69+
ignoreNotFound: true
70+
prompt:
71+
inline: "The 'bookinfo' namespace seems to have some fault injection configured that's causing issues. Please identify and remove any fault injection from the 'ratings' VirtualService."
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
cat <<'EOF' | kubectl apply -f -
4+
apiVersion: networking.istio.io/v1
5+
kind: DestinationRule
6+
metadata:
7+
namespace: bookinfo
8+
name: ratings
9+
labels:
10+
gevals.kiali.io/test: gevals-testing
11+
spec:
12+
host: ratings.bookinfo.svc.cluster.local
13+
subsets:
14+
- name: v1
15+
labels:
16+
version: v1
17+
---
18+
apiVersion: networking.istio.io/v1
19+
kind: VirtualService
20+
metadata:
21+
namespace: bookinfo
22+
name: ratings
23+
labels:
24+
gevals.kiali.io/test: gevals-testing
25+
spec:
26+
hosts:
27+
- ratings.bookinfo.svc.cluster.local
28+
http:
29+
- route:
30+
- destination:
31+
host: ratings.bookinfo.svc.cluster.local
32+
subset: v1
33+
weight: 100
34+
fault:
35+
abort:
36+
percentage:
37+
value: 100
38+
httpStatus: 503
39+
EOF
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
NAMESPACE="${EVAL_NAMESPACE:-bookinfo}"
3+
# Fail if any VirtualService still has fault injection (fault.abort or fault.delay).
4+
# The agent may patch the VS to remove the fault block, so the VS can still exist.
5+
vs_with_fault="$(kubectl get virtualservice -n "${NAMESPACE}" -o json \
6+
| jq -r '[.items[] | select(any(.spec.http[]?; (.fault != null) and ((.fault | has("abort")) or (.fault | has("delay"))))) | .metadata.name] | .[]?' 2>/dev/null || true)"
7+
if [[ -n "${vs_with_fault}" ]]; then
8+
echo "VirtualService(s) still have fault injection (fault.abort or fault.delay): ${vs_with_fault}"
9+
exit 1
10+
fi
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
kind: Task
2+
apiVersion: mcpchecker/v1alpha2
3+
metadata:
4+
labels:
5+
suite: kiali
6+
name: "List and Validate DestinationRules"
7+
category: "Configuration Management"
8+
description: "Lists all DestinationRules in a namespace and reports any Istio validation errors."
9+
difficulty: easy
10+
spec:
11+
requires:
12+
- extension: kubernetes
13+
as: k8s
14+
setup:
15+
- k8s.create:
16+
apiVersion: networking.istio.io/v1
17+
kind: DestinationRule
18+
metadata:
19+
namespace: bookinfo
20+
name: ratings
21+
labels:
22+
gevals.kiali.io/test: gevals-testing
23+
spec:
24+
host: ratings.bookinfo.svc.cluster.local
25+
subsets:
26+
- name: v1
27+
labels:
28+
version: v1
29+
verify:
30+
- llmJudge:
31+
contains: "DestinationRule"
32+
prompt:
33+
inline: "List all DestinationRules in the 'bookinfo' namespace and report if any of them have validation errors."

0 commit comments

Comments
 (0)