Updated Introduction to Mizu (markdown)

M. Mert Yıldıran 2021-10-22 04:14:41 +03:00
parent 3a9b3a1af1
commit 39e36a56a0

@ -1,23 +1,21 @@
Mizu as a Kubernetes-aware network sniffer, consists of two separate programs. One is CLI and the other one is Agent. Mizu is a Kubernetes-aware network sniffer that consists of two separate programs: one program is CLI, and the other program is Agent.
## CLI ## CLI
Mizu CLI is the program that's responsible for the deployment of Mizu Agent to the Kubernetes cluster which your `kubectl` Mizu CLI is responsible for the deployment of Mizu Agent to the Kubernetes cluster which your `kubectl`
points to. Mizu CLI also configures the Mizu Agent according to the parameters supplied through, you guessed it CLI. points to. Mizu CLI also configures the Mizu Agent according to the parameters supplied through- you guessed it- the Mizu CLI.
It can be built using `make cli` command. Which is a `Makefile` rule. It can be built using the `make cli` command, which is a `Makefile` rule.
Mizu CLI is the program that's published under [the latest release](https://github.com/up9inc/mizu/releases/latest) section Mizu CLI is the program that's published under the [latest release](https://github.com/up9inc/mizu/releases/latest) section. The supported operating systems are macOS(darwin) and Linux (64-bit only).
and the supported operating systems are macOS(darwin) and Linux (64-bit only).
Another important job of Mizu CLI is that it automatically establishes a proxy to the Mizu Agent as soon as it's deployed. Mizu CLI automatically establishes a proxy to the Mizu Agent as soon as it's deployed, so the user can effortlessly access the web UI.
Such that the user can easily access to the web UI effortlessly.
## Agent ## Agent
Mizu Agent is a Docker image that's pulled into the subject Kubernetes cluster. Mizu CLI is the software that orchestrates this deployment. Mizu Agent is a Docker image that's pulled into the subject Kubernetes cluster. Mizu CLI is the software that orchestrates this deployment.
The default image of Mizu Agent is `gcr.io/up9-docker-hub/mizu/main:latest` but it can be changed to a custom image The default image of Mizu Agent is `gcr.io/up9-docker-hub/mizu/main:latest` but it can be changed to a custom image
using `--set agent-image=<IMAGE>` CLI option or setting `agent-image: <IMAGE>` in `~/.mizu/config.yaml`. using the `--set agent-image=<IMAGE>` CLI option, or setting `agent-image: <IMAGE>` in `~/.mizu/config.yaml`.
The repository hosts a Docker image in the root directory. A simple Docker build and push is enough to have your own The repository hosts a Docker image in the root directory. A simple Docker build and push is enough to have your own
custom Mizu Agent version in Docker Hub, like below: custom Mizu Agent version in Docker Hub, like below:
@ -26,16 +24,17 @@ custom Mizu Agent version in Docker Hub, like below:
docker build . -t username/mizuagent:latest && docker push username/mizuagent:latest docker build . -t username/mizuagent:latest && docker push username/mizuagent:latest
``` ```
Mizu Agent consists of at least two pods and while being a single Docker image, it has actually two main modes that makes it serve for two fundamental purposes: Mizu Agent consists of at least two pods, and while it is a single Docker image, it actually has two main modes with two fundamental purposes:
- **Tapper:** Listens a Linux network interface of given Kubernetes namespace.
- **Tapper:** Listens to the Linux network interface of a given Kubernetes namespace.
- **API Server:** Acts as a hub for the tappers and provide a REST API and WebSocket connections to monitor the traffic. - **API Server:** Acts as a hub for the tappers and provide a REST API and WebSocket connections to monitor the traffic.
### Tapper ### Tapper
Tapper pod is the heart of Mizu. It listens the network traffic (TCP packets), dissects them and streams them to the API server. Tapper pod is the heart of Mizu. It listens to network traffic (TCP packets), dissects them. and streams them to the API server.
It listens all active ports, tries to analyze the incoming TCP streams and identify the protocols. It listens to all active ports and tries to analyze the incoming TCP streams and identify the protocols.
Currently Mizu supports these TCP-based protocols: Mizu currently supports these TCP-based protocols:
- HTTP 1.1 - HTTP 1.1
- gRPC (HTTP/2) - gRPC (HTTP/2)
@ -43,20 +42,19 @@ Currently Mizu supports these TCP-based protocols:
- Kafka - Kafka
- Redis - Redis
Mizu aims to understand the traffic above the Transport layer in OSI Model. It's currently only capable of Mizu aims to understand the traffic above the Transport layer in the OSI Model. It's currently only capable of
recognizing Application and Presentation layer. The UDP in Transport layer is out-of-scope for Mizu. recognizing Application and Presentation layer. The UDP in the Transport layer is out-of-scope for Mizu.
In a Kubernetes cluster, there can be one or many tappers. The number of tappers scales with the number of nodes in In a Kubernetes cluster, there can be one or many tappers. The number of tappers scales with the number of nodes in
a given Kubernetes namespace. Nodes mean machines, so each machine needs its own tapper. a given Kubernetes namespace. Nodes mean machines, so each machine needs its own tapper.
Tapper is an extremely parallel software thanks to the Goroutines and it's able to keep up with high traffic loads. Tapper is an extremely parallel software thanks to the Goroutines and it's able to keep up with high traffic loads, but just like any other software, it's limited by physical resources like CPU and memory. It's not
Although just like any other software, it's limited by the physical resources like the CPU and memory. It's not
a disk intensive program. a disk intensive program.
### API Server ### API Server
If the tapper was a freeway, the API server would be a highway. It's the road where all the other roads connected into. If the tapper is a highway, the API server is a freeway. It's the road all the other roads connect into.
The API server pod communicates with the tappers through a series of WebSocket pipelines and eventually streams The API server pod communicates with the tappers through a series of WebSocket pipelines and eventually streams
the dissected traffic into web UI. It's, in its essence, a web application. Such that it provides a REST API, a server the dissected traffic into the web UI. It's essentially a web application, in that it provides a REST API, a server
for the React app (web UI) and let's you do a bunch of other things that can be done after the traffic analysis step. for the React app (web UI) and lets you do a bunch of other things that can be done after the traffic analysis step.