Skip to content

Commit 9ad7259

Browse files
authored
* initial commit for otel-addon Signed-off-by: clyang82 <chuyang@redhat.com> * update with placement, secrets, etc Signed-off-by: clyang82 <chuyang@redhat.com> * minor updates Signed-off-by: clyang82 <chuyang@redhat.com> * Address review comments Signed-off-by: clyang82 <chuyang@redhat.com> --------- Signed-off-by: clyang82 <chuyang@redhat.com>
1 parent 545496e commit 9ad7259

52 files changed

Lines changed: 474 additions & 3156 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

open-telemetry-addon/.dockerignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

open-telemetry-addon/.gitignore

Lines changed: 0 additions & 26 deletions
This file was deleted.

open-telemetry-addon/Makefile

Lines changed: 0 additions & 150 deletions
This file was deleted.

open-telemetry-addon/README.md

Lines changed: 93 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,110 @@
33
## What is OtelCollector-Addon?
44

55
OtelCollector Addon is a pluggable addon working on the extensibility provided by [addon-framework](https://github.com/open-cluster-management-io/addon-framework)
6-
which automates the installation of otelCollector on both hub cluster and managed clusters and jaeget-all-in-one on hub cluster for processing and storing the traces.
6+
which automates the installation of otelCollector on the managed clusters.
77

8-
OtelCollecotr Addon consists of two components:
98

10-
- __Addon-Manager__: Manages the installation of hub components for setting up the Addon
9+
### Prerequisite
1110

12-
- __Addon-Agent__: Manages the installation of collector agents in the managed clustres.
11+
The otel-addon depends on prometheus-stack installed on the hub cluster. Before you get started, you must have a OCM environment setuped. You can also follow our recommended [quick start guide](https://open-cluster-management.io/docs/getting-started/quick-start/) to set up a playgroud OCM environment.
1312

14-
The overall architecture is shown below:
13+
#### Add Helm Repo
1514

16-
![Arch](./hack/picture/arch.png)
15+
```shell
16+
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
17+
helm repo update
18+
```
19+
20+
#### Install Prometheus
21+
22+
1. You need to create `monitoring` namespace in hub cluster with this command:
23+
```
24+
kubectl --context kind-hub create namespace monitoring
25+
```
26+
27+
2. You have to run the script to generate the certs before installing prometheus with mTLS enabled. The script do the following things:
28+
- Generate root ca and key
29+
- Generate client ca and key
30+
- Generate server cert and key
31+
- Create prometheus-tls secret in monitoring namespace
32+
- Create otel-signer secret in open-cluster-management-hub namespace
1733

34+
```shell
35+
cd hack/certs
36+
bash ./generate-certs.sh
37+
cd ../..
38+
```
1839

19-
### Installing via Helm Chart :
40+
3. Install Prometheus with the following command:
2041

2142
```shell
22-
$ helm install \
23-
-n open-cluster-management-addon --create-namespace \
24-
otel-collector charts/otel
43+
helm --kube-context kind-hub install prometheus prometheus-community/kube-prometheus-stack \
44+
--namespace monitoring \
45+
-f ./hack/prom/values.yaml
2546
```
2647

27-
### Verifying the addOn :
48+
### Installing the otel-addon
49+
50+
```shell
51+
kubectl --context kind-hub create namespace open-cluster-management-addon
52+
kubectl --context kind-hub apply -k deploy
2853
```
29-
$ kubectl -n open-cluster-management-addon get pod
30-
NAME READY STATUS RESTARTS AGE
31-
jaeger-all-in-one-57dcf4b5-ltt46 1/1 Running 0 65s
32-
otel-collector-75fd748b4c-cbt7k 1/1 Running 0 65s
33-
otel-collector-addon-manager-568885c78b-pl9db 1/1 Running 0 67s
54+
55+
### Verifying the opentelemetry-collector in the managed clusters
56+
```
57+
kubectl --context kind-cluster1 get pod -n open-cluster-management-agent-addon
58+
NAME READY STATUS RESTARTS AGE
59+
opentelemetry-collector-66fcdc8779-zvhff 1/1 Running 0 27s
3460
```
3561

62+
### Verify container advisor metrics
63+
```
64+
curl -k https://hub-control-plane:30090/api/v1/query?query=container_fs_inodes_total | jq .
65+
{
66+
"status": "success",
67+
"data": {
68+
"resultType": "vector",
69+
"result": [
70+
{
71+
"metric": {
72+
"__name__": "container_fs_inodes_total",
73+
"beta_kubernetes_io_arch": "amd64",
74+
"beta_kubernetes_io_os": "linux",
75+
"cluster_name": "cluster1",
76+
"device": "overlay_0-157",
77+
"id": "/",
78+
"instance": "cluster1-control-plane",
79+
"job": "opentelemetry-collector",
80+
"kubernetes_io_arch": "amd64",
81+
"kubernetes_io_hostname": "cluster1-control-plane",
82+
"kubernetes_io_os": "linux"
83+
},
84+
"value": [
85+
1751596235.174,
86+
"104840504"
87+
]
88+
},
89+
{
90+
"metric": {
91+
"__name__": "container_fs_inodes_total",
92+
"beta_kubernetes_io_arch": "amd64",
93+
"beta_kubernetes_io_os": "linux",
94+
"cluster_name": "cluster2",
95+
"device": "overlay_0-313",
96+
"id": "/",
97+
"instance": "cluster2-control-plane",
98+
"job": "opentelemetry-collector",
99+
"kubernetes_io_arch": "amd64",
100+
"kubernetes_io_hostname": "cluster2-control-plane",
101+
"kubernetes_io_os": "linux"
102+
},
103+
"value": [
104+
1751596235.174,
105+
"104840504"
106+
]
107+
}
108+
...
109+
]
110+
}
111+
}
112+
```

open-telemetry-addon/charts/otel/Chart.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.

open-telemetry-addon/charts/otel/templates/cluster_management_addon.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)