A lightweight mock server that simulates the HyperFleet API, returning configurable resource responses.
The server listens on port 8888.
- Go 1.25
- Docker
- kubectl
envsubst
| Variable | Default | Description |
|---|---|---|
CLUSTER_COUNT |
100 |
Number of clusters to return |
Option 1 - Locally:
CLUSTER_COUNT=1000 go run test/mock-hyperfleet-api/main.goOption 2 - Docker:
docker build -t mock-hyperfleet-api test/mock-hyperfleet-api/
docker run -p 8888:8888 -e CLUSTER_COUNT=1000 mock-hyperfleet-apiVerify:
curl http://localhost:8888/api/hyperfleet/v1/clustersNote: The Quay repo must be public. If using a private repo, see Troubleshooting.
# Build and push (linux/amd64 for cluster compatibility)
docker build --platform linux/amd64 -t quay.io/${USER}/mock-hyperfleet-api test/mock-hyperfleet-api/
docker push quay.io/${USER}/mock-hyperfleet-api
# Deploy (envsubst substitutes environment variables like $USER in the YAML)
envsubst < test/mock-hyperfleet-api/deployment.yaml | kubectl apply -n hyperfleet -f -
# Verify
kubectl logs -l app=mock-hyperfleet-api -n hyperfleet
# If you need to update cluster count (triggers automatic pod restart)
kubectl set env deployment/mock-hyperfleet-api CLUSTER_COUNT=5000 -n hyperfleetEdit the ConfigMap and set hyperfleet_api.endpoint to http://mock-hyperfleet-api:8888:
kubectl edit configmap hyperfleet-sentinel-clusters-config -n hyperfleetThen restart the pod and verify:
kubectl rollout restart deployment hyperfleet-sentinel-clusters -n hyperfleet
kubectl logs -l app.kubernetes.io/name=sentinel -n hyperfleet -fkubectl delete deployment mock-hyperfleet-api -n hyperfleetCreate an image pull secret:
# Step 1: Enter your Quay password (input is hidden)
echo -n "Enter Quay password: "; read -r -s QUAY_PASSWORD; echo
# Step 2: Create the secret
kubectl create secret docker-registry quay-pull-secret \
--docker-server=quay.io \
--docker-username=$USER \
--docker-password="$QUAY_PASSWORD" \
-n hyperfleet \
--dry-run=client -o yaml | kubectl apply -f -
# Step 3: Verify the secret was created
kubectl get secret quay-pull-secret -n hyperfleetThen uncomment imagePullSecrets in test/mock-hyperfleet-api/deployment.yaml and redeploy.