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

Update flannel use install-cni-plugin to fit upstream #8714

Merged
merged 3 commits into from Apr 18, 2022

Conversation

zhengtianbao
Copy link
Member

@zhengtianbao zhengtianbao commented Apr 14, 2022

What type of PR is this?

/kind feature

What this PR does / why we need it:

use rancher/mirrored-flannelcni-flannel-cni-plugin:v1.0.0 initContainer to install flannel binary to host like flannel-io/flannel did.

Which issue(s) this PR fixes:

Fixes #8333

Special notes for your reviewer:

The flannel-cni-plugin verison v1.0.0 is compatible with flannel v0.15.1

flannel-io/flannel@dda69bc

Does this PR introduce a user-facing change?:

[flannel] Use install-cni-plugin to fit upstream

@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. labels Apr 14, 2022
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 14, 2022
@cristicalin
Copy link
Contributor

A couple of questions:

  1. why do this instead of the current approach implemented in roles/network_plugin/flannel which downloads the cni binary from github (see flannel_cni_download_url in roles/download/default/main.yml)
  2. why use a mirror from rancher? Doesn't upstream provide an official docker repo or this is the actiual upsteam with an unfortunate name?

Copy link
Contributor

@oomichi oomichi left a comment

Choose a reason for hiding this comment

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

/cc @oomichi

@@ -830,6 +830,8 @@ etcd_image_repo: "{{ quay_image_repo }}/coreos/etcd"
etcd_image_tag: "{{ etcd_version }}{%- if image_arch != 'amd64' -%}-{{ image_arch }}{%- endif -%}"
flannel_image_repo: "{{ quay_image_repo }}/coreos/flannel"
flannel_image_tag: "{{ flannel_version }}-{{ image_arch }}"
flannel_init_image_repo: "rancher/mirrored-flannelcni-flannel-cni-plugin"
Copy link
Contributor

Choose a reason for hiding this comment

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

The offline deployment feature cannot work if container images contain static repo names like rancher/ because the repo name parts({{ quay_image_repo }} for example) are replaced with local repos for offline deployment.
Related to @cristicalin's comment, can we use a common repo for that instead of the static rancher/ ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I've replaced it to docker.io/flannelcni/flannel-cni-plugin:v1.0.0

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't quite understand the comment in https://github.com/flannel-io/flannel/blob/349feae40ae4c8a57c5abbaf9c4fcfe43cadc264/Documentation/kube-flannel.yml#L169-L170, what docker hub limitations affect ppc64le? I'm asking this since we now support ppc64le arch and we should be aware (and maybe document) the limitation.

Copy link
Contributor

@oomichi oomichi Apr 15, 2022

Choose a reason for hiding this comment

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

Now Kubespray is using flannel-cni-plugin v1.0.0 and the flannel-cni-plugin image on the dockerhub supports

linux/amd64
linux/arm/v6
linux/arm64/v8
linux/ppc64le
linux/s390x

as https://hub.docker.com/r/flannelcni/flannel-cni-plugin/tags
It is better to investigate more to know the reason of the comment.

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 I see the reason of the above comment.
flannel-io/flannel#1482 (comment) shows

  • The dockerhub flannel-cni-plugin is the official image
  • The rancher flannel-cni-plugin is for avoiding a rate limit issue due to the dockerhub policy
  • image: flannelcni/flannel-cni-plugin:v1.0.1 for ppc64le (dockerhub limitations may apply) means the rancher flannel-cni-plugin doesn't support ppc64le and we need to enable the dockerhub one instead for ppc64le if we are using.

To support ppc64le also, it is necessary to use the dockerhub image.
If using the dockerhub image, a rate limit issue could happen as the above comment.
However Kubespray already is using a lot of dockerhub images, I don't feel that can be a matter for us.

@zhengtianbao
Copy link
Member Author

A couple of questions:

  1. why do this instead of the current approach implemented in roles/network_plugin/flannel which downloads the cni binary from github (see flannel_cni_download_url in roles/download/default/main.yml)
  2. why use a mirror from rancher? Doesn't upstream provide an official docker repo or this is the actiual upsteam with an unfortunate name?

@cristicalin Thanks, that's because want to be consistent with upstream.

  1. Actually, I will remove the current implemention when this PR accepted.
  2. I found the comment explained why. and I have changed it.

https://github.com/flannel-io/flannel/blob/349feae40ae4c8a57c5abbaf9c4fcfe43cadc264/Documentation/kube-flannel.yml#L169-L170

@cristicalin
Copy link
Contributor

cristicalin commented Apr 15, 2022

  1. Actually, I will remove the current implemention when this PR accepted.

I think you should remove that part in this PR since having both methods would cause binaries to be replaced during the deployment procedure.

You can do this in a separate commit in this PR just to make it clear that there are separate steps to the change.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 16, 2022
@cristicalin
Copy link
Contributor

Thanks for doing this @zhengtianbao !

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cristicalin, zhengtianbao

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 Apr 16, 2022
@oomichi
Copy link
Contributor

oomichi commented Apr 18, 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 Apr 18, 2022
@k8s-ci-robot k8s-ci-robot merged commit 937e64d into kubernetes-sigs:master Apr 18, 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 Apr 25, 2022
@oomichi oomichi mentioned this pull request May 28, 2022
LuckySB pushed a commit to southbridgeio/kubespray that referenced this pull request Jun 30, 2023
…s#8714)

* Update flannel use install-cni-plugin to fit upstream

* Replace flannel cni repo

* Remove download flannel binary
LuckySB pushed a commit to southbridgeio/kubespray that referenced this pull request Oct 23, 2023
…s#8714)

* Update flannel use install-cni-plugin to fit upstream

* Replace flannel cni repo

* Remove download flannel binary
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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should it be copy flannel binary to host?
5 participants