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

Enable BPF without disruption #3183

Merged
merged 4 commits into from
Feb 27, 2024
Merged

Conversation

song-jiang
Copy link
Contributor

@song-jiang song-jiang commented Feb 19, 2024

Description

This PR is based on #2921. It should been seen as a continuation of the original work with the following modifications:

  1. Fixed an issue for patching FelixConfigurations by using the correct variable.
  2. Rewrote most of the UTs.
  3. Address @caseydavenport's comments from previous PR.

For PR author

  • Tests for change.
  • If changing pkg/apis/, run make gen-files
  • If changing versions, run make gen-versions

For PR reviewers

A note for code reviewers - all pull requests must have the following:

  • Milestone set according to targeted release.
  • Appropriate labels:
    • kind/bug if this is a bugfix.
    • kind/enhancement if this is a a new feature.
    • enterprise if this PR applies to Calico Enterprise only.

@song-jiang song-jiang changed the title [WIP]Enable BPF without disruption Enable BPF without disruption Feb 20, 2024
Copy link
Member

@caseydavenport caseydavenport left a comment

Choose a reason for hiding this comment

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

Two very minor comments, but otherwise this LGTM - thanks @song-jiang!

return nil
}

// If the Installation resource has been patched to dataplane: BPF then the
Copy link
Member

Choose a reason for hiding this comment

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

Just a nit, but the function comments should start with the function name. e.g.,

isRolloutCompleteWithBPFVolumes checks if the calico-node DaemonSet . . .

@@ -1489,6 +1489,17 @@ func (r *ReconcileInstallation) Reconcile(ctx context.Context, request reconcile
// Tell the status manager that we're ready to monitor the resources we've told it about and receive statuses.
r.status.ReadyToMonitor()

// BPF Upgrade without disruption:
// Delegate logic implementation here using the state of the installation and dependent resources.
Copy link
Member

Choose a reason for hiding this comment

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

I suggest we modify this comment to something like this:

If eBPF is enabled in the operator API, patch FelixConfiguration to enable it within Felix.

@song-jiang song-jiang merged commit 38c38d8 into tigera:master Feb 27, 2024
5 checks passed
song-jiang added a commit to song-jiang/operator that referenced this pull request Mar 18, 2024
This reverts commit 38c38d8, reversing
changes made to bc08b8a.
if fc.Spec.BPFEnabled == nil || *fc.Spec.BPFEnabled {
err := setBPFEnabledOnFelixConfiguration(fc, bpfEnabledOnInstall)
if err != nil {
reqLogger.Error(err, "Unable to enable eBPF data plane")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this correct? bpfEnabledOnInstall == false so arent's we trying to explicitly disable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! Raised PR to fix it.
@caseydavenport PTAL. Thanks.

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

Successfully merging this pull request may close these issues.

4 participants