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

Calico enable support for eBPF #7618

Merged

Conversation

cristicalin
Copy link
Contributor

@cristicalin cristicalin commented May 17, 2021

What type of PR is this?
/kind feature

What this PR does / why we need it:
Calico supports the eBPF dataplane in more modern distributions like Ubuntu 20.04, CentOS 8 (and streams) and newer. This PR enables the necessary capabilities to enable eBPF.

While this PR does not provide a single setting (due to the nature of how eBPF is enabled in Calico), it does document the complete process to set it up.

For the time being, we are missing way for calico-node to access the kube-api correctly. The current assumption in Calico is that there is an external loadbalancer that services the kubernetes cluster which may not be true for some kubespray deployments.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Calico: Support enabling the eBPF dataplane for Calico

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 17, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @cristicalin. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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/test-infra repository.

@k8s-ci-robot k8s-ci-robot requested review from EppO and oomichi May 17, 2021 18:00
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 17, 2021
@cristicalin cristicalin marked this pull request as draft May 18, 2021 07:55
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 18, 2021
@cristicalin cristicalin force-pushed the calico_manifests_alignment branch 3 times, most recently from 470fbbe to 65b1798 Compare May 18, 2021 09:33
@cristicalin cristicalin marked this pull request as ready for review May 18, 2021 09:39
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 18, 2021
Copy link
Contributor

@oomichi oomichi left a comment

Choose a reason for hiding this comment

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

/ok-to-test

- name: "Check supported calico versions"
assert:
that:
- "calico_version in calico_crds_archive_checksums.keys()"
Copy link
Contributor

Choose a reason for hiding this comment

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

Here we need to fix indent to pass yamlint job.

$ yamllint --strict .
./roles/network_plugin/calico/tasks/check.yml
  5:6       error    wrong indentation: expected 6 but found 5  (indentation)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry about that, it is fixed in the last push.

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 18, 2021
@cristicalin cristicalin force-pushed the calico_manifests_alignment branch 2 times, most recently from 1c0f632 to a2439c7 Compare May 18, 2021 20:10
Copy link
Contributor

@oomichi oomichi left a comment

Choose a reason for hiding this comment

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

Thanks for updating, still some questions before merging.

/ok-to-test

assert:
that:
- "calico_version is version('v3.19.0','>=')"
msg: "you should use calico 3.19.0 or newer with eBPF dataplane"
Copy link
Contributor

Choose a reason for hiding this comment

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

Just question:
According to https://www.projectcalico.org/introducing-the-calico-ebpf-dataplane/ which is mentioned in this pr, eBPF dataplane is implemented since Calico v3.13 as tech review.
Is that GA since v3.19?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, this is just from some discussions I had with project calico staff on their slack. I actually did the development for this PR on 3.18.3 and it worked OK but their recommendation was to use 3.19.0 as they would not invest into debugging older releases.

We can relax this completely but I would need to test with all the older versions to confirm behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've tested 3.16.10, 3.17.4 and 3.18.3 and I was able to do successful deployments with all 3 versions. As such I removed this dependency and dropped the 3.19.0 change from this PR in favor of opening a separate one for the new calico version: #7630

periodSeconds: 10
initialDelaySeconds: 10
failureThreshold: 6
{% endif %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the above change for Calico v3.19.0? not for eBPF?
I could not find the relationship between the above change and eBPF.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is for v3.19.0 not strictly for eBPF. This liveness probe mechanism is not available in 3.18 and prior versions.

Copy link
Contributor

Choose a reason for hiding this comment

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

@cristicalin Thanks for your clear explanation, I got it.
Then it is better to merge #7630 before this.

@@ -39,8 +42,6 @@ rules:
verbs:
- use
{% elif calico_datastore == "kdd" %}
# Calico stores some configuration information in node annotations.
- update
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to move this part for eBPF?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is actually an unrelated fix, if you look at the upstream manifests the update applies to the nodes/status resource not policy. I can't help feeling this was actually a security issue in kubespray deployments allowing Calico service account to update policies that it shouldn't.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, I did some re-reading of this portion of the code and it seems that node annotations are only relevant with kdd in which case I was wrong to move that part around, I fixed it in the new push.

@cristicalin cristicalin force-pushed the calico_manifests_alignment branch 2 times, most recently from a3657c3 to 99b2cd7 Compare May 20, 2021 10:44
@cristicalin
Copy link
Contributor Author

/retest

@cristicalin cristicalin force-pushed the calico_manifests_alignment branch from 99b2cd7 to 2c9cf58 Compare May 21, 2021 09:47
@cristicalin cristicalin mentioned this pull request May 21, 2021
@cristicalin cristicalin force-pushed the calico_manifests_alignment branch from 2c9cf58 to 76e22ea Compare May 21, 2021 11:23
@oomichi
Copy link
Contributor

oomichi commented May 26, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 26, 2021
* allow enabling typha prometheus metrics
* manage the kubernetes-services-endpoint configmap
* enforce disabling kube-proxy when using eBPF dataplane
* ensure calico_version is supported
@cristicalin cristicalin force-pushed the calico_manifests_alignment branch from 76e22ea to 5f43fb1 Compare May 30, 2021 14:13
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 30, 2021
@cristicalin
Copy link
Contributor Author

/retest

@oomichi
Copy link
Contributor

oomichi commented Jun 1, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 1, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cristicalin, floryut

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 Jun 7, 2021
@k8s-ci-robot k8s-ci-robot merged commit ec0c0d4 into kubernetes-sigs:master Jun 7, 2021
LuckySB pushed a commit to southbridgeio/kubespray that referenced this pull request Jun 18, 2021
* Calico: align manifests with upstream

* allow enabling typha prometheus metrics

* Calico: enable eBPF support

* manage the kubernetes-services-endpoint configmap

* Calico: document the use of eBPF dataplane

* Calico: improve checks before deployment

* enforce disabling kube-proxy when using eBPF dataplane
* ensure calico_version is supported
@floryut floryut mentioned this pull request Sep 8, 2021
sakuraiyuta pushed a commit to sakuraiyuta/kubespray that referenced this pull request Apr 16, 2022
* Calico: align manifests with upstream

* allow enabling typha prometheus metrics

* Calico: enable eBPF support

* manage the kubernetes-services-endpoint configmap

* Calico: document the use of eBPF dataplane

* Calico: improve checks before deployment

* enforce disabling kube-proxy when using eBPF dataplane
* ensure calico_version is supported
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. kind/feature Categorizes issue or PR as related to a new feature. 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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants