Description
Add a k8s.get operation to retrieve Kubernetes resources and extract specific fields. This is the most commonly needed operation across the mcpchecker kube-mcp-server example tasks, required by 8+ tasks for verification purposes.
Current bash tasks use patterns like:
kubectl get deployment web-app -o jsonpath='{.status.availableReplicas}'
kubectl get pods -l app=nginx -o jsonpath='{.items[0].status.containerStatuses[0].restartCount}'
kubectl get pvc storage-pvc -o jsonpath='{.spec.volumeName}'
Requirements
- Support retrieving a single resource by name and namespace
- Support retrieving resources by label selector
- Support an
expect block for inline verification (similar to HTTP step pattern)
- Return resource data in
outputs for potential use in subsequent steps (output referencing is handled separately)
Example Usage
Inline verification with expect:
- k8s.get:
apiVersion: apps/v1
kind: Deployment
metadata:
name: web-app
namespace: scale-test
expect:
fields:
- path: status.availableReplicas
equals: 2
Acceptance Criteria
Description
Add a
k8s.getoperation to retrieve Kubernetes resources and extract specific fields. This is the most commonly needed operation across the mcpchecker kube-mcp-server example tasks, required by 8+ tasks for verification purposes.Current bash tasks use patterns like:
kubectl get deployment web-app -o jsonpath='{.status.availableReplicas}'kubectl get pods -l app=nginx -o jsonpath='{.items[0].status.containerStatuses[0].restartCount}'kubectl get pvc storage-pvc -o jsonpath='{.spec.volumeName}'Requirements
expectblock for inline verification (similar to HTTP step pattern)outputsfor potential use in subsequent steps (output referencing is handled separately)Example Usage
Inline verification with
expect:Acceptance Criteria
expect.fieldsfor inline field assertions (path, equals, type, match, exists)