Back to list
tstapler

infrastructure-testing

by tstapler

Tyler Stapler's dotfiles

5🍴 1📅 Jan 2, 2026

SKILL.md


name: infrastructure-testing description: Run TestKube and PGBouncer tests on Kubernetes clusters with mandatory context verification to prevent accidental deployments to wrong environments

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

EnvironmentContextNotes
Devfbg-inf-dev-1Safe for testing
Stagingfbg-inf-staging-1Pre-prod validation
Prodfbg-inf-prod-1EXTREME CAUTION

PGBouncer Configuration

  • Service: pgbouncer-ats port 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

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon