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

Remove IPSec tunnel limitation #2489

Merged
merged 1 commit into from
Aug 19, 2021
Merged

Conversation

luolanzone
Copy link
Contributor

@luolanzone luolanzone commented Jul 29, 2021

I was trying to enable IPSec with VxLAN tunnel, after verify the traffic in real cluster, it turns out Antrea can actually support all tunnel modes now without much code changes.
I verified all tunnel modes with IPSec in a local Cluster, it all works fine now, so I remove the limitation on our docs and the check in the code.

resolves #2468

@luolanzone luolanzone force-pushed the ipsec-vxlan branch 2 times, most recently from d145bfd to fa00c64 Compare July 29, 2021 09:20
@codecov-commenter
Copy link

codecov-commenter commented Jul 29, 2021

Codecov Report

Merging #2489 (1858113) into main (d785904) will increase coverage by 11.23%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #2489       +/-   ##
===========================================
+ Coverage   42.51%   53.75%   +11.23%     
===========================================
  Files         148      283      +135     
  Lines       18247    22455     +4208     
===========================================
+ Hits         7758    12070     +4312     
+ Misses       9789     9099      -690     
- Partials      700     1286      +586     
Flag Coverage Δ
kind-e2e-tests 35.74% <ø> (?)
unit-tests 41.93% <ø> (-0.59%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/apiserver/handlers/endpoint/handler.go 58.82% <0.00%> (-11.77%) ⬇️
pkg/apiserver/handlers/webhook/mutation_labels.go 24.71% <0.00%> (ø)
pkg/legacyclient/listers/security/v1alpha1/tier.go 0.00% <0.00%> (ø)
pkg/apis/stats/v1alpha1/register.go 90.90% <0.00%> (ø)
...ed/typed/security/v1alpha1/clusternetworkpolicy.go 0.00% <0.00%> (ø)
pkg/apiserver/handlers/loglevel/handler.go 0.00% <0.00%> (ø)
pkg/legacyclient/clientset/versioned/clientset.go 22.58% <0.00%> (ø)
pkg/agent/proxy/metrics/metrics.go 100.00% <0.00%> (ø)
pkg/agent/proxy/types/types.go 46.66% <0.00%> (ø)
pkg/util/logdir/logdir.go 0.00% <0.00%> (ø)
... and 215 more

@luolanzone luolanzone changed the title [WIP]Remove IPSec tunnel limitation Remove IPSec tunnel limitation Aug 9, 2021
Copy link
Contributor

@jianjuns jianjuns left a comment

Choose a reason for hiding this comment

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

In my previous tests, only GRE worked. But my testbed was Ubuntu 16.04, not sure if it is too old.

Please change antrea-ipsec.yml to use Geneve tunnel type and make sure CI tests can pass before merge the change.

build/yamls/antrea-ipsec.yml Show resolved Hide resolved
moment, IPsec encyption works only for GRE tunnel (but not Geneve, VXLAN, and
STT tunnel types).
Antrea supports encrypting tunnel traffic across Nodes with IPsec ESP.
IPsec encyption works for all OVS supported tunnel including GRE, Geneve,
Copy link
Contributor

Choose a reason for hiding this comment

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

Then move Geneve to the be first, before GRE.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@luolanzone
Copy link
Contributor Author

/test-all

@luolanzone
Copy link
Contributor Author

/test-ipv6-all

@luolanzone
Copy link
Contributor Author

/test-ipv6-only-all

@luolanzone
Copy link
Contributor Author

@jianjuns e2e test failed on CI testbed with IPsec+Geneve mode , after double check in my local clusters, it turns out it's kernel version issue, I test in one cluster with ubuntu 18.04.3 which has kernel version 4.15.0-66 failed, but another one with 4.15.0-143 passed. I suppose we need to update docs to point out the kernel version to support different tunnel mode. any other suggestion for this kind of requirement?

@jianjuns
Copy link
Contributor

I think we need to figure out from exact what kernel version or with what kernel change Geneve can pass. I am surprised it can change from 4.15.0-66 to 4.15.0-143.

@luolanzone
Copy link
Contributor Author

@jianjuns yes, I will figure out what's changed or required, I was actually running 'apt-get upgrade', so I suspect maybe it's some software upgrades fix it. but I need time to check.

@luolanzone
Copy link
Contributor Author

Hi @jianjuns the change or fix is introduced in this commit: https://kernel.ubuntu.com/git/ubuntu/ubuntu-bionic.git/commit/?id=be556894e8eaefd5d21690d56614d76e45786ecb, I verified it on my local cluster, for ubuntu 18.04, it has to be a version after 4.15.0-124. if we use Geneve as default tunnel for IPSec, we have to upgrade the e2e environment to pass it. do you think it's OK to still keep the old setting to use IPSec+GRE so we can run e2e without testbed change?

@jianjuns
Copy link
Contributor

@luolanzone: thanks for the update! Given Geneve and others are not supported by earlier kernel version, I think still better to keep GRE to be the default for antrea-ipsec.yml, and test GRE in CI. I first thought we should update CI testbed to support Geneve + IPsec, but even we update testbed do we want to run tests for both GRE and Geneve? @antoninbas : thoughts?

@antoninbas
Copy link
Contributor

@luolanzone: thanks for the update! Given Geneve and others are not supported by earlier kernel version, I think still better to keep GRE to be the default for antrea-ipsec.yml, and test GRE in CI. I first thought we should update CI testbed to support Geneve + IPsec, but even we update testbed do we want to run tests for both GRE and Geneve? @antoninbas : thoughts?

I feel like it's ok to test a single transport (GRE) since the code is the same on the Antrea side. Just like we run pretty much all of our testing with Geneve (there are some leftover tests for VXLAN, but it won't necessarily always be the case). We should document the kernel version requirements for using IPsec + Geneve though.

@luolanzone
Copy link
Contributor Author

Hi @antoninbas @jianjuns , I change the manifest back to use GRE with IPSec, and update the doc ipsec-tunnel.md with kernel requirement. please help to review again, thanks!


## Prerequisites

IPsec requires a set of Linux kernel modules. Check the required kernel modules
listed in the [strongSwan documentation](https://wiki.strongswan.org/projects/strongswan/wiki/KernelModules).
Make sure the required kernel modules are loaded on the Kubernetes Nodes before
deploying Antrea with IPsec encyption enabled.

If you want to enable IPsec with Geneve, please make sure [this commit](https://github.com/torvalds/linux/commit/34beb21594519ce64a55a498c2fe7d567bc1ca20) is included
Copy link
Contributor

Choose a reason for hiding this comment

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

So do VXLAN and STT work with older 18.04 versions, without the commit?

Copy link
Contributor

Choose a reason for hiding this comment

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

Add a new line before this paragraph.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, VXLAN works, STT module is not in the Linux tree, so need extra step to install it manually from source, I have updated here last time, let me add it here as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

I do not see you added a new line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, misunderstood the new line, I added it before ## Installation, will add it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


## Prerequisites

IPsec requires a set of Linux kernel modules. Check the required kernel modules
listed in the [strongSwan documentation](https://wiki.strongswan.org/projects/strongswan/wiki/KernelModules).
Make sure the required kernel modules are loaded on the Kubernetes Nodes before
deploying Antrea with IPsec encyption enabled.

If you want to enable IPsec with Geneve, please make sure [this commit](https://github.com/torvalds/linux/commit/34beb21594519ce64a55a498c2fe7d567bc1ca20) is included
in your kernel. for Ubuntu 18.04, it should be a version after 4.15.0-124. for Ubuntu 20.04, it should be a version after 5.4.67.
Copy link
Contributor

Choose a reason for hiding this comment

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

for -> For

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed


## Prerequisites

IPsec requires a set of Linux kernel modules. Check the required kernel modules
listed in the [strongSwan documentation](https://wiki.strongswan.org/projects/strongswan/wiki/KernelModules).
Make sure the required kernel modules are loaded on the Kubernetes Nodes before
deploying Antrea with IPsec encyption enabled.
If you want to enable IPsec with Geneve, please make sure [this commit](https://github.com/torvalds/linux/commit/34beb21594519ce64a55a498c2fe7d567bc1ca20) is included
in your kernel. For Ubuntu 18.04, it should be a version after `4.15.0-124`. For Ubuntu 20.04, it should be a version after `5.4.67`.
If you'd like to enable IPSec with STT, please be ware that the `vport-stt` module is not in the Linux tree and needs to be built from source, please build and load it manually before IPSec with STT tunneling is enabled.
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel no need to mention the STT prerequisite here. It is documented in getting-started already.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed


## Prerequisites

IPsec requires a set of Linux kernel modules. Check the required kernel modules
listed in the [strongSwan documentation](https://wiki.strongswan.org/projects/strongswan/wiki/KernelModules).
Make sure the required kernel modules are loaded on the Kubernetes Nodes before
deploying Antrea with IPsec encyption enabled.

If you want to enable IPsec with Geneve, please make sure [this commit](https://github.com/torvalds/linux/commit/34beb21594519ce64a55a498c2fe7d567bc1ca20) is included
Copy link
Contributor

Choose a reason for hiding this comment

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

I do not see you added a new line.

jianjuns
jianjuns previously approved these changes Aug 18, 2021
Copy link
Contributor

@jianjuns jianjuns left a comment

Choose a reason for hiding this comment

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

LGTM.

@luolanzone
Copy link
Contributor Author

/test-all /test-ipv6-all /test-ipv6-only-all

moment, IPsec encyption works only for GRE tunnel (but not Geneve, VXLAN, and
STT tunnel types).
Antrea supports encrypting tunnel traffic across Nodes with IPsec ESP.
IPsec encyption works for all OVS supported tunnel including Geneve, GRE,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
IPsec encyption works for all OVS supported tunnel including Geneve, GRE,
IPsec encyption works for all tunnel types supported by OVS including Geneve, GRE,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -11,6 +11,9 @@ listed in the [strongSwan documentation](https://wiki.strongswan.org/projects/st
Make sure the required kernel modules are loaded on the Kubernetes Nodes before
deploying Antrea with IPsec encyption enabled.

If you want to enable IPsec with Geneve, please make sure [this commit](https://github.com/torvalds/linux/commit/34beb21594519ce64a55a498c2fe7d567bc1ca20) is included
in your kernel. For Ubuntu 18.04, it should be a version after `4.15.0-124`. For Ubuntu 20.04, it should be a version after `5.4.67`.
Copy link
Contributor

Choose a reason for hiding this comment

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

wrap line at 80 chars

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -11,6 +11,9 @@ listed in the [strongSwan documentation](https://wiki.strongswan.org/projects/st
Make sure the required kernel modules are loaded on the Kubernetes Nodes before
deploying Antrea with IPsec encyption enabled.

If you want to enable IPsec with Geneve, please make sure [this commit](https://github.com/torvalds/linux/commit/34beb21594519ce64a55a498c2fe7d567bc1ca20) is included
in your kernel. For Ubuntu 18.04, it should be a version after `4.15.0-124`. For Ubuntu 20.04, it should be a version after `5.4.67`.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/it should be a version after/kernel version should be at least

(both occurrences)

(assuming that 4.15.0-124 itself includes the patch, but typically the provided version number is the first one which includes the required patch).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, there are kernel version tags like 4.15.0-125 and 5.4.68, but I can't get them from apt list. so minimum working version should be 4.15.0-128 and 5.4.70. let me correct it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

this PR is based on antrea-io#2486 and I verified all tunnel modes with
IPSec in K8s Cluster, it all works fine now, so I remove the limitation
on our docs and the check in the code.

Signed-off-by: Lan Luo <luola@vmware.com>
@antoninbas
Copy link
Contributor

/skip-all

@antoninbas antoninbas merged commit fdf3034 into antrea-io:main Aug 19, 2021
@luolanzone luolanzone deleted the ipsec-vxlan branch September 14, 2021 09:23
antoninbas pushed a commit that referenced this pull request Oct 20, 2022
We have verified that all tunnel types can be used for IPsec.
When using Geneve though, a recent enough kernel version is required.

Signed-off-by: Lan Luo <luola@vmware.com>
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

Successfully merging this pull request may close these issues.

Support IPsec with VXLAN tunnel mode
4 participants