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

Support autodetection interface methods in windows #3615

Merged
merged 1 commit into from
Dec 2, 2022

Conversation

manuelbuil
Copy link
Contributor

@manuelbuil manuelbuil commented Dec 1, 2022

Signed-off-by: Manuel Buil [email protected]

Proposed Changes

Calico-windows only supported the default interface autodetection method ("first-found"). This PR provides support of the additional methods:

  • cidrs
  • canReach
  • interface

These methods provide the interface that Calico should use to create the vxlanoverlay. I added a new string in the Calicoconfig (Interface) to save that value. When creating the vxlan network, it is used.

Apart from that:

  • a new file (utils.go) is created and all non-related to Calico functions are migrated there
  • deleteAllNetworksOnNodeRestart() changed name to deleteAllNetworks()

Types of Changes

New feature

Verification

Deploy rke2 with a HelmChartConfig which configures nodeAddressAutodetectionV4:

apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
  name: rke2-calico
  namespace: kube-system
spec:
  valuesContent: |-
    installation:
      calicoNetwork:
        nodeAddressAutodetectionV4:
          <INSERT-METHOD>

can be:

interface: foo

where foo is a regexp expression (e.g. "eth.?") or directly the interface (e.g. eth1)

canReach: foo

where foo is an IP or a hostname (e.g. github.com)

cidrs:
  - foo

where foo is a cidr (e.g. 10.10.10.0/24). It can define more items

Linked Issues

#3614

Further Comments

@manuelbuil manuelbuil requested a review from a team as a code owner December 1, 2022 19:29
@dereknola
Copy link
Member

dereknola commented Dec 1, 2022

How does this change things compared to #3375? I had already added support for those options in windows. Is this a refactor?

@dereknola
Copy link
Member

Talking to manuel, more context is:
PR #3375, did not fully implement the calico feature. While that PR made kubectl report the correct calico node-ip and annotation, it did not actually change the Vxlan ManagmentIP that calico used. This PR fixes that, and does change the vxlan interface https://github.com/rancher/rke2/blob/master/pkg/windows/calico.go#L288-L293

@manuelbuil
Copy link
Contributor Author

manuelbuil commented Dec 2, 2022

How does this change things compared to #3375? I had already added support for those options in windows. Is this a refactor?

We are currently not using all Calico scripts to deploy the whole Calico on Windows. We are creating the vxlan overlay ourselves and after that deploy calico and felix agents using upstream scripts. The code is currently configuring things correctly for calico and felix agents but the creation of the vxlan overlay is not taking into account what is configured as autodetection method in the chart. This PR fixes that and applies the same config for the vxlan overlay and the calico&felix agents

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.

4 participants