Docker & Container Deployment
Run ftagent as a container with Docker, Docker Compose, or Kubernetes. Official image: flowtriq/ftagent.
Docker Run
docker run -d --name ftagent --network host \
--cap-add NET_ADMIN --cap-add SYS_PTRACE \
-v /etc/ftagent:/etc/ftagent \
-v /var/lib/ftagent:/var/lib/ftagent \
--restart unless-stopped flowtriq/ftagent:latest
| Flag | Required | Why |
|---|---|---|
| --network host | Yes | Agent must see host-level traffic. Bridge networking hides real interfaces. |
| --cap-add NET_ADMIN | Yes | Raw socket access for packet capture. |
| --cap-add SYS_PTRACE | Yes | Required for tcpdump operations on some kernels. |
| -v /etc/ftagent | Yes | Config file mount. |
| -v /var/lib/ftagent | Yes | PCAP storage, baseline state. |
First-Time Setup
sudo mkdir -p /etc/ftagent /var/lib/ftagent
sudo tee /etc/ftagent/config.json <<'EOF'
{"api_key":"YOUR_API_KEY","node_uuid":"YOUR_NODE_UUID","pcap_mode":"tcpdump"}
EOF
sudo chmod 600 /etc/ftagent/config.json
Docker Compose
# docker-compose.yml
version: "3.8"
services:
ftagent:
image: flowtriq/ftagent:latest
container_name: ftagent
network_mode: host
cap_add:
- NET_ADMIN
- SYS_PTRACE
volumes:
- /etc/ftagent:/etc/ftagent
- /var/lib/ftagent:/var/lib/ftagent
restart: unless-stopped
Kubernetes DaemonSet
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: ftagent
namespace: monitoring
spec:
selector:
matchLabels:
app: ftagent
template:
metadata:
labels:
app: ftagent
spec:
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: ftagent
image: flowtriq/ftagent:latest
securityContext:
capabilities:
add: ["NET_ADMIN", "SYS_PTRACE"]
volumeMounts:
- name: config
mountPath: /etc/ftagent
readOnly: true
- name: state
mountPath: /var/lib/ftagent
livenessProbe:
httpGet:
path: /
port: 9100
initialDelaySeconds: 30
periodSeconds: 60
volumes:
- name: config
secret:
secretName: ftagent-config
- name: state
hostPath:
path: /var/lib/ftagent
type: DirectoryOrCreate
Cloud-Init One-Liner
#!/bin/bash
pip install ftagent --break-system-packages
ftagent --api-key "$API_KEY" --node-uuid "$NODE_UUID"
ftagent --install-service
systemctl enable --now ftagent
Troubleshooting
- No traffic detected: Verify
--network hostis set. - Permission denied: Verify
--cap-add NET_ADMINis present. - Health check failing: Endpoint is
http://127.0.0.1:9100/. With host networking, it works from the host.
ESC