DocsRelay SetupRelay Installation & Deployment

Relay Installation & Deployment

Install and deploy the AsPeekIt Discovery Relay on Linux, Docker, or Kubernetes to enable discovery of assets in private networks.


Prerequisites

Before installing the relay, prepare it on the Relays page (Discovery section of the navigation):

  • Create the relay (Create relay) and note its Relay ID
  • Have an admin create an API key for it (API Keys in the relay card menu; starts with idpr_, shown only once)
  • Have an admin assign at least one discovery zone to it (Assign discovery zones in the relay card menu)
  • Make sure the relay host has outbound HTTPS access to the platform URL

Option 1: Linux (systemd)

Build the binary from the repository (Go toolchain required), copy it to the relay host and create the configuration file. The platform does not serve relay binaries.

Warning: The config file contains the API key, and the relay receives zone credentials. Keep it readable only by root and the relay user (or pass IDP_API_KEY through /etc/default/idp-relay).

# In a checkout of the repository
make relay-build            # -> relay/bin/idp-relay
scp relay/bin/idp-relay relay-host:/tmp/

# On the relay host
sudo install -m 0755 /tmp/idp-relay /usr/local/bin/idp-relay
sudo mkdir -p /etc/idp-relay
sudo tee /etc/idp-relay/relay.yaml > /dev/null <<EOF
relay_id: "relay-datacenter-01"
relay_name: "Datacenter 01 Relay"
backend_url: "https://idp.example.com"
api_key: "idpr_YOUR_API_KEY_HERE"
EOF
sudo chmod 600 /etc/idp-relay/relay.yaml

Install the systemd Service

relay/deploy/systemd/idp-relay.service runs the relay as the idp-relay user, with ProtectSystem=full, ProtectHome, PrivateTmp, read-only directories except /var/log/idp-relay, and EnvironmentFile=-/etc/default/idp-relay for overrides. TimeoutStopSec=150 leaves running jobs time to finish (shutdown_timeout_seconds, default 60) and to submit partial results.

sudo useradd --system --no-create-home --shell /usr/sbin/nologin idp-relay
sudo chown root:idp-relay /etc/idp-relay/relay.yaml && sudo chmod 640 /etc/idp-relay/relay.yaml
sudo install -d -o idp-relay -g idp-relay /var/log/idp-relay
sudo install -m 0644 relay/deploy/systemd/idp-relay.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now idp-relay
sudo systemctl status idp-relay

Option 2: Docker

Build the image (see below) and run it with environment variables or a mounted config file.

Note: To discover the Kubernetes cluster the relay runs in, deploy it with the Helm chart instead.

# Environment variables
docker run -d --name idp-relay \
  -e IDP_RELAY_ID="relay-datacenter-01" \
  -e IDP_RELAY_NAME="Datacenter 01 Relay" \
  -e IDP_BACKEND_URL="https://idp.example.com" \
  -e IDP_API_KEY="idpr_YOUR_API_KEY_HERE" \
  --restart unless-stopped \
  idp-relay:latest

# Config file mount
docker run -d --name idp-relay \
  -v /etc/idp-relay/relay.yaml:/etc/idp-relay/relay.yaml:ro \
  --restart unless-stopped \
  idp-relay:latest

Build the Docker Image

The image is built from relay/Dockerfile and includes the Trivy client (/usr/local/bin/trivy) used by the Kubernetes image scan.

# From the project root
make relay-docker

# Or manually
docker build -t idp-relay:latest relay/

Option 3: Kubernetes (Helm)

Deploy the relay inside a Kubernetes cluster using the provided Helm chart. This is the recommended approach when the relay needs to discover the cluster it runs in, because the chart creates a ServiceAccount and ClusterRole with read-only access to cluster resources.

# Add the chart (or use the local path)
helm install idp-relay ./relay/deploy/helm/idp-relay \
  --set relay.relayId="relay-k8s-prod" \
  --set relay.relayName="Production K8s Relay" \
  --set relay.backendUrl="https://your-idp-instance.example.com" \
  --set apiKey.value="idpr_YOUR_API_KEY_HERE" \
  --namespace idp-system \
  --create-namespace

Helm: Using an Existing Secret

For production deployments, store the API key in a Kubernetes Secret rather than passing it as a Helm value. Create the secret first, then reference it in the chart values.

Warning: Never commit API keys to version control. Always use Kubernetes Secrets or an external secrets manager for production.

# Create the secret
kubectl create secret generic idp-relay-key \
  --from-literal=api-key="idpr_YOUR_API_KEY_HERE" \
  -n idp-system

# Install with existing secret reference
helm install idp-relay ./relay/deploy/helm/idp-relay \
  --set relay.relayId="relay-k8s-prod" \
  --set relay.backendUrl="https://your-idp-instance.example.com" \
  --set apiKey.existingSecret="idp-relay-key" \
  --set apiKey.secretKey="api-key" \
  --namespace idp-system

Verify the Relay Is Running

The relay logs its identity and collectors at start, then every heartbeat and every result it submits. On the Relays page the card turns online with the relay version and the number of assigned zones.

Note: idp-relay -once polls the configuration, runs one discovery cycle and exits: useful to test a new setup.

# systemd
sudo journalctl -u idp-relay -f
# Docker
docker logs -f idp-relay
# Kubernetes
kubectl logs -f deploy/idp-relay -n idp-system

# Typical lines
# [main] AsPeekIt Relay 1.4.0 started
# [main] Supported collectors: [kubernetes network prometheus snmp tempo vsphere zabbix]
# [main] Heartbeat sent
# [scheduler] Added environment "Prod K8s" (kubernetes), next run: ...
# [main] Results submitted for "Prod K8s" (success=true): created=12 updated=130 removed=0 deps=87