Agent Setup #
The installation steps have to be performed one time, but ensure you keep the agent up to date. It does not provide a public attack surface, but of course new releases usually fix bugs and make the process more stable.
Find the most up to date version of the agent on [our docker registry](https://r.planetary-quantum.com/harbor/projects/7/repositories/collector).
Deploy the agent #
Here’s a full stack template:
version: "3.8"
services:
collector:
image: r.planetary-quantum.com/quantum-public/collector:v2.51.2-pq3
environment:
CLUSTER: $QUANTUM_ENDPOINT
networks:
- metrics
volumes:
- agent-wal:/prometheus:rw
- /var/run/docker.sock:/var/run/docker.sock:ro
deploy:
mode: replicated
resources:
limits:
memory: 1G
reservations:
memory: 128M
placement:
constraints:
- node.role == manager
replicas: 1
restart_policy:
condition: on-failure
networks:
metrics:
attachable: true
driver: overlay
name: quantum-custom-metrics
volumes:
agent-wal:
For multi-manager setups, please update deploy.placement.constraints
.
Here’s how to deploy this:
$ export QUANTUM_ENDPOINT=my-cluster
$ export QUANTUM_STACK=${QUANTUM_ENDPOINT}-metrics-collector
$ quantum-cli stack update --create
...
Following the example above, we created a stack called my-cluster-metrics-collector
and a network called quantum-custom-metrics
. This network is an additional security boundary and allows for private access from the agent process to your tasks and their /metrics
endpoint.
Updating the agent #
To update the image, adjust the reference in the stack template and re-deploy:
$ export QUANTUM_ENDPOINT=my-cluster
$ export QUANTUM_STACK=${QUANTUM_ENDPOINT}-metrics-collector
$ quantum-cli stack update
...