Skip to content

Commit b4a7ebe

Browse files
authored
Merge pull request #180 from getanteon/develop
Docs Update
2 parents eb23447 + d43951e commit b4a7ebe

File tree

4 files changed

+168
-103
lines changed

4 files changed

+168
-103
lines changed
Lines changed: 51 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,71 @@
11
# Alaz Architecture
2+
3+
<!-- vim-markdown-toc GFM -->
4+
5+
- [1. Kubernetes Client](#1-kubernetes-client)
6+
- [2. Container Runtimes (`containerd`)](#2-container-runtimes-containerd)
7+
- [3. eBPF Programs](#3-ebpf-programs)
8+
- [Note](#note)
9+
- [How to Build](#how-to-build)
10+
- [How to Deploy](#how-to-deploy)
11+
12+
<!-- vim-markdown-toc -->
13+
214
Alaz is designed to run in a kubernetes cluster as an agent, deployed as Daemonset (runs on each cluster node separately).
315

416
What it does is to watch and pull data from cluster to gain visibility onto the cluster.
517

618
It gathers information from 3 different sources:
7-
8-
## 1- Kubernetes Client
19+
20+
## 1. Kubernetes Client
21+
922
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.
1023

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`)
1531

16-
## 2- Container Runtimes (containerd)
1732
There are different types of container runtimes available for K8s clusters like containerd, crio, docker etc.
1833
By connecting to chosen container runtimes socket, Alaz is able to gather more detailed information on containers running on nodes.
34+
1935
- log directory of the container,
2036
- information related to its sandbox,
2137
- pid,
2238
- cgroups
2339
- environment variables
24-
- ...
40+
- etc.
2541

2642
> 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.
2743
28-
## 3- eBPF Programs
44+
## 3. eBPF Programs
2945

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.
3147

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.
3349

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).
3551
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.
3753

38-
- Link the program to a tracepoint or a kprobe.
54+
- Link the program to a tracepoint or a kprobe.
3955
- Read bpf maps from user space and pass them for sense-making of data.
4056

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:
4558

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:
5169

5270
```
5371
tracepoint/syscalls/sys_enter_write (l7_req)
@@ -64,25 +82,30 @@ tracepoint/syscalls/sys_exit_connect (tcp_state)
6482
```
6583

6684
uprobes:
85+
6786
```
6887
SSL_write
6988
SSL_read
7089
crypto/tls.(*Conn).Write
7190
crypto/tls.(*Conn).Read
7291
```
7392

74-
#### Note:
75-
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+
7697
That's why we disassemble the executable and find return instructions addresses and attach classic uprobes on them as a workaround.
7798

78-
## How to Build Alaz
99+
## How to Build
100+
79101
Alaz embeds compiled eBPF programs in it. After compilation process on eBPF-builder is done, compiled programs are located in project structure.
80102

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).
82104

83105
Then we build Alaz like a ordinary golang app more or less since compiled codes are embedded.
84106

85-
#### How to Deploy Alaz
107+
## How to Deploy
108+
86109
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.
87110

88111
And Alaz's `serviceAccount` must be should be associated with `ClusterRole` and `ClusterRoleBinding` resources in order to be able to talk with K8s server.

README.md

Lines changed: 70 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
2-
<h1 align="center">Alaz - Anteon (Formerly Ddosify) eBPF Agent for Kubernetes Monitoring</h1>
3-
4-
<p align="center">
5-
<a href="https://github.com/getanteon/alaz/blob/master/LICENSE" target="_blank"><img src="https://img.shields.io/badge/LICENSE-AGPL--3.0-orange?style=for-the-badge&logo=none" alt="alaz license" /></a>
6-
<a href="https://discord.com/invite/9KdnrSUZQg" target="_blank"><img src="https://img.shields.io/discord/898523141788287017?style=for-the-badge&logo=discord&label=DISCORD" alt="Anteon discord server" /></a>
7-
<a href="https://hub.docker.com/r/ddosify/alaz" target="_blank"><img src="https://img.shields.io/docker/v/ddosify/alaz?style=for-the-badge&logo=docker&label=docker&sort=semver" alt="alaz docker image" /></a>
8-
</p>
1+
<h1 align="center">Alaz - Anteon eBPF Agent for Kubernetes Monitoring</h1>
92

103
<p align="center">
114
<img src="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>
5+
<a href="https://github.com/getanteon/alaz/blob/master/LICENSE" target="_blank"><img src="https://img.shields.io/badge/LICENSE-AGPL--3.0-orange?style=for-the-badge&logo=none" alt="alaz license" /></a>
6+
<a href="https://discord.com/invite/9KdnrSUZQg" target="_blank"><img src="https://img.shields.io/discord/898523141788287017?style=for-the-badge&logo=discord&label=DISCORD" alt="Anteon discord server" /></a>
7+
<a href="https://hub.docker.com/r/ddosify/alaz" target="_blank"><img src="https://img.shields.io/docker/v/ddosify/alaz?style=for-the-badge&logo=docker&label=docker&sort=semver" alt="alaz docker image" /></a>
8+
9+
<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>
10+
1311
</p>
1412

1513
<h2 align="center">
@@ -19,62 +17,89 @@
1917
<a href="https://discord.com/invite/9KdnrSUZQg" target="_blank">Discord</a>
2018
</h2>
2119

20+
<details>
21+
<summary>Table of Contents</summary>
22+
23+
<!-- vim-markdown-toc GFM -->
24+
25+
- [What is Alaz?](#what-is-alaz)
26+
- [Features](#features)
27+
- [🚀 Getting Started](#-getting-started)
28+
- [☁️ For Anteon Cloud](#-for-anteon-cloud)
29+
- [Using the kubectl](#using-the-kubectl)
30+
- [Using the Helm](#using-the-helm)
31+
- [🏠 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 -->
2243

2344
## What is Alaz?
2445

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.
2647

2748
Alaz can create a **Service Map** that helps identify golden signals and problems like:
49+
2850
- High latencies between K8s services
29-
- Detect 5xx HTTP status codes
51+
- Detect 5xx HTTP status codes
3052
- Detect Idle / Zombie services
3153
- Detect slow SQL queries
3254

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.
3456

3557
<p align="center">
3658
<img src="https://raw.githubusercontent.com/getanteon/anteon/master/assets/anteon_metrics.png" alt="Anteon Kubernetes Monitoring Metrics" />
3759
<i>Anteon tracks and displays live data on your cluster instances CPU, memory, disk, and network usage.</i>
3860
</p>
3961

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.
4263

4364
## Features
4465

45-
**Low-Overhead:**
66+
**Low-Overhead**
4667

4768
Inspect and collect K8s service traffic without the need for code instrumentation, sidecars, or service restarts.
4869

49-
**Effortless:**
70+
**Effortless**
5071

5172
Anteon will create the Service Map & Metrics Dashboard that helps identify golden signals and issues such as high latencies, 5xx errors, zombie services.
5273

53-
**Prometheus Compatible:**
74+
**Prometheus Compatible**
5475

5576
Gather system information and resources via the Prometheus Node Exporter, which is readily available on the agent.
5677

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**
5883

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.
6085

61-
**Test & Observe:**
86+
**Alerts for Anomalies**
6287

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.
6489

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**
6691

67-
Works on both Arm64 and x86_64 architectures.
92+
Works on both Arm64 and x86_64 architectures.
6893

69-
## Getting Started
94+
## 🚀 Getting Started
7095

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.
7297

7398
### ☁️ For Anteon Cloud
7499

75100
1. Register for a [Anteon Cloud account](https://app.getanteon.com/register).
76101
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:
78103

79104
#### Using the kubectl
80105

@@ -102,11 +127,11 @@ Then you can view the metrics and Kubernetes Service Map on the [Anteon Observab
102127

103128
### 🏠 For Anteon Self-Hosted
104129

105-
1. Install [Anteon Self-Hosted](https://github.com/getanteon/anteon/tree/master/selfhosted)
130+
1. Install [Anteon Self-Hosted](https://getanteon.com/docs/self-hosted)
106131
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.
108133

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`.
110135

111136
There are two options for Kubernetes deployment:
112137

@@ -139,19 +164,19 @@ helm upgrade --install --namespace anteon alaz anteon/alaz --set monitoringID=$M
139164

140165
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/).
141166

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).
143168

144-
## Cleanup
169+
## 🧹 Cleanup
145170

146171
To remove Alaz from your Kubernetes cluster, run the following command:
147172

148-
- For Kubectl
173+
- For Kubectl:
149174

150175
```bash
151176
kubectl delete -f https://raw.githubusercontent.com/getanteon/alaz/master/resources/alaz.yaml
152177
```
153178

154-
- For Helm
179+
- For Helm:
155180

156181
```bash
157182
helm delete alaz --namespace anteon
@@ -172,7 +197,7 @@ Alaz supports the following protocols:
172197
- MySQL
173198
- MongoDB
174199

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).
176201

177202
## Limitations
178203

@@ -182,35 +207,36 @@ In the future, we plan to support Docker containers.
182207
Alaz is an eBPF application that uses [CO-RE](https://github.com/libbpf/libbpf#bpf-co-re-compile-once--run-everywhere).
183208
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.
184209

185-
You can check your kernel version with `uname -r`
210+
You can check your kernel version with `uname -r`
186211
command and whether btf is enabled by default or not at the [btfhub](https://github.com/aquasecurity/btfhub/blob/main/docs/supported-distros.md).
187212

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).
189214

190215
### Encryption Libraries
216+
191217
These are the libraries that alaz hooks into for capturing encrypted traffic.
218+
192219
- [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.
194221

195222
- [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.\***
198225

199226
## Contributing
200227

201228
Contributions to Alaz are welcome! To contribute, please follow these steps:
202229

203230
1. Fork the repository
204231
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"`
206233
4. Push to the branch: `git push origin my-branch`
207-
5. Submit a pull request
234+
5. Submit a pull request.
208235

209236
## Communication
210237

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.
212239

213240
## License
214241

215-
Alaz is licensed under the AGPLv3: https://www.gnu.org/licenses/agpl-3.0.html
216-
242+
Alaz is licensed under the [AGPLv3](LICENSE)

0 commit comments

Comments
 (0)