Skip to content

Commit 1b6a208

Browse files
Update federation guide (#965)
* docs: update federation guide * docs: fix typo in thanos_querier.md
1 parent 12f319c commit 1b6a208

File tree

2 files changed

+40
-13
lines changed

2 files changed

+40
-13
lines changed

docs/user-guides/federation.md

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
![Architecture](federation/assets/cmo-obo-federation.png)
66

7-
This example deploys a MonitoringStack in `federate-cmo` namespace and ingests
8-
only a selected set of metrics from the in-cluster Prometheus.
7+
This example deploys a MonitoringStack in the `federate-cmo` namespace and ingests
8+
only a selected set of metrics from the in-cluster Prometheus stack.
99

1010
## Steps
1111

12-
Assuming that ObO is installed, follow the steps below to create a
12+
Assuming that the Observability Operator is installed, follow the steps below to create a
1313
MonitoringStack that uses the in-cluster Prometheus `/federate` endpoint to
1414
scrape selected metrics.
1515

@@ -18,17 +18,20 @@ directory](federation/manifests)
1818

1919
### Create a Project to deploy MonitoringStack
2020

21-
2221
```yaml
2322
apiVersion: v1
2423
kind: Namespace
2524
metadata:
2625
name: federate-cmo
2726
```
2827
28+
Or run
2929
30-
### Deploy Monitoring Stack
30+
```sh
31+
kubectl apply -f docs/user-guides/federation/manifests/00-ns.yaml
32+
```
3133

34+
### Deploy Monitoring Stack
3235

3336
Apply the following MonitoringStack
3437

@@ -60,6 +63,11 @@ spec:
6063
memory: 1Gi
6164
```
6265
66+
Or run
67+
68+
```sh
69+
kubectl apply -f docs/user-guides/federation/manifests/10-ms.yaml
70+
```
6371

6472
### Grant Permission to Federate In-Cluster Prometheus
6573

@@ -84,6 +92,12 @@ subjects:
8492
namespace: federate-cmo
8593
```
8694
95+
Or run
96+
97+
```sh
98+
kubectl apply -f docs/user-guides/federation/manifests/11-crb.yaml
99+
```
100+
87101
### Create ServiceMonitor for Federation
88102

89103
```yaml
@@ -143,15 +157,27 @@ spec:
143157
name: openshift-service-ca.crt
144158
```
145159
160+
Or run
161+
162+
```sh
163+
kubectl apply -f docs/user-guides/federation/manifests/20-smon-cmo.yaml
164+
```
165+
146166
## Validation
147167

148-
Verify if the setup works by using either the Prometheus UI or by inspecting
149-
`<prometheus>/api/v1/targets`
168+
Verify that the MonitoringStack resource is available:
169+
170+
```sh
171+
kubectl wait --for=condition=Available -n federate-cmo --timeout=10s monitoringstacks federate-cmo-ms
172+
```
173+
174+
You can verify if the setup works by using either the Prometheus UI or by inspecting
175+
`<prometheus>/api/v1/targets`.
150176

151177
### Prometheus UI
152178

153179
Access Prometheus UI by port-forwarding the `federate-cmo-ms-prometheus`
154-
service created by ObO as follows
180+
service created by the Observability Operator as follows
155181

156182
```sh
157183
kubectl port-forward svc/federate-cmo-ms-prometheus 9090:9090 --address 0.0.0.0 -n federate-cmo
@@ -165,16 +191,17 @@ Run the following command to inspects all active targets for `federate-cmo-smon`
165191
service
166192

167193
```sh
168-
kubectl exec -it sts/prometheus-federate-cmo-ms -- \
169-
wget -O- -q 'http://localhost:9090/api/v1/targets?state=active' |
170-
jq '.data.activeTargets[]| select(.scrapePool | contains("federate-cmo-smon"))| .labels'
194+
kubectl exec -n federate-cmo -it sts/prometheus-federate-cmo-ms -- \
195+
curl -s 'http://localhost:9090/api/v1/targets?state=active' |
196+
jq '.data.activeTargets[]| select(.scrapePool | contains("federate-cmo-smon"))| .labels'
171197
```
172198

173-
The above should return the following json
199+
The above should return the following JSON:
174200

175201
```json
176202
{
177203
"instance": "prometheus-k8s.openshift-monitoring.svc:9091",
178204
"job": "federate-cmo-ms-prometheus",
179205
"source": "my-openshift-cluster"
180206
}
207+
```

docs/user-guides/thanos_querier.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ kubectl apply -f docs/user-guides/thanos_querier/install
3636
To verify the installation, run:
3737

3838
```shell
39-
kubectl wait --for=condition=Available -A --timeout=10s -l app.kubernetes.io/part-of monitoringstacks
39+
kubectl wait --for=condition=Available -A --timeout=10s -l app.kubernetes.io/part-of=monitoring monitoringstacks
4040
kubectl wait --for=condition=Available -A --timeout=10s -l app.kubernetes.io/managed-by=observability-operator deployments
4141
kubectl wait --for=condition=Available -A --timeout=10s -l app.kubernetes.io/part-of=myapp deployments
4242
```

0 commit comments

Comments
 (0)