Skip to content

Latest commit

 

History

History
112 lines (78 loc) · 2.43 KB

File metadata and controls

112 lines (78 loc) · 2.43 KB

Testing QueueFlow with Kind

Prerequisites

Step 1: Create Kind Cluster

cd QueueFlow
kind create cluster --name queueflow-test --config kind-config.yaml

Step 2: Build and Load Docker Image

# Build the image
docker build -t queueflow:latest .

# Load into Kind cluster
kind load docker-image queueflow:latest --name queueflow-test

Step 3: Deploy QueueFlow

kubectl apply -f k8s/deployment.yaml -f k8s/service.yaml

# Wait for it to be ready
kubectl wait --for=condition=ready pod -l app=queueflow --timeout=60s

Step 4: Test the Endpoints

# Port forward to access locally
kubectl port-forward svc/queueflow 3000:3000

# In another terminal:
curl http://localhost:3000/healthz

Step 5: Test Prioritize Endpoint

Invoke-WebRequest -Method POST -Uri "http://localhost:3000/prioritize" `
  -ContentType "application/json" `
  -Body '{"pod":{"metadata":{"name":"test","labels":{"jobType":"short"}}},"nodes":{"items":[{"metadata":{"name":"node-1"},"status":{"allocatable":{"cpu":"500m"}}}]}}'

Step 6: Test Prometheus Metrics

curl http://localhost:3000/metrics | grep queueflow

Expected output:

queueflow_requests_total{job_type="short"} 1
queueflow_nodes_scored_total 1
queueflow_node_score{job_type="short",node="node-1"} 95

Deploy Monitoring Stack (Optional)

Deploy Prometheus & Grafana

kubectl apply -f k8s/prometheus.yaml -f k8s/grafana.yaml
kubectl wait --for=condition=ready pod -l app=prometheus --timeout=60s
kubectl wait --for=condition=ready pod -l app=grafana --timeout=60s

Access Dashboards

# Terminal 1: Prometheus
kubectl port-forward svc/prometheus 9090:9090

# Terminal 2: Grafana
kubectl port-forward svc/grafana 3001:3001

Configure Grafana

  1. Go to ConnectionsData SourcesAdd Prometheus
  2. Set URL: http://prometheus:9090
  3. Click Save & Test

View Logs

kubectl logs -f deployment/queueflow

Cleanup

kind delete cluster --name queueflow-test

Note: Full scheduler extender integration requires patching the kube-scheduler config, which is complex in Kind. The steps above test that QueueFlow deploys and responds correctly.