k8spacket icon indicating copy to clipboard operation
k8spacket copied to clipboard

Can not find plugins

Open alexandersperling opened this issue 1 year ago • 8 comments

When deploying k8spacket in our cluster its not able to find the needed plugins, however they are available in the plugins directory

I'm getting this error message

2024/03/27 12:58:02 [k8spacket] [plugins] Cannot find plugin TLSConsumerPlugin, gave up. plugin: symbol TLSConsumerPlugin not found in plugin github.com/k8spacket/plugins/nodegraph
2024/03/27 12:58:02 [k8spacket] [plugins] Cannot find plugin TCPConsumerPlugin, gave up. plugin: symbol TCPConsumerPlugin not found in plugin github.com/k8spacket/plugins/tls-parser

When moving the plugins into the directory where the k8spacket binary lives, I wont get this message. However the application fails to start up with the following error.

2024/03/27 13:29:27 [k8spacket] [api] Serving requests on port 6676
2024/03/27 13:29:27 [k8spacket] INIT inet
2024/03/27 13:29:27 [k8spacket] [inet] Cannot attach tracepoint: neither debugfs nor tracefs are mounted
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1e3e94f]

goroutine 8 [running]:
github.com/k8spacket/k8spacket/ebpf/inet.Init()
	/home/k8spacket/ebpf/inet/inet.go:54 +0x1af
created by github.com/k8spacket/k8spacket/ebpf.LoadEbpf in goroutine 1
	/home/k8spacket/ebpf/loader.go:20 +0x1a

What might be the problem here?

System:

AWS EKS AmazonLinux 2 Deployed with helm

alexandersperling avatar Mar 27 '24 13:03 alexandersperling

Hi @alexandersperling

The message: Cannot find plugin ... is expected here because:

  • nodegraph plugin implements only the TCPConsumerPlugin symbol, so the message informs about missing another symbol TLSConsumerPlugin
  • tls_parser plugin implements only the TLSConsumerPlugin symbol, so the message informs about missing another symbol TCPConsumerPlugin And this is fine.

About Cannot attach tracepoint: neither debugfs nor tracefs are mounted:

The problem is connected with the kernel tracing path: /sys/kernel/tracing. As far as I remember on AmazonLinux VMs, the path /sys/kernel/tracing/ is empty, and kernel tracing is available on path /sys/kernel/debug/tracing/

Let's try to change it in the daemonset resource:

kubectl -n k8spacket edit daemonsets.apps k8spacket

and change each (2 occurrences) /sys/kernel/tracing to /sys/kernel/debug/tracing/

k8spacket avatar Mar 27 '24 14:03 k8spacket

Additionally, what version of Linux kernel is there on your AmazonLinux VMs? Remember about the limitation kernel version >= 5.8

k8spacket avatar Mar 27 '24 14:03 k8spacket

Thanks for the quick answer, Will try to change this.

And we are using 5.10

alexandersperling avatar Mar 27 '24 14:03 alexandersperling

Tried to change the volume mounts and now I'm getting the following error.

Error: failed to create containerd task: failed to create shim task: OCI runtime create failed: runc create failed: unable to s │
│ tart container process: error during container init: error mounting "/sys/kernel/debug/tracing" to rootfs at "/sys/kernel/debug/tracing": mkdir /run/containerd/io.containerd.runtime.v2.task/k8s │
│ .io/k8spacket/rootfs/sys/kernel/debug/tracing: no such file or directory: unknown  

when checking the instance itself, the directory is available

alexandersperling avatar Mar 27 '24 14:03 alexandersperling

Ok, my fault. The path mounted from the node should be /sys/kernel/debug/tracing, but the container should see it on the path: /sys/kernel/tracing

It should look like:

spec:
  template:
    spec:
      containers:
. . .
        volumeMounts:
. . .
        - mountPath: /sys/kernel/tracing
          name: tracing
      volumes:
. . .
      - hostPath:
          path: /sys/kernel/debug/tracing
          type: ""
        name: tracing

k8spacket avatar Mar 27 '24 15:03 k8spacket

Thanks, that fixed it.

I'm playing around currently with that tool, but when we want to use this in some more automated way, I will need to find a way to configure those values.

Are you open that I should open an PR for that?

alexandersperling avatar Mar 27 '24 15:03 alexandersperling

Of course. It is a great idea to add volumes and volumeMounts to values.yaml.

k8spacket avatar Mar 27 '24 15:03 k8spacket

Thank you for this, currently our team have the same issue

muhammad-asn avatar Mar 31 '24 06:03 muhammad-asn

Merged

To install the new version:

helm repo update k8spacket

helm install k8spacket --namespace k8spacket k8spacket/k8spacket --create-namespace

Thanks @alexandersperling 👏

k8spacket avatar Apr 03 '24 14:04 k8spacket

Thanks for the support. This works now.

alexandersperling avatar Apr 03 '24 15:04 alexandersperling