The NRP Dashboard provides a visualization of the National Research Platform infrastructure, showing compute nodes across multiple sites.
The application consists of two main components:
- Next.js Website - Main dashboard application hosted on Vercel
- Node Generator - Kubernetes CronJob that generates node data and uploads to Cloudflare R2
Using Next.js and hosted on Vercel. The website fetches node data from Cloudflare R2 storage.
npm install
npm run devThe API route /api/nodes enables permissive CORS to allow access from any origin. This supports external sites embedding or fetching node data directly. Preflight OPTIONS requests are handled and the following headers are returned on requests to this route:
Access-Control-Allow-Origin: *Access-Control-Allow-Methods: GET,OPTIONSAccess-Control-Allow-Headers: Content-Type
The generate-nodes directory contains a Node.js script that:
- Fetches node information from Kubernetes API
- Downloads site information from Netbox
- Generates a consolidated nodes.json file
- Uploads the data to Cloudflare R2 storage
The node generator runs as a Kubernetes CronJob every 6 hours.
- Netbox API token (read-only)
- Cloudflare R2 credentials:
- Account ID (CLOUDFLARE_ID)
- Access Key ID (CLOUDFLARE_ACCESS_KEY)
- Secret Access Key (CLOUDFLARE_SECRET_ACCESS_KEY)
- Navigate to the generate-nodes directory:
cd generate-nodes- Build the Docker image:
docker build -t generate-nodes:latest .- Create secrets file:
cp k8s/secrets.env.example k8s/secrets.env
# Edit k8s/secrets.env with your actual credentials- Deploy using Kustomize:
kubectl apply -k k8s/The CronJob is configured with:
- CPU: 1 core (1000m)
- Memory: 4GB
- Schedule: Every 6 hours (
0 */6 * * *)
The deployment includes RBAC configuration:
- ServiceAccount:
generate-nodes - ClusterRole: Read access to nodes
- ClusterRoleBinding: Binds the role to the service account
R2_PUBLIC_URL- Public URL for the Cloudflare R2 bucket (optional, defaults tohttps://nrp-dashboard.r2.dev/nodes.json)
NETBOX_TOKEN- Netbox API tokenCLOUDFLARE_ID- Cloudflare account IDCLOUDFLARE_ACCESS_KEY- Cloudflare R2 access key IDCLOUDFLARE_SECRET_ACCESS_KEY- Cloudflare R2 secret access key