You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Alaz is designed to run in a kubernetes cluster as an agent, deployed as Daemonset (runs on each cluster node separately).
3
15
4
16
What it does is to watch and pull data from cluster to gain visibility onto the cluster.
5
17
6
18
It gathers information from 3 different sources:
7
-
8
-
## 1- Kubernetes Client
19
+
20
+
## 1. Kubernetes Client
21
+
9
22
Using kubernetes client, it polls different type of events related to kubernetes resources. Like **ADD, UPDATE, DELETE** events for any kind of K8s resources like **Pods,Deployments,Services** etc.
10
23
11
-
Packages used:
12
-
- `k8s.io/api/core/v1`
13
-
- `k8s.io/apimachinery/pkg/util/runtime`
14
-
- `k8s.io/client-go`
24
+
We use the following packages:
25
+
26
+
-`k8s.io/api/core/v1`
27
+
-`k8s.io/apimachinery/pkg/util/runtime`
28
+
-`k8s.io/client-go`
29
+
30
+
## 2. Container Runtimes (`containerd`)
15
31
16
-
## 2- Container Runtimes (containerd)
17
32
There are different types of container runtimes available for K8s clusters like containerd, crio, docker etc.
18
33
By connecting to chosen container runtimes socket, Alaz is able to gather more detailed information on containers running on nodes.
34
+
19
35
- log directory of the container,
20
36
- information related to its sandbox,
21
37
- pid,
22
38
- cgroups
23
39
- environment variables
24
-
-...
40
+
-etc.
25
41
26
42
> We do not take into consideration container runtimes data, we do not need it for todays objectives. Will be used later on for collecting more detailed data.
27
43
28
-
## 3- eBPF Programs
44
+
## 3. eBPF Programs
29
45
30
-
In Alaz's eBPF directory there are a couple of **eBPF programs written in C using libbpf**.
46
+
In Alaz's eBPF directory there are a couple of eBPF programs written in C using libbpf.
31
47
32
-
In order to compile these programs, we have a **eBPF-builder image** that contains necessary dependencies installed like **clang, llvm, libbpf and go**.
48
+
In order to compile these programs, we have a **eBPF-builder image** that contains necessary dependencies installed like clang, llvm, libbpf and go.
33
49
34
-
eBPF programs are compiled in mentioned container, leveraging [Cilium bpf2go package](https://github.com/cilium/ebpf/tree/main/cmd/bpf2go).
50
+
> eBPF programs are compiled in mentioned container, leveraging [Cilium bpf2go package](https://github.com/cilium/ebpf/tree/main/cmd/bpf2go).
35
51
36
-
Using go generate directive with `bpf2go`, it compiles the eBPF program and generated necessary helper files in go in order us to interact with eBPF programs.
52
+
Using go generate directive with `bpf2go`, it compiles the eBPF program and generated necessary helper files in go in order us to interact with eBPF programs.
37
53
38
-
- Link the program to a tracepoint or a kprobe.
54
+
- Link the program to a tracepoint or a kprobe.
39
55
- Read bpf maps from user space and pass them for sense-making of data.
40
56
41
-
Used packages from cilium are :
42
-
-`github.com/cilium/eBPF/link`
43
-
-`github.com/cilium/eBPF/perf`
44
-
-`github.com/cilium/eBPF/rlimit`
57
+
Used packages from cilium are:
45
58
46
-
eBPF programs:
47
-
-`tcp_state` : Detects newly established, closed, and listened TCP connections. The number of sockets associated with the program's PID depends on the remote IP address. Keeping this data together with the file descriptor is useful.
48
-
-`l7_req` : Monitors both incoming and outgoing payloads by tracking the write,read syscalls and uprobes. Then use `tcp_state` to aggregate the data we receive, allowing us to determine who sent which request to where.
49
-
50
-
Current programs are generally attached to kernel tracepoints like:
59
+
-`github.com/cilium/eBPF/link`
60
+
-`github.com/cilium/eBPF/perf`
61
+
-`github.com/cilium/eBPF/rlimit`
62
+
63
+
eBPF programs:
64
+
65
+
-`tcp_state` : Detects newly established, closed, and listened TCP connections. The number of sockets associated with the program's PID depends on the remote IP address. Keeping this data together with the file descriptor is useful.
66
+
-`l7_req` : Monitors both incoming and outgoing payloads by tracking the write,read syscalls and uprobes. Then use `tcp_state` to aggregate the data we receive, allowing us to determine who sent which request to where.
67
+
68
+
Current programs are generally attached to kernel tracepoints like:
Uretprobes crashes go applications. (https://github.com/iovisor/bcc/issues/1320)
93
+
### Note
94
+
95
+
Uretprobes crashes go applications. See <https://github.com/iovisor/bcc/issues/1320>
96
+
76
97
That's why we disassemble the executable and find return instructions addresses and attach classic uprobes on them as a workaround.
77
98
78
-
## How to Build Alaz
99
+
## How to Build
100
+
79
101
Alaz embeds compiled eBPF programs in it. After compilation process on eBPF-builder is done, compiled programs are located in project structure.
80
102
81
-
Using **//go:embed** directive of golang. We embed *.o* files and load them into kernel using [Cilium eBPF package](https://github.com/cilium/eBPF).
103
+
Using **//go:embed** directive of golang. We embed _.o_ files and load them into kernel using [Cilium eBPF package](https://github.com/cilium/eBPF).
82
104
83
105
Then we build Alaz like a ordinary golang app more or less since compiled codes are embedded.
84
106
85
-
#### How to Deploy Alaz
107
+
## How to Deploy
108
+
86
109
Deployed as a privileged DaemonSet resource on the cluster. Alaz is required to run as a privileged container since it needs read access to `/proc` directory of the host machine.
87
110
88
111
And Alaz's `serviceAccount` must be should be associated with `ClusterRole` and `ClusterRoleBinding` resources in order to be able to talk with K8s server.
<h1align="center">Alaz - Anteon eBPF Agent for Kubernetes Monitoring</h1>
9
2
10
3
<palign="center">
11
4
<imgsrc="https://raw.githubusercontent.com/getanteon/anteon/master/assets/anteon_service_map.png"alt="Anteon Kubernetes Monitoring Service Map" />
12
-
<i>Anteon automatically generates Service Map of your K8s cluster without code instrumentation or sidecars with eBPF Agent Alaz. So you can easily find the bottlenecks in your system. Red lines indicate the high latency between services.</i>
<i>Anteon (formerly Ddosify) automatically generates Service Map of your K8s cluster without code instrumentation or sidecars with eBPF Agent Alaz. So you can easily find the bottlenecks in your system. Red lines indicate the high latency between services.</i>
-[🏠 For Anteon Self-Hosted](#-for-anteon-self-hosted)
32
+
-[Using the kubectl](#using-the-kubectl-1)
33
+
-[Using the Helm](#using-the-helm-1)
34
+
-[🧹 Cleanup](#-cleanup)
35
+
-[Supported Protocols](#supported-protocols)
36
+
-[Limitations](#limitations)
37
+
-[Encryption Libraries](#encryption-libraries)
38
+
-[Contributing](#contributing)
39
+
-[Communication](#communication)
40
+
-[License](#license)
41
+
42
+
<!-- vim-markdown-toc -->
22
43
23
44
## What is Alaz?
24
45
25
-
[Alaz](https://github.com/getanteon/alaz) is an open-source Anteon eBPF agent that can inspect and collect Kubernetes (K8s) service traffic without the need for code instrumentation, sidecars, or service restarts. This is possible due to its use of eBPF technology.
46
+
[**Alaz**](https://github.com/getanteon/alaz) is an open-source Anteon eBPF agent that can inspect and collect Kubernetes (K8s) service traffic without the need for code instrumentation, sidecars, or service restarts. This is possible due to its use of eBPF technology.
26
47
27
48
Alaz can create a **Service Map** that helps identify golden signals and problems like:
49
+
28
50
- High latencies between K8s services
29
-
- Detect 5xx HTTP status codes
51
+
- Detect 5xx HTTP status codes
30
52
- Detect Idle / Zombie services
31
53
- Detect slow SQL queries
32
54
33
-
Additionally, Anteon tracks and displays live data on your cluster instances CPU, memory, disk, and network usage. All of the dashboards are generated out-of-box and you can create alerts based on these metrics values. Check out the [docs](https://getanteon.com/docs/) for more.
55
+
Additionally, Anteon tracks and displays live data on your cluster instances CPU, memory, disk, and network usage. All of the dashboards are generated out-of-box and you can create alerts based on these metrics values. Check out the [documentation](https://getanteon.com/docs/) for more.
<i>Anteon tracks and displays live data on your cluster instances CPU, memory, disk, and network usage.</i>
38
60
</p>
39
61
40
-
41
-
➡️ For more information about Anteon, see [Anteon](https://github.com/getanteon/anteon).
62
+
➡️ See [Anteon repository](https://github.com/getanteon/anteon) for more information.
42
63
43
64
## Features
44
65
45
-
✅ **Low-Overhead:**
66
+
✅ **Low-Overhead**
46
67
47
68
Inspect and collect K8s service traffic without the need for code instrumentation, sidecars, or service restarts.
48
69
49
-
✅ **Effortless:**
70
+
✅ **Effortless**
50
71
51
72
Anteon will create the Service Map & Metrics Dashboard that helps identify golden signals and issues such as high latencies, 5xx errors, zombie services.
52
73
53
-
✅ **Prometheus Compatible:**
74
+
✅ **Prometheus Compatible**
54
75
55
76
Gather system information and resources via the Prometheus Node Exporter, which is readily available on the agent.
56
77
57
-
✅ **Cloud or On-premise:**
78
+
✅ **Cloud or On-premise**
79
+
80
+
Export metrics to [Anteon Cloud](https://getanteon.com), or install the [Anteon Self-Hosted](https://getanteon.com/docs/self-hosted/) in your infrastructure and manage everything according to your needs.
81
+
82
+
✅ **Test & Observe**
58
83
59
-
Export metrics to [Anteon Cloud](https://getanteon.com), or install the [Anteon Self-Hosted](https://github.com/getanteon/anteon/tree/master/selfhosted) in your infrastructure and manage everything according to your needs.
84
+
Anteon Performance Testing and Alaz can work collaboratively. You can start a load test and monitor your system simultaneously. This will help you spot performance issues instantly. Check out the [Anteon documentation](https://getanteon.com/docs) for more information about Anteon Stack.
60
85
61
-
✅ **Test & Observe:**
86
+
✅ **Alerts for Anomalies**
62
87
63
-
Anteon Performance Testing and Alaz can work collaboratively. You can start a load test and monitor your system simultaneously. This will help you spot performance issues instantly. Check out the [Anteon GitHub Repository](https://github.com/getanteon/anteon) for more information about Anteon Stack.
88
+
If something unusual, like a sudden increase in CPU usage, happens in your Kubernetes (K8s) cluster, Anteon immediately sends alerts to your Slack.
64
89
65
-
✅ **Alerts for Anomalies:** If something unusual, like a sudden increase in CPU usage, happens in your Kubernetes (K8s) cluster, Anteon immediately sends alerts to your Slack.
90
+
✅ **Platform Support**
66
91
67
-
✅ Works on both Arm64 and x86_64 architectures.
92
+
Works on both Arm64 and x86_64 architectures.
68
93
69
-
## Getting Started
94
+
## 🚀 Getting Started
70
95
71
-
To use Alaz, you need to have a [Anteon Cloud](https://app.getanteon.com/register) account or [Anteon Self-Hosted](https://github.com/getanteon/anteon/tree/master/selfhosted) installed.
96
+
To use Alaz, you need to have a [Anteon Cloud](https://app.getanteon.com/register) account or [Anteon Self-Hosted](https://github.com/getanteon/anteon) installed.
72
97
73
98
### ☁️ For Anteon Cloud
74
99
75
100
1. Register for a [Anteon Cloud account](https://app.getanteon.com/register).
76
101
2. Add a cluster on the [Observability page](https://app.getanteon.com/clusters). You will receive a Monitoring ID and instructions.
77
-
3. Run the agent on your Kubernetes cluster using the instructions you received. There are two options for Kubernetes deployment:
102
+
3. Run the agent on your Kubernetes cluster using the instructions you received. There are two options for Kubernetes deployment:
78
103
79
104
#### Using the kubectl
80
105
@@ -102,11 +127,11 @@ Then you can view the metrics and Kubernetes Service Map on the [Anteon Observab
2. Add a cluster on the Observability page of your Self-Hosted frontend. You will receive a Monitoring ID and instructions.
107
-
3. Run the agent on your Kubernetes cluster using the instructions you received.
132
+
3. Run the agent on your Kubernetes cluster using the instructions you received.
108
133
109
-
Note: After you install Anteon Self-Hosted, you will have a Anteon Self-Hosted endpoint of nginx reverse proxy. The base URL of the Anteon Self-Hosted endpoint forwards traffic to the frontend. The base URL of the Anteon Self-Hosted endpoint with `/api` suffix forwards traffic to the backend. So you need to set the backend host variable as `http://<your-anteon-self-hosted-endpoint>/api`.
134
+
Note: After you install Anteon Self-Hosted, you will have a Anteon Self-Hosted endpoint of Nginx reverse proxy. The base URL of the Anteon Self-Hosted endpoint forwards traffic to the frontend. The base URL of the Anteon Self-Hosted endpoint with `/api` suffix forwards traffic to the backend. So you need to set the backend host variable as `http://<your-anteon-self-hosted-endpoint>/api`.
Then you can view the metrics and Kubernetes Service Map on the Anteon Self-Hosted Observability dashboard. For more information, see [Anteon Monitoring Docs](https://getanteon.com/docs/kubernetes-monitoring/).
141
166
142
-
Alaz runs as a DaemonSet on your Kubernetes cluster. It collects metrics and sends them to Anteon Cloud or Anteon Self-Hosted. You can view the metrics on the Anteon Observability dashboard. For the detailed Alaz architecture, see [Alaz Architecture](https://github.com/getanteon/alaz/blob/master/Alaz-Architecture.md).
167
+
Alaz runs as a DaemonSet on your Kubernetes cluster. It collects metrics and sends them to Anteon Cloud or Anteon Self-Hosted. You can view the metrics on the Anteon Observability dashboard. For the detailed Alaz architecture, see [Alaz Architecture](https://github.com/getanteon/alaz/blob/master/ARCHITECTURE.md).
143
168
144
-
## Cleanup
169
+
## 🧹 Cleanup
145
170
146
171
To remove Alaz from your Kubernetes cluster, run the following command:
@@ -172,7 +197,7 @@ Alaz supports the following protocols:
172
197
- MySQL
173
198
- MongoDB
174
199
175
-
Other protocols will be supported soon. If you have a specific protocol you would like to see supported, please open an issue.
200
+
Other protocols will be supported soon. If you have a specific protocol you would like to see supported, please [open an issue](https://github.com/getanteon/alaz/issues/new).
176
201
177
202
## Limitations
178
203
@@ -182,35 +207,36 @@ In the future, we plan to support Docker containers.
182
207
Alaz is an eBPF application that uses [CO-RE](https://github.com/libbpf/libbpf#bpf-co-re-compile-once--run-everywhere).
183
208
Most of the latest linux distributions support CO-RE. In order to CO-RE to work, the kernel has to be built with BTF(bpf type format) information.
184
209
185
-
You can check your kernel version with `uname -r`
210
+
You can check your kernel version with `uname -r`
186
211
command and whether btf is enabled by default or not at the [btfhub](https://github.com/aquasecurity/btfhub/blob/main/docs/supported-distros.md).
187
212
188
-
For the time being, we expect that btf information is readily available on your system. We'll support all kernels in the upcoming weeks leveraging [btfhub](https://github.com/aquasecurity/btfhub).
213
+
For the time being, we expect that btf information is readily available on your system. We will support all kernels in the upcoming weeks leveraging [btfhub](https://github.com/aquasecurity/btfhub).
189
214
190
215
### Encryption Libraries
216
+
191
217
These are the libraries that alaz hooks into for capturing encrypted traffic.
218
+
192
219
-[crypto/tls](https://pkg.go.dev/crypto/tls):
193
-
In order to Alaz to capture tls requests in your Go applications, your go version must be **1.17+** and your executable must include debug info.
220
+
In order to Alaz to capture tls requests in your Go applications, your go version must be **1.17+** and your executable must include debug info.
194
221
195
222
-[OpenSSL](https://www.openssl.org/):
196
-
OpenSSL shared objects that is dynamically linked into your executable is supported.
197
-
Supported versions : **1.0.2**, **1.1.1** and **3.***
223
+
OpenSSL shared objects that is dynamically linked into your executable is supported.
224
+
Supported versions : **1.0.2**, **1.1.1** and **3.\***
198
225
199
226
## Contributing
200
227
201
228
Contributions to Alaz are welcome! To contribute, please follow these steps:
202
229
203
230
1. Fork the repository
204
231
2. Create a new branch: `git checkout -b my-branch`
205
-
3. Make your changes and commit them: `git commit -am 'Add some feature'`
232
+
3. Make your changes and commit them: `git commit -am "Add some feature"`
206
233
4. Push to the branch: `git push origin my-branch`
207
-
5. Submit a pull request
234
+
5. Submit a pull request.
208
235
209
236
## Communication
210
237
211
-
You can join our [Discord Server](https://discord.com/invite/9KdnrSUZQg) for issues, feature requests, feedbacks or anything else.
238
+
You can join our [Discord Server](https://discord.com/invite/9KdnrSUZQg) for issues, feature requests, feedbacks or anything else.
212
239
213
240
## License
214
241
215
-
Alaz is licensed under the AGPLv3: https://www.gnu.org/licenses/agpl-3.0.html
0 commit comments