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

Apply calico bgp peer definition task to all nodes #8974

Conversation

orange-llajeanne
Copy link
Contributor

@orange-llajeanne orange-llajeanne commented Jun 14, 2022

What type of PR is this?
/kind bug

What this PR does / why we need it:
This partly reverts PR #8833 , which limited the Configure peering with router(s) at node scope task to a single node.
We actually need to keep applying this task to all nodes, since each k8s node should be able to define its own bgp peering configuration.
The fact that inventory_hostname is used in the BGPPeer definition seems to suggest that this task was never intended to be limited to a single arbitrary node.

Which issue(s) this PR fixes:

Kubespray currently fails to configure calico on a multiple node cluster with router peering, only the peering configuration of the first control plane node is defined.

Does this PR introduce a user-facing change?:

Apply calico bgp peer definition task to all nodes

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 14, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @orange-llajeanne. 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 added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 14, 2022
@k8s-ci-robot k8s-ci-robot requested review from EppO and oomichi June 14, 2022 09:44
@@ -571,7 +571,7 @@
- "{{ peers|selectattr('scope','undefined')|list|default([]) | union(peers|selectattr('scope','defined')|selectattr('scope','equalto', 'node')|list|default([])) }}"
when:
- peer_with_router|default(false)
- inventory_hostname == groups['kube_control_plane'][0]
Copy link
Contributor

Choose a reason for hiding this comment

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

The reason this was limited to kube_control_plane[0] was because there is where the calicoctl.sh script is configured, I don't think we intended to limit the coverage to a single node. I think your fix needs a delegate_to: kube_control_plane[0] to actually achieve its purpose to ensure ti calls calicoctl.sh on the right machine and with the right input for each cluster member.

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 updated this PR with a delegate_to to ensure that all calicoctl.sh calls are done on the first node. This is a different behavior than the one that was in place before #8833 , but I has the same effects so it's fine by me.

I'd like more details about the part of your answer that states that calicoctl.sh is not configured everywhere: in my understanding, this script is deployed (and functional) on all cluster nodes. This is why the task that this PR modifies was working up to the recent changes.
Is this not supposed to be the case anymore? Is calicoctl.sh planned to only be available on control plane nodes?

Copy link
Contributor

Choose a reason for hiding this comment

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

You are correct that calicoctl.sh is deployed on all nodes, I was under a wrong impression that we only deployed it on control plane nodes. Since we render and apply manifests only on the first control plane node, it makes sense to have the same approach for calico commands even though they could be ran from any node. In the end I'm impartial to the implementation but open to other perspectives.

/cc @floryut @oomichi WDYT ?

@orange-llajeanne orange-llajeanne force-pushed the fix_calico_node_router_peers branch from 4a0202e to dfeea4d Compare June 14, 2022 14:30
@cristicalin
Copy link
Contributor

/ok-to-test
/approve

@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 Jun 22, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cristicalin, orange-llajeanne

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 22, 2022
@liupeng0518
Copy link
Member

/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 25, 2022
@k8s-ci-robot k8s-ci-robot merged commit b338968 into kubernetes-sigs:master Jun 25, 2022
fungusakafungus pushed a commit to fungusakafungus/kubespray that referenced this pull request Jul 13, 2022
@floryut floryut mentioned this pull request Sep 19, 2022
LuckySB pushed a commit to southbridgeio/kubespray that referenced this pull request Jul 2, 2023
LuckySB pushed a commit to southbridgeio/kubespray that referenced this pull request Jul 7, 2023
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/bug Categorizes issue or PR as related to a bug. 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/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants