Skip to content

castai/egressd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a45946b · Apr 12, 2024
Apr 11, 2024
Apr 12, 2024
Jan 26, 2024
Jan 30, 2024
Jan 10, 2024
Aug 16, 2023
Dec 13, 2023
Dec 13, 2023
Feb 21, 2024
Aug 11, 2023
Jan 30, 2024
Apr 18, 2023
Aug 16, 2023
Apr 18, 2023
Oct 18, 2023
Nov 6, 2023
Dec 13, 2023
Feb 24, 2023
Jun 28, 2023
Feb 9, 2023
Oct 18, 2023
Apr 18, 2023
Apr 18, 2023
Jul 10, 2023
Nov 30, 2022
Oct 18, 2023
Dec 5, 2023
Aug 11, 2023
Feb 9, 2023
Apr 21, 2023
Apr 24, 2023
Apr 11, 2024
Apr 11, 2024

Repository files navigation

egressd

Kubernetes aware network traffic monitoring.

How it works

  • DaemonSet pod starts on each node.
  • Conntrack entries are fetched for pods running on each at configured interval (5 seconds by default).
    • If Cilium is used then conntrack records are fetched from eBPF maps located at host /sys/fs/bpf. These maps are created by Cilium.
    • If Linux Netfilter Conntrack module is used then Netlink is used to get these records.
  • Records are reduced by source IP, destination, IP and protocol.
  • Kubernetes context is added including source and destination pods, nodes, node zones, ips.
  • Exporter can export logs to http or prometheus.

Priviledges

Egressd runs as priviledged container for a few reasons:

  1. DNS tracer uses eBPF.
  2. Fetch conntrack entries:
    • Bidirectional mount propogation is used to enable netfilter conntrack accounting and mount cgroupv2.
    • If Cilium is used collector reads from ebpf maps which stores data in kernel.

Install

Install demo with preconfigured grafana and prometheus metrics.

curl -fsSL https://raw.githubusercontent.com/castai/egressd/master/demo.sh | bash

Expose grafana locally

 kubectl port-forward svc/egressd-grafana 8080:80 -n egressd

Example dashboard available at http://localhost:8080/d/egressd/egressd Metrics should be visible after few minutes.

Dashboard

(Optionally) Install demo onlineboutique eshop

If you want to test egressd on empty cluster.

helm upgrade --install onlineboutique oci://us-docker.pkg.dev/online-boutique-ci/charts/onlineboutique -n demo --create-namespace

Development

Start all components + test grafana,promtheus in tilt local k8s cluster.

tilt up

Release procedure (with automatic release notes)

Head to the GitHub new release page, create a new tag at the top, and click Generate Release Notes at the middle-right. image

Run e2e tests locally

KIND_CONTEXT=tilt IMAGE_TAG=local ./e2e/run.sh