Skip to content

Conversation

@blu3r4y
Copy link
Contributor

@blu3r4y blu3r4y commented Oct 25, 2025

This PR sets kernel options CONFIG_DEBUG_INFO_BTF so that BTF type information is generated, which is necessary for eBPF-based tooling such as Tetragon to work. Additionally, for x86_64 only, it adds the missing, but recommended option CONFIG_BPF_KPROBE_OVERRIDE to also support policy enforcement (https://tetragon.io/docs/installation/faq/#what-are-the-linux-kernel-configuration-options-needed-to-run-tetragon).

I already built the image locally and started a cluster like so:

minikube start --driver=hyperv --iso-url=file://C:/path/to/your/minikube-amd64.iso

I temporarily uploaded the ISO files here; I will delete them again in a few weeks:

Tetragon can now successfully discover BTF type information.

level=info msg="BTF discovery: default kernel btf file found" btf-file=/sys/kernel/btf/vmlinux
level=error msg="unable to read /sys/kernel/security directory" error="open /sys/kernel/security: no such file or directory"
level=info msg="BPF detected features: override_return: true, buildid: true, kprobe_multi: false, uprobe_multi true, fmodret: true, fmodret_syscall: true, signal: true, large: true, link_pin: true, lsm: false, missed_stats_kprobe_multi: false, missed_stats_kprobe: true, batch_update: true"

Fixes #21788. Similar intention as closed PR #21622.

I am not sure what other steps are necessary to bump the ISO for minikube.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Oct 25, 2025
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 25, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: blu3r4y / name: Mario Kahlhofer (7387cd3, 987f175)
  • ✅ login: minikube-bot / name: minikube-bot (bb40a8e)

@k8s-ci-robot
Copy link
Contributor

Welcome @blu3r4y!

It looks like this is your first PR to kubernetes/minikube 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/minikube has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 25, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @blu3r4y. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 25, 2025
@blu3r4y blu3r4y changed the title iso: Enable BTF debug symbols to support eBPF tooling (fixes #21788) iso: Enable BTF debug symbols to support eBPF tooling Oct 25, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Oct 25, 2025
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Oct 25, 2025
@nirs
Copy link
Contributor

nirs commented Oct 25, 2025

@blu3r4y thanks! do we have a reason to split this to 2 commits? The commits message do not explain what each commit does and do not provide any justification for the changes.

If there is no reason to split the commits, please squash them. The commit message should explain why every config is needed, since we cannot keep comments in the config files. (they are removed by menuconfig).

It seems that the pr message describes all the details, but this info should be available in git log.

When the change is ready we will build the iso using the iso build job, which will build an iso and add a commit updating minikube to consume this iso.

@nirs
Copy link
Contributor

nirs commented Oct 25, 2025

/cc @nirs

@k8s-ci-robot k8s-ci-robot requested a review from nirs October 25, 2025 19:13
@nirs
Copy link
Contributor

nirs commented Oct 25, 2025

/cc @medyagh

@k8s-ci-robot k8s-ci-robot requested a review from medyagh October 25, 2025 19:13
@blu3r4y blu3r4y force-pushed the iso-linux-6.6-btf branch 2 times, most recently from 0fb0436 to d7d91bd Compare October 25, 2025 19:37
@blu3r4y
Copy link
Contributor Author

blu3r4y commented Oct 25, 2025

@nirs Squashed the two commits into one and added the full description to the commit message.

@nirs
Copy link
Contributor

nirs commented Oct 25, 2025

@blu3r4y thank!

I tested that running linux-menuconfig-* targets does not change the configs and the changes looks good to me.

Can you share instructions on how to test this functionality? Ideally we can add a simple integration tests so future kernel upgrade will not break this functionality again.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 25, 2025
@nirs
Copy link
Contributor

nirs commented Oct 25, 2025

/ok-to-build-iso

@blu3r4y
Copy link
Contributor Author

blu3r4y commented Oct 25, 2025

@nirs I think a simple check if file /sys/kernel/btf/vmlinux is present in the image would suffice. I quickly glanced over the existing integration tests and it seems reasonable to add a check to test/integration/guest_env_test.go, which is already checking that certain binaries and mounts are available. Something like this could work:

t.Run("Files", func(t *testing.T) {
	// /sys/kernel/btf/vmlinux -- Check if BTF types are present for eBPF tooling
	for _, file := range []string{"/sys/kernel/btf/vmlinux"} {
		file := file
		t.Run(file, func(t *testing.T) {
			t.Parallel()
			rr, err := Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "ssh", fmt.Sprintf("test -f %s && echo 'OK' || echo 'NOT FOUND'", file)))
			if err != nil {
				t.Errorf("failed to verify existence of %q file : args %q: %v", file, rr.Command(), err)
			}

			if !strings.Contains(rr.Stdout.String(), "OK") {
				t.Errorf("expected file %q to exist, but it does not", file)
			}
		})
	}
})

I can add another commit to this PR adding a test.

Do you prefer having a test in guest_env_test.go, or do you rather prefer having a standalone test?

@nirs
Copy link
Contributor

nirs commented Oct 25, 2025

@nirs I think a simple check if file /sys/kernel/btf/vmlinux is present in the image would suffice. I quickly glanced over the existing integration tests and it seems reasonable to add a check to test/integration/guest_env_test.go, which is already checking that certain binaries and mounts are available. Something like this could work:

t.Run("Files", func(t *testing.T) {
	// /sys/kernel/btf/vmlinux -- Check if BTF types are present for eBPF tooling
	for _, file := range []string{"/sys/kernel/btf/vmlinux"} {
		file := file
		t.Run(file, func(t *testing.T) {
			t.Parallel()
			rr, err := Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "ssh", fmt.Sprintf("test -f %s && echo 'OK' || echo 'NOT FOUND'", file)))
			if err != nil {
				t.Errorf("failed to verify existence of %q file : args %q: %v", file, rr.Command(), err)
			}

			if !strings.Contains(rr.Stdout.String(), "OK") {
				t.Errorf("expected file %q to exist, but it does not", file)
			}
		})
	}
})

I can add another commit to this PR adding a test.

Do you prefer having a test in guest_env_test.go, or do you rather prefer having a standalone test?

guest_env_test.go looks perfect for this test.

A generic Files test that we can extend later looks good, but it will help to add a description for every file. Maybe add a more specific BTF test instead? This will make it easy to document the test and add more checks later if we want to test more details.

A link to the issue in the test will help to understand why the test is needed.

nirs added a commit to nirs/minikube that referenced this pull request Oct 25, 2025
The test used `go:build iso` so it was not included in the integration
tests. Change to `go:build integration` so we test in the CI.

Rename the file and the test name to make it more clear that this test
is about the iso image.

Skip the test for non vm-driver, since this tests is about the iso
image.

We may need to add a similar test or adapt this test so it can be used
also with the kicbase image.

This test will be useful to validate kubernetes#21800, avoiding regressions such
as kubernetes#21788.
nirs added a commit to nirs/minikube that referenced this pull request Oct 26, 2025
The test used `go:build iso` so it was not included in the integration
tests. Change to `go:build integration` so we test in the CI.

Rename the file and the test name to make it more clear that this test
is about the iso image.

Skip the test for non vm-driver, since this tests is about the iso
image.

We may need to add a similar test or adapt this test so it can be used
also with the kicbase image.

This test will be useful to validate kubernetes#21800, avoiding regressions such
as kubernetes#21788.
@nirs
Copy link
Contributor

nirs commented Oct 27, 2025

@blu3r4y #21801 was merged today. Can you rebase on master and resolve the conflict?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 27, 2025
This change sets kernel option CONFIG_DEBUG_INFO_BTF so that BTF type
information is generated, which is necessary for eBPF-based tooling such
as Tetragon to work. Additionally, for x86_64 only, it adds the recommended
option CONFIG_BPF_KPROBE_OVERRIDE to also support policy enforcement.

Setting CONFIG_DEBUG_INFO_BTF also requires setting
CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT. Setting
CONFIG_BPF_KPROBE_OVERRIDE also requires setting
CONFIG_FUNCTION_ERROR_INJECTION.
@k8s-ci-robot k8s-ci-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Oct 28, 2025
@blu3r4y
Copy link
Contributor Author

blu3r4y commented Oct 28, 2025

@nirs Rebased. If I am not mistaken, I believe the ISO needs to be built again by the bot as well.

@nirs
Copy link
Contributor

nirs commented Oct 28, 2025

@nirs Rebased. If I am not mistaken, I believe the ISO needs to be built again by the bot as well.

If you rebased on master and there was no conflict in this commit:
6104756

It means that the ISO did not update and the one we built in this PR is still valid. If there was a conflict, it means that the ISO was updated by another PR, and we need to rebuild to build with the latest source.

If we need to build again, delete the ISO commit and we can start a new build.

@nirs
Copy link
Contributor

nirs commented Oct 28, 2025

/ok-to-build-iso

@blu3r4y
Copy link
Contributor Author

blu3r4y commented Oct 28, 2025

Removed the ISO commit so that it can be rebuilt with the latest source after rebasing (there was a conflict, yes).

@minikube-bot
Copy link
Collaborator

Hi @blu3r4y, we have updated your PR with the reference to newly built ISO. Pull the changes locally if you want to test with them or update your PR further.

@medyagh
Copy link
Member

medyagh commented Oct 28, 2025

/ok-to-test

blu3r4y and others added 2 commits October 29, 2025 09:01
BTF types are required for CO-RE eBPF programs. Check if the kernel was compiled
with CONFIG_DEBUG_INFO_BTF and created the /sys/kernel/btf/vmlinux file.
@k8s-ci-robot
Copy link
Contributor

@blu3r4y: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
integration-kvm-crio-linux-x86-64 bb40a8e link true /test integration-kvm-crio-linux-x86-64
integration-kvm-containerd-linux-x86-64 bb40a8e link true /test integration-kvm-containerd-linux-x86-64
integration-docker-containerd-linux-x86-64 bb40a8e link true /test integration-docker-containerd-linux-x86-64
integration-kvm-docker-linux-x86-64 bb40a8e link true /test integration-kvm-docker-linux-x86-64
integration-docker-docker-linux-x86-64 bb40a8e link true /test integration-docker-docker-linux-x86-64
integration-none-docker-linux-x86-64 bb40a8e link true /test integration-none-docker-linux-x86-64
integration-docker-crio-linux-x86-64 bb40a8e link true /test integration-docker-crio-linux-x86-64

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 21800 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 44.3s    │ 43.4s                  │
│ enable ingress │ 17.6s    │ 17.6s                  │
└────────────────┴──────────┴────────────────────────┘

Times for minikube start: 45.9s 45.0s 43.3s 42.7s 44.8s
Times for minikube (PR 21800) start: 43.1s 41.7s 42.6s 44.9s 44.6s

Times for minikube ingress: 19.8s 16.9s 19.8s 15.8s 15.8s
Times for minikube (PR 21800) ingress: 15.3s 17.4s 16.9s 16.9s 21.4s

docker driver with docker runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 21800 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 23.9s    │ 24.2s                  │
│ enable ingress │ 12.5s    │ 12.3s                  │
└────────────────┴──────────┴────────────────────────┘

Times for minikube start: 21.3s 22.4s 23.4s 28.0s 24.2s
Times for minikube (PR 21800) start: 24.2s 24.3s 22.1s 24.8s 25.7s

Times for minikube ingress: 12.7s 12.7s 12.7s 13.7s 10.7s
Times for minikube (PR 21800) ingress: 10.7s 13.8s 13.7s 12.7s 10.7s

docker driver with containerd runtime

┌────────────────┬──────────┬────────────────────────┐
│    COMMAND     │ MINIKUBE │ MINIKUBE  ( PR 21800 ) │
├────────────────┼──────────┼────────────────────────┤
│ minikube start │ 22.0s    │ 20.5s                  │
│ enable ingress │ 21.4s    │ 21.4s                  │
└────────────────┴──────────┴────────────────────────┘

Times for minikube start: 21.6s 22.8s 20.8s 21.6s 23.3s
Times for minikube (PR 21800) start: 20.1s 19.0s 22.7s 20.3s 20.3s

Times for minikube ingress: 20.2s 23.2s 23.2s 20.2s 20.2s
Times for minikube (PR 21800) ingress: 21.2s 22.2s 20.2s 21.2s 22.2s

@minikube-pr-bot
Copy link

Here are the number of top 10 failed tests in each environments with lowest flake rate.

Environment Test Name Flake Rate

Besides the following environments also have failed tests:

To see the flake rates of all tests by environment, click here.

@blu3r4y
Copy link
Contributor Author

blu3r4y commented Oct 29, 2025

I built the Windows binary locally again with the new ISO and can confirm that Minikube and Tetragon are still working for me.

@medyagh
Copy link
Member

medyagh commented Oct 29, 2025

thank you @blu3r4y for fixing this regression

@medyagh
Copy link
Member

medyagh commented Oct 29, 2025

/lgtm

@medyagh medyagh merged commit 37b032e into kubernetes:master Oct 29, 2025
30 of 48 checks passed
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 29, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: blu3r4y, medyagh, nirs

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 29, 2025
@blu3r4y
Copy link
Contributor Author

blu3r4y commented Oct 29, 2025

sure thing, thanks @nirs for the amazing guidance and support 👏

@blu3r4y blu3r4y deleted the iso-linux-6.6-btf branch October 30, 2025 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BTF type information is missing since recent kernel update 6.6.95, making eBPF tools such as Tetragon crash on start-up

6 participants