- Kube-NetLag
Kube-NetLag is a lightweight network performance testing and latency simulation tool deployed as a DaemonSet across your Kubernetes cluster. It helps measure network delays between nodes, making it useful for debugging and optimizing cluster communication.
You can deploy Kube-NetLag using either Kubernetes manifests or a Helm chart. The Helm chart simplifies deployment and configuration, enabling seamless monitoring with Prometheus integration.
- β Network performance testing using Netperf.
- π Prometheus metrics exposure for monitoring.
- βοΈ Customizable ports & environment variables for flexibility.
- π‘ Automatic Prometheus configuration (optional).
Kube-NetLag has been successfully tested on the following Kubernetes distributions:
- β Rancher Kubernetes
- π More distributions to be tested...
If you tested it on another Kubernetes distribution, feel free to contribute and share your feedback!
- Kubernetes 1.26+
- Helm 3.0+
- Prometheus (if monitoring is required)
The manifest files are located in the manifests
directory.
kubectl apply -f manifests/
To install Kube-NetLag with default values:
helm repo add alazidis https://your-helm-repo-url
helm install kube-netlag alazidis/kube-netlag
To install with a custom configuration:
helm install kube-netlag alazidis/kube-netlag -f values.yaml
kubectl get pods -n kube-netlag
kubectl logs -l app.kubernetes.io/name=kube-netlag -n kube-netlag
To completely remove Kube-NetLag, run:
helm uninstall kube-netlag
kubectl delete namespace kube-netlag
The Helm chart allows full customization via the values.yaml
file.
Parameter | Description | Default |
---|---|---|
image.repository |
Docker image repository | alazidis/kube-netlag |
image.tag |
Image tag | Chart.Version |
image.pullPolicy |
Image pull policy | Always |
namespaceOverride |
Overrides the namespace for deployment | "" |
Parameter | Description | Default |
---|---|---|
ports.containerPort |
Netperf service port | 12865 |
ports.hostPort |
Host-mapped Netperf port | 12865 |
ports.containerPort |
Prometheus metrics port | 9090 |
ports.hostPort |
Host-mapped Prometheus port | 9090 |
Note: If modifying ports, update
extraEnv
accordingly.
Parameter | Description | Default |
---|---|---|
prometheusConfig.create |
Enable automatic Prometheus ConfigMap | true |
prometheusConfig.namespace |
Namespace for Prometheus ConfigMap | "" |
Parameter | Description | Default |
---|---|---|
resources.requests.cpu |
Requested CPU | 200m |
resources.requests.memory |
Requested Memory | 40Mi |
resources.limits.cpu |
CPU limit | 400m |
resources.limits.memory |
Memory limit | 80Mi |
If prometheusConfig.create
is set to true
, a Prometheus scrape job will be automatically created:
- job_name: "kube-netlag-daemon"
kubernetes_sd_configs:
- role: pod
namespaces:
names:
- {{ .Values.namespaceOverride | default .Release.Namespace }}
relabel_configs:
- source_labels: [__meta_kubernetes_pod_label_app]
action: keep
regex: {{ include "..name" . }}
- source_labels: [__meta_kubernetes_namespace]
action: keep
regex: {{ .Values.namespaceOverride | default .Release.Namespace }}
.....
Prometheus will automatically collect network latency and performance metrics from Kube-NetLag.
Kube-NetLag provides the following Prometheus metrics to monitor network latency between Kubernetes nodes.
Metric Name | Description |
---|---|
node_min_latency_ms |
Minimum latency in microseconds between nodes. |
node_max_latency_ms |
Maximum latency in microseconds between nodes. |
node_avg_latency_ms |
Average latency in microseconds between nodes. |
Each metric includes the following labels:
from_node
β Name of the source node (The current Node).to_node
β Name of the destination node.from_ip
β IP address of the source node.to_ip
β IP address of the destination node.
To visualize average latency between nodes in Prometheus:
node_avg_latency_ms{from_node="node-1", to_node="node-2"}
We welcome contributions from the community! π
If you'd like to report an issue, request a feature, or contribute code, please check out our:
- π Contribution Guidelines
- π¬ Open an Issue
- π Submit a Pull Request
We follow the Contributor Covenant Code of Conduct.
Please be respectful and inclusive to all community members.
Kube-NetLag is not an official Kubernetes project and is not affiliated with or endorsed by the Cloud Native Computing Foundation (CNCF) or Kubernetes.
Kube-NetLag is licensed under the Apache 2.0 License.
By contributing, you agree that your code will also be licensed under Apache 2.0.
π Read the full license here: LICENSE
- Apostolos Lazidis π