open-telemetry / opentelemetry-network

eBPF Collector
https://opentelemetry.io
Apache License 2.0
297 stars 47 forks source link

Kernel collector issue on ROSA OpenShift(4.14.12) Redhat host #254

Open Abhimanyu9988 opened 9 months ago

Abhimanyu9988 commented 9 months ago

Describe the issue you're reporting

Description

On ROSA (4.14.12) with AMI rhcos-414.92.202310170514-0-x86_64-34850061-abaf-402d-92df-94325c9e947f, We are getting unsupported_distro ERROR

Steps to Reproduce

I installed Kernel collector on ROSA (OpenShift) after creating a service account

serviceAccount:
      create: true
      name: kernel-sa

And providing kernel-sa privilege access to satisfy the need for --privileged, --pid host and --network host

oc describe scc privileged
Name:                       privileged
Priority:                   <none>
Access:
  Users:                    system:admin,system:serviceaccount:openshift-infra:build-controller
  Groups:                   system:cluster-admins,system:nodes,system:masters
Settings:
  Allow Privileged:             true
  Allow Host Network:               true
  Allow Host Ports:             true
  Allow Host PID:               true

I ran the command -> oc adm policy add-scc-to-user privileged system:serviceaccount:appdynamics:kernel-sa

Expected Result

I wished to have my Kernel collector pod start up fine.

Actual Result

I get the ERROR

---  END  log from kernel headers resolution with error 'unsupported_distro': -------------
launching kernel collector...
+ exec /srv/kernel-collector --host-distro unknown --kernel-headers-source unknown --entrypoint-error unsupported_distro --disable-nomad-metadata --warning

Automatically fetching kernel headers for the Linux distro 'unknown' is currently unsupported.

We're regularly adding kernel headers fetching support for popular Linux distros so if
you're using a well known distro, please reach out to support so we can better support
your use case.

In the meantime, please install kernel headers manually on each host before running
the Kernel Collector.

To manually install kernel headers, follow the instructions below:

  - for Debian/Ubuntu based distros, run:

      sudo apt-get install --yes "linux-headers-`uname -r`"

  - for RedHat based distros like CentOS and Amazon Linux, run:

      sudo yum install -y "kernel-devel-`uname -r`"

eBPF collector version 0.10.0

yonch commented 9 months ago

Hi @Abhimanyu9988 !

It seems that the scripts might not be able to detect the ROSA distro, so are unable to download kernel headers. Distro detection determines whether the scripts use apt or yum to install kernel headers. This is done in kernel_headers.sh.

To add support:

It should be a 2-3 line patch, happy to review it.