Skip to content

Commit 18c1af3

Browse files
authored
readme: the documentation link
1 parent 8a50003 commit 18c1af3

File tree

1 file changed

+3
-123
lines changed

1 file changed

+3
-123
lines changed

README.md

Lines changed: 3 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -80,129 +80,9 @@ Collected info:
8080
Related blog posts:
8181
* [Gathering cloud instance metadata in AWS, GCP and Azure](https://coroot.com/blog/cloud-metadata)
8282

83-
## Run
84-
85-
### Requirements
86-
87-
The agent requires some privileges for getting access to container data, such as logs, performance counters and TCP sockets:
88-
* privileged mode (`securityContext.privileged: true`)
89-
* the host process ID namespace (`hostPID: true`)
90-
* `/sys/fs/cgroup` and `/sys/kernel/debug` should be mounted to the agent's container
91-
92-
### Kubernetes
93-
94-
```yaml
95-
apiVersion: v1
96-
kind: Namespace
97-
metadata:
98-
name: coroot
99-
100-
---
101-
102-
apiVersion: apps/v1
103-
kind: DaemonSet
104-
metadata:
105-
labels:
106-
app: coroot-node-agent
107-
name: coroot-node-agent
108-
namespace: coroot
109-
spec:
110-
selector:
111-
matchLabels:
112-
app: coroot-node-agent
113-
template:
114-
metadata:
115-
labels:
116-
app: coroot-node-agent
117-
annotations:
118-
prometheus.io/scrape: 'true'
119-
prometheus.io/port: '80'
120-
spec:
121-
tolerations:
122-
- operator: Exists
123-
hostPID: true
124-
containers:
125-
- name: coroot-node-agent
126-
image: ghcr.io/coroot/coroot-node-agent:latest
127-
args: ["--cgroupfs-root", "/host/sys/fs/cgroup"]
128-
ports:
129-
- containerPort: 80
130-
name: http
131-
securityContext:
132-
privileged: true
133-
volumeMounts:
134-
- mountPath: /host/sys/fs/cgroup
135-
name: cgroupfs
136-
readOnly: true
137-
- mountPath: /sys/kernel/debug
138-
name: debugfs
139-
readOnly: false
140-
volumes:
141-
- hostPath:
142-
path: /sys/fs/cgroup
143-
name: cgroupfs
144-
- hostPath:
145-
path: /sys/kernel/debug
146-
name: debugfs
147-
```
148-
149-
If you use [Prometheus Operator](https://github.com/prometheus-operator/prometheus-operator),
150-
you will also need to create a PodMonitor:
151-
```yaml
152-
apiVersion: monitoring.coreos.com/v1
153-
kind: PodMonitor
154-
metadata:
155-
name: coroot-node-agent
156-
namespace: coroot
157-
spec:
158-
selector:
159-
matchLabels:
160-
app: coroot-node-agent
161-
podMetricsEndpoints:
162-
- port: http
163-
```
164-
165-
Make sure the PodMonitor matches `podMonitorSelector` defined in your Prometheus:
166-
```yaml
167-
apiVersion: monitoring.coreos.com/v1
168-
kind: Prometheus
169-
...
170-
spec:
171-
...
172-
podMonitorNamespaceSelector: {}
173-
podMonitorSelector: {}
174-
...
175-
```
176-
The special value `{}` allows Prometheus to watch all the PodMonitors from all namespaces.
177-
178-
### Docker
179-
180-
```bash
181-
docker run --detach --name coroot-node-agent \
182-
--privileged --pid host \
183-
-v /sys/kernel/debug:/sys/kernel/debug:rw \
184-
-v /sys/fs/cgroup:/host/sys/fs/cgroup:ro \
185-
ghcr.io/coroot/coroot-node-agent --cgroupfs-root=/host/sys/fs/cgroup
186-
```
187-
188-
### Flags
189-
190-
```bash
191-
usage: coroot-node-agent [<flags>]
192-
193-
Flags:
194-
--listen="0.0.0.0:80" Listen address - ip:port or :port
195-
--cgroupfs-root="/sys/fs/cgroup"
196-
The mount point of the host cgroupfs root
197-
--no-parse-logs Disable container logs parsing
198-
--no-ping-upstreams Disable container upstreams ping
199-
--track-public-network=TRACK-PUBLIC-NETWORK ...
200-
Allow track connections to the specified IP networks, all private networks are allowed by default (e.g., Y.Y.Y.Y/mask)
201-
--provider=PROVIDER `provider` label for `node_cloud_info` metric
202-
--region=REGION `region` label for `node_cloud_info` metric
203-
--availability-zone=AVAILABILITY-ZONE
204-
`availability_zone` label for `node_cloud_info` metric
205-
```
83+
## Installation
84+
85+
The documentation is available at [coroot.com/docs/metric-exporters/node-agent](https://coroot.com/docs/metric-exporters/node-agent/installation).
20686

20787
## Metrics
20888

0 commit comments

Comments
 (0)