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

Allow configuring cgroup2 path #8085

Merged
merged 7 commits into from
Feb 15, 2024

Conversation

amrut-asm
Copy link
Contributor

@amrut-asm amrut-asm commented Oct 5, 2023

Description

Currently, the mount-bpffs init container tries to create the folder /run/calico/cgroup for mounting the cgroupv2 fs

This causes issues on distros like Talos Linux as described in the issue #7892

This can be a configurable path instead

Related issues/PRs

#7892

Todos

  • Tests
  • Documentation
  • Release note

Release Note

ebpf: alternative cgroup2 mount path can be specified by setting CALICO_CGROUP_PATH evn var for node.

Reminder for the reviewer

Make sure that this PR has the correct labels and milestone set.

Every PR needs one docs-* label.

  • docs-pr-required: This change requires a change to the documentation that has not been completed yet.
  • docs-completed: This change has all necessary documentation completed.
  • docs-not-required: This change has no user-facing impact and requires no docs.

Every PR needs one release-note-* label.

  • release-note-required: This PR has user-facing changes. Most PRs should have this label.
  • release-note-not-required: This PR has no user-facing changes.

Other optional labels:

  • cherry-pick-candidate: This PR should be cherry-picked to an earlier release. For bug fixes only.
  • needs-operator-pr: This PR is related to install and requires a corresponding change to the operator.

@amrut-asm amrut-asm requested a review from a team as a code owner October 5, 2023 01:27
@marvin-tigera marvin-tigera added this to the Calico v3.27.0 milestone Oct 5, 2023
@marvin-tigera marvin-tigera added release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels Oct 5, 2023
@CLAassistant
Copy link

CLAassistant commented Oct 5, 2023

CLA assistant check
All committers have signed the CLA.

@amrut-asm amrut-asm changed the title Configure cgroup2 path Allow configuring cgroup2 path Oct 5, 2023
@tomastigera
Copy link
Contributor

tomastigera commented Oct 6, 2023

@amrut-asm the change lgtm. Would you also consider an operator change so that Talos users are not limited to using manifest installation?

@amrut-asm
Copy link
Contributor Author

@amrut-asm the change lgtm. Would you also consider an operator change so that Talos users are not limited to using manifest installation?

Sure

@amrut-asm
Copy link
Contributor Author

@tomastigera The relevant change in operator tigera/operator#2919


GlobalPinDir = DefaultBPFfsPath + "/tc/globals/"
ObjectDir = "/usr/lib/calico/bpf"
)

func GetCgroupV2Path() string {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tomastigera I think we will want to expose this using a proper FelixConfiguration parameter rather than an environment variable, no? Is there precedence for this in the BPF data plane code?

Copy link
Contributor

@tomastigera tomastigera Dec 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be tricky as this needs to get into an init container. After some discussion at that time, this was an acceptable solution for this problem.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, this code isn't executed in felix proper?

It could in theory still be done via FelixConfiguration (in addition to this env var on the init container) - the operator already reads FelixConfiguration and uses it to configure various components. The flow would look like this:

  • Set this field in FelixConfiguration
  • tigera/operator reads FelixConfiguration, sets and env var for this container based on the value it finds

That would mean if we ever do need this value inside felix proper, it would already be available and we wouldn't need two separate configuration options. But I am not well positioned to say how likely that is.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds like a great suggestion to me 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I will give it a shot

@tomastigera tomastigera added the area/bpf eBPF Dataplane issues label Dec 14, 2023
@tomastigera tomastigera added the needs-operator-pr PRs that require follow-on operator work label Feb 14, 2024
Copy link
Contributor

@tomastigera tomastigera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thank you for the contribution. Lets merge this one and let figure out the operator thing separately.

@tomastigera
Copy link
Contributor

Only one unrelated failure/flake in BPF tests

@tomastigera tomastigera merged commit e5acbc7 into projectcalico:master Feb 15, 2024
1 of 2 checks passed
tomastigera added a commit that referenced this pull request Feb 15, 2024
…v3.27

[release-v3.27] Auto pick #8085: Allow custom cgroup2 path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/bpf eBPF Dataplane issues cherry-pick-candidate docs-pr-required Change is not yet documented needs-operator-pr PRs that require follow-on operator work release-note-required Change has user-facing impact (no matter how small)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants