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

implement download mirrors support #8474

Merged

Conversation

cristicalin
Copy link
Contributor

@cristicalin cristicalin commented Jan 26, 2022

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR implements a mechanism to download files from alternate locations if possible. The functionality is added to the download role to support a mirrors key in the downloads dict which will be used to select a viable mirror. The actual mirror to be used during the download is selected as a random choice between all valid mirrors.

Since calico is publishing their artifacts in multiple locations, this PR implements a sample mirrors configuration for calicoctl download location.

Which issue(s) this PR fixes:

Fixes #8427

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

[download] add capability to specify alternative download mirrors for files

@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/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 26, 2022
@cristicalin cristicalin force-pushed the download_file_mirrors branch 3 times, most recently from 2ec7151 to 575439f Compare January 27, 2022 06:57
@cristicalin
Copy link
Contributor Author

/cc @floryut @oomichi

Copy link
Member

@floryut floryut left a comment

Choose a reason for hiding this comment

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

@cristicalin Sorry I missed this one 👍

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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:
  • OWNERS [cristicalin,floryut]

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 Feb 7, 2022
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.

Thanks for doing this @cristicalin

That seems good for me, just one question.

@@ -47,11 +47,40 @@
- download_force_cache
- not download_localhost

# We check a number of mirrors that may hold the file and pick a working one at random
# This task will avoid logging it's parameters to not leak environment passwords in the log
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to see which URL doesn't work to know the URL needs to be updated?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not with the current logic since we put the no_log flag on the download task, the error is obscured, including any parameters like the URL. I could add a second task to log the results though that also has some potential to leak credentials if they are embedded in the url.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK.
It is fine to go with current one.
When facing a maintenance issue, we will be able to add some log to know which URLs got old.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 14, 2022
@k8s-ci-robot k8s-ci-robot merged commit c6e5314 into kubernetes-sigs:master Feb 14, 2022
Quehenr pushed a commit to Quehenr/unstable-laboratory-infrastructure-kubespray that referenced this pull request Feb 18, 2022
* master:
  Configure Etcd container_manager explicitly (kubernetes-sigs#8521)
  Fix print_hostnames of inventory.py (kubernetes-sigs#8554)
  Fix etcd_events not getting upgraded in upgrade-cluster.yml (kubernetes-sigs#8550)
  nerdctl: upgrade to 0.16.1 (kubernetes-sigs#8539)
  Allow pausing after upgrade but before uncordon (kubernetes-sigs#8530)
  [calico] upgrade release checksums (kubernetes-sigs#8544)
  Allow to specify a source address for metallb peerings, and target only some nodes using node selectors (kubernetes-sigs#8534)
  add support for Dual Stack node InternalIP (kubernetes-sigs#8542)
  terraform/gcp: Allow to change extra disk types (kubernetes-sigs#8524)
  add support for Calico IP6_AUTODETECTION_METHOD (kubernetes-sigs#8541)
  implement download mirrors support (kubernetes-sigs#8474)
  Fix: Error when creating subnets more than AZ (kubernetes-sigs#8516)
  feat(offline): Improve generate_list.sh to generate offline file list using ansible (kubernetes-sigs#8537) (kubernetes-sigs#8538)
  docs: Update offline-environment.md for containerd (kubernetes-sigs#8520) (kubernetes-sigs#8523)
  Change Cilium setting identity_allocation_mode to cilium_identity_allocation_mode (kubernetes-sigs#8519)
  Fix wrong port name in metallb.yml.j2 (kubernetes-sigs#8510)
sakuraiyuta pushed a commit to sakuraiyuta/kubespray that referenced this pull request Apr 16, 2022
* [download] add mechanism to support mirrors

* [calico] support alternate download url
@oomichi oomichi mentioned this pull request May 28, 2022
@sathieu
Copy link
Contributor

sathieu commented Jun 3, 2022

@cristicalin The older url is now 404 (see #8915).

LuckySB pushed a commit to southbridgeio/kubespray that referenced this pull request Jun 29, 2023
* [download] add mechanism to support mirrors

* [calico] support alternate download url
LuckySB pushed a commit to southbridgeio/kubespray that referenced this pull request Oct 21, 2023
* [download] add mechanism to support mirrors

* [calico] support alternate download url
VannTen added a commit to VannTen/kubespray that referenced this pull request Feb 5, 2024
This reverts commit c6e5314.

There is no user of the download mirrors support in kubespray, for a
long time.
VannTen added a commit to VannTen/kubespray that referenced this pull request Feb 5, 2024
This reverts commit c6e5314.

There is no user of the download mirrors support in kubespray, for a
long time.
k8s-ci-robot pushed a commit that referenced this pull request Feb 6, 2024
This reverts commit c6e5314.

There is no user of the download mirrors support in kubespray, for a
long time.
dabeck pushed a commit to fino-digital/kubespray that referenced this pull request May 7, 2024
…ubernetes-sigs#10884)

This reverts commit c6e5314.

There is no user of the download mirrors support in kubespray, for a
long time.
pedro-peter pushed a commit to pedro-peter/kubespray that referenced this pull request May 8, 2024
…ubernetes-sigs#10884)

This reverts commit c6e5314.

There is no user of the download mirrors support in kubespray, for a
long time.
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/feature Categorizes issue or PR as related to a new feature. 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.

Support fallback download locations
5 participants