In this series of articles, we’ll explore Tetragon, a tool for securing Kubernetes clusters.
Here are the questions you’ll be able to answer after reading these articles:
- Is this tool right for your Kubernetes cluster?
- How do you install it?
- How does it work?
- How can you extend its core features?
In this first article, we’ll take a look at what Tetragon is all about.

What is Tetragon?#
What’s This Thing?#
Have you ever wondered what’s actually happening in each of your Kubernetes cluster pods at any given moment? Which processes are running? Who launched them? With what arguments?
And if one of your pods were compromised, how would you detect malicious behavior before it causes damage?
This is exactly where Tetragon comes in.
It was created by the company Isovalent, which is also behind Cilium, a CNI plugin for Kubernetes clusters. Like Cilium, Tetragon is based on eBPF.

What is eBPF?#
eBPF programs are programs that run within the Linux kernel. They are attached (or “hooked”) to specific points in the kernel. Every time the Linux kernel passes through a hook, the program is triggered.
These programs are relatively difficult to write because they require knowledge of low-level system programming.

How does Tetragon use eBPF?#
Tetragon is essentially an “eBPF program generator”:
- You create tracing policies (in YAML);
- Tetragon translates them into eBPF programs and installs them in the Linux kernel of each server;
- every time the event described in the tracing policies occurs, Tetragon will generate a log containing all available information.
This means you won’t need to know a low-level language. However, understanding eBPF and having a solid grasp of the Linux kernel is essential to becoming a Tetragon expert.
Now that we’ve covered how Tetragon works in theory, let’s move on to the practical side.
Tetragon Demo 🚀#
Installation on a Server#
We’ll show you how to install Tetragon outside of Kubernetes. This will help you better understand how it works without needing to know Kubernetes.
We’ll install the latest version of Tetragon (1.6.0 at the time of writing). We’ll create variables so the installation remains compatible with new versions:
VERSION=v1.6.0
ARCH=amd64 #other choice arm64
Feel free to check if there are newer versions.
We download and extract the tar.gz file:
curl -LO https://github.com/cilium/tetragon/releases/download/$VERSION/tetragon-${VERSION}-${ARCH}.tar.gz
tar -xvf tetragon-${VERSION}-${ARCH}.tar.gz
We then install Tetragon:
cd tetragon-${VERSION}-${ARCH}/
sudo ./install.sh
This will simply copy the binaries to the correct directories, configure systemd, etc.
uninstall.sh.Let’s Take a Look at Tetragon Events#
Even before you create your own tracing policies, Tetragon already generates default events.
Using the official tetra command-line tool, you can retrieve these events in real time:
tetra getevents -o compact
With this command, you’ll see the logs generated by Tetragon. Here, without any configuration, you’ll be able to observe:
- all processes starting in real time (🚀)
- all processes terminating in real time (💥)
Thus, upon installation, Tetragon already injects eBPF programs into the Linux kernel, allowing it to log the entire lifecycle of processes.
For example, here is what I see in my VM:
🚀 process lima-default /usr/sbin/iptables -t nat -S
💥 exit lima-default /usr/sbin/iptables -t nat -S 0
🚀 process lima-default /usr/bin/touch /var/lib/apt/periodic/upgrade-stamp
🚀 process lima-default /usr/bin/apt-config shell MaxAge APT::Archives::MaxAge
🚀 process lima-default /usr/bin/dpkg --print-foreign-architectures
🚀 process lima-default /usr/bin/apt-config shell MaxAge APT::Periodic::MaxAge
🚀 process lima-default /usr/bin/dpkg --print-foreign-architectures
🚀 process lima-default /usr/bin/apt-config shell MinAge APT::Archives::MinAge
🚀 process lima-default /usr/sbin/iptables -t nat -S
💥 exit lima-default /usr/sbin/iptables -t nat -S 0
- The first column is an emoji indicating the process status (🚀 or 💥)
- The second column is its translation (
processorexit) - The third column is the server name
- The fourth column is the command name and its arguments
- If the process is in
exitstate, the last column is the command’s exit code (0if everything goes well)
You can also change the standard output to generate more standard logs in JSON format, and then all you need to do is install tools like Prometheus, Grafana, or Fluentbit to process them asynchronously.
Introduction to Tracing Policies#
Installing Tetragon already allows you to observe quite a few things. However, certain more specific pieces of information are not automatically available, for example:
- knowing which pod is communicating with a specific IP address;
- checking whether a particular file has been modified.
To do this, you need to define tracing policies. Furthermore, these tracing policies allow you to go even further: in addition to monitoring, Tetragon can take action before the binary has even finished executing.
Tetragon can then act proactively by preventing a process from accessing a resource, for example.
We’ve introduced Tetragon:
- how it works in general;
- how to install it on a Linux server;
- its default behavior;
- and how to extend its capabilities using Tracing Policies.
In the next section, we’ll install Tetragon in its natural environment: Kubernetes.

