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: Allow operators to choose which encapsulation mode to use #10404

Merged

Conversation

seh
Copy link
Contributor

@seh seh commented Dec 10, 2020

Introduce a new "encapsulationMode" field in Calico's portion of the Cluster specification to allow switching between the the IP-in-IP and VXLAN encapsulation protocols. For now, we accept the values "ipip" and "vxlan," and forgo a possible "none" value that would disable encapsulation altogether (at least for the default Calico IP pool).

Augment the default-populating procedure for Calico to take this field into account when deciding both which networking backend to use and whether to use IP-in-IP or VXLAN encapsulation for the default IP pool. Note that these values supplied for the "CALICO_IPV4POOL_IPIP" and "CALICO_IPV4POOL_VXLAN" environment variables in the "calico-node" DaemonSet pod spec only matter for creating the "default" IPPool pool object when no such objects already exist.

Generalize the documentation for the "crossSubnet" field to cover environments more broad than just AWS, as Calico can employ this selective encapsulation in any environment in which it can detect boundaries between subnets.

Fixes #10168.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 10, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @seh. Thanks for your PR.

I'm waiting for a kubernetes 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 added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Dec 10, 2020
@seh seh force-pushed the allow-use-of-calico-vxlan-backend branch 2 times, most recently from 736cb24 to 5f256b2 Compare December 10, 2020 19:24
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 10, 2020
@seh seh force-pushed the allow-use-of-calico-vxlan-backend branch from 5f256b2 to 48b7d18 Compare December 10, 2020 19:31
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 10, 2020
@seh seh changed the title Allow operators to choose which of Calico's networking backends to use Calico: Allow operators to choose which networking backend to use Dec 10, 2020
@seh seh force-pushed the allow-use-of-calico-vxlan-backend branch from 48b7d18 to 7c2c86c Compare December 10, 2020 20:00
Copy link
Member

@hakman hakman left a comment

Choose a reason for hiding this comment

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

I wonder if we really need Backend added. What do you think?

pkg/apis/kops/networking.go Outdated Show resolved Hide resolved
upup/models/bindata.go Show resolved Hide resolved
upup/models/bindata.go Outdated Show resolved Hide resolved
upup/models/bindata.go Show resolved Hide resolved
@seh seh force-pushed the allow-use-of-calico-vxlan-backend branch 3 times, most recently from cf418a3 to f6f2800 Compare December 11, 2020 17:23
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Dec 11, 2020
@seh
Copy link
Contributor Author

seh commented Dec 13, 2020

Should we still allow IP-in-IP traffic in the security rules even if the Calico backend is VXLAN?

@rifelpet
Copy link
Member

is migrating from one backend to another a supported operation for existing clusters? If it is, then modifying security group rule definitions could mean that kops update cluster revokes a security group rule while the backend that depended on that access is still in use by a portion of the cluster.

@seh
Copy link
Contributor Author

seh commented Dec 13, 2020

Is migrating from one backend to another a supported operation for existing clusters?

Yes, it is, though at present kOps would not orchestrate this all on its own. The reason is that we'd wind up changing the requisite field in the "calico-node" ConfigMap, but we wouldn't automatically restart all the pods that need to consume that updated field value in order for the change to actually take effect. After running kops update cluster and waiting for the updated Calico manifests to be applied, an operator would have to run the following command:

kubectl --namespace=kube-system rollout restart calico-node

I am not sure if it's necessary to restart the pods managed by the "calico-kube-controllers" Deployment. I will ask the Calico maintainers about that.

@seh seh marked this pull request as draft December 14, 2020 13:18
@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 Dec 14, 2020
@seh
Copy link
Contributor Author

seh commented Dec 14, 2020

Please hold pending discussion with the Calico maintainers.

@seh seh force-pushed the allow-use-of-calico-vxlan-backend branch from f6f2800 to faab730 Compare December 17, 2020 16:35
@seh seh changed the title Calico: Allow operators to choose which networking backend to use Calico: Allow operators to choose which encapsulation mode to use Dec 17, 2020
@seh seh marked this pull request as ready for review December 17, 2020 16:43
@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 Dec 17, 2020
Copy link
Member

@hakman hakman left a comment

Choose a reason for hiding this comment

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

Thanks @seh. This looks mostly good. Will take another look tomorrow and give it a try.

pkg/apis/kops/networking.go Outdated Show resolved Hide resolved
pkg/apis/kops/v1alpha2/networking.go Outdated Show resolved Hide resolved
upup/pkg/fi/cloudup/template_functions.go Outdated Show resolved Hide resolved
docs/networking/calico.md Outdated Show resolved Hide resolved
@seh
Copy link
Contributor Author

seh commented Dec 17, 2020

This looks mostly good.

Thank you for the prompt review. I'll follow up with corrections tomorrow morning (EST).

@seh seh force-pushed the allow-use-of-calico-vxlan-backend branch from faab730 to 0fd2b1f Compare December 18, 2020 14:35
docs/networking/calico.md Outdated Show resolved Hide resolved
Introduce a new "encapsulationMode" field in Calico's portion of the
Cluster specification to allow switching between the the IP-in-IP and
VXLAN encapsulation protocols. For now, we accept the values "ipip"
and "vxlan," and forgo a possible "none" value that would disable
encapsulation altogether (at least for the default Calico IP pool).

Augment the default-populating procedure for Calico to take this field
into account when deciding both which networking backend to use and
whether to use IP-in-IP or VXLAN encapsulation for the default IP
pool. Note that these values supplied for the "CALICO_IPV4POOL_IPIP"
and "CALICO_IPV4POOL_VXLAN" environment variables in the "calico-node"
DaemonSet pod spec only matter for creating the "default" IPPool pool
object when no such objects already exist.

Generalize the documentation for the "crossSubnet" field to cover
environments more broad than just AWS, as Calico can employ this
selective encapsulation in any environment in which it can detect
boundaries between subnets.
@seh seh force-pushed the allow-use-of-calico-vxlan-backend branch from 8298b54 to f0f45b7 Compare December 18, 2020 15:57
@hakman
Copy link
Member

hakman commented Dec 18, 2020

This looks 👍 . Thanks @seh !
/ok-to-test
/lgtm

@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 Dec 18, 2020
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 18, 2020
@hakman
Copy link
Member

hakman commented Dec 18, 2020

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hakman, seh

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 Dec 18, 2020
@hakman
Copy link
Member

hakman commented Dec 18, 2020

/retest

k8s-ci-robot added a commit that referenced this pull request Dec 18, 2020
…-upstream-release-1.19

Automated cherry pick of #10404: Allow use of Calico's VXLAN networking backend
@k8s-ci-robot k8s-ci-robot merged commit ef8c369 into kubernetes:master Dec 18, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.20 milestone Dec 18, 2020
@seh seh deleted the allow-use-of-calico-vxlan-backend branch December 18, 2020 18:56
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. area/addons area/api area/documentation 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/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.

Allow Calico to use VXLAN backend (instead of BIRD)
5 participants