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

Add cni bin when installing calico #9367

Merged
merged 1 commit into from
Nov 9, 2022
Merged

Add cni bin when installing calico #9367

merged 1 commit into from
Nov 9, 2022

Conversation

ErikJiang
Copy link
Member

@ErikJiang ErikJiang commented Oct 8, 2022

Signed-off-by: bo.jiang bo.jiang@daocloud.io

What type of PR is this?
/kind feature

What this PR does / why we need it:
When installing calico, install cni-plugins along with it.

Which issue(s) this PR fixes:

Fixes #9366

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

[Calico] Add cni bin when installing

@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. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 8, 2022
@yankay
Copy link
Member

yankay commented Oct 8, 2022

There is another PR at the #9368 .

I think both PRs are good to solve the issue.

@cristicalin
Copy link
Contributor

Please see the proposal I made in #9368 (comment) , it would make more sense to just enable the CNI plugins by default seeing as some distributions have a similar approach.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 10, 2022
@@ -163,3 +163,6 @@ calico_apiserver_enabled: false
# Calico feature detect override, set "ChecksumOffloadBroken=true" to
# solve the https://github.com/projectcalico/calico/issues/3145
calico_feature_detect_override: ""

# CNI plugins support
enable_cni: true
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

@cyclinder
Copy link
Contributor

cyclinder commented Oct 12, 2022

CI Flaky: https://github.com/kubernetes-sigs/kubespray/pull/9367/checks?check_run_id=8813987019

It looks like this CI Job will not download CNI-plugins, We should put the task of download cni-plugins into this job. Maybe add the following line to https://github.com/kubernetes-sigs/kubespray/blob/master/tests/files/packet_ubuntu20-calico-aio.yml#L11

# CNI plugins support
enable_cni: true

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 14, 2022
@yankay
Copy link
Member

yankay commented Oct 18, 2022

/lgtm

Thanks @ErikJiang

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 18, 2022
@@ -69,6 +69,9 @@ credentials_dir: "{{ inventory_dir }}/credentials"
# Can also be set to 'cloud', which lets the cloud provider setup appropriate routing
kube_network_plugin: calico

# CNI plugins support
enable_cni: true
Copy link
Contributor

Choose a reason for hiding this comment

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

Why still mess with this? Just remove any option to disable this and always deploy the standard CNIs, this makes for a more predictable environment.

Copy link
Member Author

Choose a reason for hiding this comment

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

@cristicalin 😀 Do you mean that the enable_cni switch is unnecessary, and the cni-plugins should be permanently installed?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes

- role: network_plugin/cni
when:
- enable_cni
- skip_cni is not defined
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure why we need to have 2 options skip_cni and enable_cni.
Doesn’t enable_cni: false mean skipping cni installation?

Copy link
Member Author

Choose a reason for hiding this comment

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

@oomichi When executing calico's check or reset task, the dependencies in meta will be executed first, which is not expected, so I skip by defining the skip_cni variable, and enable_cni may be redundant, I plan to delete it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Need to upte here to
- skip_cni is not defined or not skip_cni
for covering skip_cni: false case.

Copy link
Member Author

Choose a reason for hiding this comment

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

@oomichi 😊 Thanks, I have updated.

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 19, 2022
@oomichi
Copy link
Contributor

oomichi commented Oct 21, 2022

Thanks for updating!

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 21, 2022
@yankay
Copy link
Member

yankay commented Oct 21, 2022

/lgtm

Thanks @ErikJiang

@@ -0,0 +1,5 @@
---
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this part should be replaced by just removing these lines: https://github.com/kubernetes-sigs/kubespray/blob/master/roles/network_plugin/meta/main.yml#L29-L31

Copy link
Member Author

Choose a reason for hiding this comment

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

😀 It does achieve the same effect and is more concise, thank you very much, @cristicalin

@@ -129,6 +129,8 @@
include_role:
name: network_plugin/calico
tasks_from: check
vars:
Copy link
Contributor

Choose a reason for hiding this comment

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

If you do this, you are essentially disabling the CNI each time since it will override any value passed from ansible group vars. Why do you need to do this?

@@ -381,6 +381,8 @@
include_role:
name: "network_plugin/{{ kube_network_plugin }}"
tasks_from: reset
vars:
Copy link
Contributor

Choose a reason for hiding this comment

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

Calling the reset task should not concern any dependencies of the called roles. If CNI plugins need to be reset then the call should be made for network_plugin/cni and network_plugin/{{ kube_network_plugin }}

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 25, 2022
Copy link
Member

@yankay yankay left a comment

Choose a reason for hiding this comment

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

Shoud we change the order to the first, because calico would overwide some CNI.

@yankay
Copy link
Member

yankay commented Oct 26, 2022

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 26, 2022
@ErikJiang
Copy link
Member Author

😀 Updated and PTAL. @oomichi @cristicalin

Signed-off-by: bo.jiang <bo.jiang@daocloud.io>
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 7, 2022
@oomichi
Copy link
Contributor

oomichi commented Nov 8, 2022

Thanks for updating.
Looks clean and simple for me.

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ErikJiang, oomichi

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 Nov 8, 2022
@cyclinder
Copy link
Contributor

Thanks 👍
/lgtm

@yankay
Copy link
Member

yankay commented Nov 9, 2022

Thanks @ErikJiang

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 9, 2022
@k8s-ci-robot k8s-ci-robot merged commit 8a654b6 into kubernetes-sigs:master Nov 9, 2022
@floryut floryut added kind/network Network section in the release note and removed kind/feature Categorizes issue or PR as related to a new feature. labels Nov 9, 2022
salifou pushed a commit to salifou/kubespray that referenced this pull request Nov 13, 2022
Signed-off-by: bo.jiang <bo.jiang@daocloud.io>

Signed-off-by: bo.jiang <bo.jiang@daocloud.io>
@floryut floryut mentioned this pull request Jan 4, 2023
enneitex pushed a commit to enneitex/kubespray that referenced this pull request Jan 25, 2023
Signed-off-by: bo.jiang <bo.jiang@daocloud.io>

Signed-off-by: bo.jiang <bo.jiang@daocloud.io>
HoKim98 pushed a commit to ulagbulag/kubespray that referenced this pull request Mar 8, 2023
Signed-off-by: bo.jiang <bo.jiang@daocloud.io>

Signed-off-by: bo.jiang <bo.jiang@daocloud.io>
nolimitkun pushed a commit to nolimitkun/kubespray that referenced this pull request Mar 19, 2023
Signed-off-by: bo.jiang <bo.jiang@daocloud.io>

Signed-off-by: bo.jiang <bo.jiang@daocloud.io>
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/network Network section in the release note lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

Install Calico CNI and cni-plugins together
7 participants