Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Abhimanyu9988 opened this issue Feb 29, 2024 · 1 comment
Open

Comments

@Abhimanyu9988
Copy link

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
Copy link
Contributor

yonch commented Feb 29, 2024

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:

  • Get the contents of /etc/debian_version, /etc/os-release, and /etc/system-release on those nodes (not all of those might appear). These values will be used to detect the distro.
  • Check what package management tool your distro support, is it apt or yum or other? (a quick search hints the distro is based on RHEL so probably yum)
  • Verify you are able to download Linux headers with one of the two commands given in the error log (for apt or yum)
  • Add distro detection in detect_distro() and a call to the appropriate installation function for apt/yum in install_kernel_headers()

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants