Agent skill
infrastructure-testing
Run TestKube and PGBouncer tests on Kubernetes clusters with mandatory context verification to prevent accidental deployments to wrong environments
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/infrastructure-testing
SKILL.md
Infrastructure Testing
Test infrastructure components (TestKube, PGBouncer) on Kubernetes clusters. CRITICAL: Always verify context to prevent wrong-cluster operations.
⚠️ SAFETY FIRST
MANDATORY before ANY operation:
# Verify current context
kubectl config current-context
# Confirm it matches your intended environment
# NEVER proceed if context is wrong
Pre-Flight Checklist
- Verified kubectl context matches target environment
- TestKube CLI installed and configured
- Required secrets exist in testkube namespace
- Understood which environment you're targeting
TestKube Workflow
1. Set Context (MANDATORY)
# Switch to correct context
kubectl config use-context fbg-inf-dev-1
# Verify
kubectl config current-context
2. Configure TestKube CLI
# Use proxy client mode with current context
testkube set context --client proxy --kubeconfig ~/.kube/config --namespace testkube
3. Run TestWorkflows
# Run with real-time output
testkube run testworkflow <workflow-name> --watch
# Example
testkube run testworkflow k6-pgbouncer-rolling-restart-psql --watch
4. Alternative: kubectl Direct
kubectl create -f - <<EOF
apiVersion: testworkflows.testkube.io/v1
kind: TestWorkflowExecution
metadata:
name: test-$(date +%s)
namespace: testkube
spec:
testWorkflow:
name: <workflow-name>
EOF
Legacy Test Commands
ALWAYS specify --context explicitly:
# Run test
kubectl --context=fbg-inf-dev-1 testkube run test <test-name> -v TEST_ENVIRONMENT=fbg-inf-dev-1
# With secrets
kubectl --context=fbg-inf-dev-1 testkube run testworkflow <name> \
-v TEST_ENVIRONMENT=fbg-inf-dev-1 \
--secret-variable IGT_USER=username \
--secret-variable IGT_PW=password
# Deploy test
kubectl --context=fbg-inf-dev-1 apply -f tests/your-test.yaml
Verification Commands
# List tests
kubectl --context=fbg-inf-dev-1 get tests -n testkube
# List pods
kubectl --context=fbg-inf-dev-1 get pods -n testkube
# Check execution status
testkube get testworkflowexecution <execution-id>
Environment Reference
| Environment | Context | Notes |
|---|---|---|
| Dev | fbg-inf-dev-1 |
Safe for testing |
| Staging | fbg-inf-staging-1 |
Pre-prod validation |
| Prod | fbg-inf-prod-1 |
EXTREME CAUTION |
PGBouncer Configuration
- Service:
pgbouncer-atsport 5432 - Auth: AWS IAM roles + SSM Parameter Store
- Role:
arn:aws:iam::222019643140:role/eks-application-iam-pgbouncer-role
Best Practices
- ✅ Always use proxy client mode locally
- ✅ Set kubectl context before testkube configuration
- ✅ Use --watch flag for real-time output
- ✅ Verify branch targeting in test YAML files
- ✅ Never hardcode credentials - use SSM/secrets
Web UI
Access: https://testkube.cicd.fanatics.bet/clusters/inf-dev-1/tests
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?