# Network monitoring & diagnosis suite for Kubernetes


![logo](https://github.com/alibaba/kubeskoop/raw/main/docs/images/kubeskoop_logo.svg align="center")

## Overview

KubeSkoop is a kubernetes networking diagnose tool for different CNI plug-ins and IAAS providers. KubeSkoop automatic construct network traffic graph of Pod in the Kubernetes cluster, monitoring and analysis of the kernel's critical path by eBPF, to resolve most of Kubernetes cluster network problems.

### Key Features

#### One-Shot Diagnose For Network Broken

* Diagnose in-cluster traffic between Pod,Service,Node and Ingress/Egress Traffic.
    
* Cover whole linux network stack: Socket,Bridge,Veth,Netfilter,sysctls…
    
* Support IaaS network probe for cloud providers.
    

#### In-Depth Kernel Monitor

* eBPF seamless kernel monitor
    
* CO-RE scripts on series kernel by BTF
    
* export metrics to standard Prometheus metric API
    

#### Network Anomaly Event

* support dozens of anomy scenes recognition
    
* export anomy event to Grafana Loki or Web Console
    

#### User-friendly Web Console

* Integrating all capabilities of KubeSkoop, provides network diagnosis, event monitoring, packet capturing, latency detection, etc.
    

## Quick Start

You can view the full documentation from the [KubeSkoop.io](https://kubeskoop.io/).

### Installation

You can quickly deploy KubeSkoop, Prometheus, Grafana and Loki to your cluster via [skoopbundle.yaml](https://github.com/alibaba/kubeskoop/blob/main/deploy/skoopbundle.yaml).

```yaml
kubectl apply -f https://raw.githubusercontent.com/alibaba/kubeskoop/main/deploy/skoopbundle.yaml
```

***Note: skoopbundle.yaml starts with the minimum number of replicas and default configurations, which is not suitable for production environments.***

When installation is done, you can acess the KubeSkoop Web Console by service `webconsole`.

```yaml
kubectl get svc -n kubeskoop webconsole
```

You may need a `Nodeport` or `LoadBalancer` to acess from outside of the cluster.

Default username is `admin`, and password is `kubeskoop`.

[![Web Console](https://github.com/alibaba/kubeskoop/raw/main/docs/images/web_console.jpg align="left")](https://github.com/alibaba/kubeskoop/blob/main/docs/images/web_console.jpg)

### Network diagnosis

#### Connectivity Diagnosis

Connectivity diagnosis can be submitted through the web console.

[![Diagnose](https://github.com/alibaba/kubeskoop/raw/main/docs/images/diagnose.jpg align="left")](https://github.com/alibaba/kubeskoop/blob/main/docs/images/diagnose.jpg)

Under **Diagnosis - Connectivity Diagnosis**, you can enter the source address, destination address, port, and protocol for diagnosis, and click `Diagnose` to submit the diagnosis. After the diagnosis is complete, you can see the result in the history list.

[![Diagnosis Result](https://github.com/alibaba/kubeskoop/raw/main/docs/images/diagnosis_result.jpg align="left")](https://github.com/alibaba/kubeskoop/blob/main/docs/images/diagnosis_result.jpg)

#### Packet Capturing

Under **Diagnosis - Packet Capturing**，you can perform packet capturing for node/pod in the cluster.

[![Packet Capturing](https://github.com/alibaba/kubeskoop/raw/main/docs/images/packet_capturing.jpg align="left")](https://github.com/alibaba/kubeskoop/blob/main/docs/images/packet_capturing.jpg)

#### Latency Detection

Under **Diagnosis - Latency Detection**，you can detect latencies between multiple nodes and pods.

[![Latency Detection](https://github.com/alibaba/kubeskoop/raw/main/docs/images/ping_mesh.jpg align="left")](https://github.com/alibaba/kubeskoop/blob/main/docs/images/ping_mesh.jpg)

### Monitor network jitter and bottlenecks

#### Network Performance Dashboard

View the network permance dashboard from **Monitoring - Dashboard**. In the dashboard, you can check the water level of each monitor item corresponding to the time point of the performance problem.

[![grafana_performance](https://github.com/alibaba/kubeskoop/raw/main/docs/images/monitoring.jpg align="left")](https://github.com/alibaba/kubeskoop/blob/main/docs/images/monitoring.jpg)

#### Network Jitter & Anomy Event Analysis

Under **Monitoring - Event**, you can view the anomaly events occurring within the cluster at the current time point. You can also manually select the desired time range, or filter based on event type, node, and information such as the namespace/name of the Pod where the event occurred.

Click `Live` on the right top to view the live event stream according to the current filters.

[![Events](https://github.com/alibaba/kubeskoop/raw/main/docs/images/events.jpg align="left")](https://github.com/alibaba/kubeskoop/blob/main/docs/images/events.jpg)

#### Network Link Graph

Under the homepage or **Monitoring - Network Graph**, you can see the actual network link graph in the cluster, with time and namespaces. You can also switch view mode to `Table` to view each connection.

[![Network Graph Table](https://github.com/alibaba/kubeskoop/raw/main/docs/images/network_graph_table.jpg align="left")](https://github.com/alibaba/kubeskoop/blob/main/docs/images/network_graph_table.jpg)

## Contributing

Feel free to open issues and pull requests. Any feedback is much appreciated!

### Contributors

This project exists, thanks to all the people who contributed.

[![](https://camo.githubusercontent.com/330a58a9672b9ec5f605e965233d92b1108934ca5c2da581586abf442332d558/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6b756265736b6f6f702f636f6e7472696275746f72732e7376673f77696474683d38393026627574746f6e3d66616c7365 align="left")](https://github.com/alibaba/kubeskoop/graphs/contributors)

## Contact

* DingTalk Group ID(26720020148)
    

## License

Most source code in KubeSkoop which running on userspace are licensed under the [Apache License, Version 2.0](https://github.com/alibaba/kubeskoop/blob/main/LICENSE.md).  
The BPF code in `/bpf` directory are licensed under the [GPL v2.0](https://github.com/alibaba/kubeskoop/blob/main/bpf/COPYING) to compat with Linux kernel helper functions.

## Security

Please report vulnerabilities by email to [kubernetes-security@service.aliyun.com](mailto:kubernetes-security@service.aliyun.com). Also see our [SECURITY.md](https://github.com/alibaba/kubeskoop/blob/main/SECURITY.md) file for details.
