-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Parameterize gcr, quay, and docker image repo defines #5146
Conversation
Welcome @qingkunl! |
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
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. I understand the commands that are listed here. |
/assign @woopstar |
/retest |
@qingkunl: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless I'm wrong images from docker hub could benefit from the same variable with "docker.io" as default.
It's true that "docker.io" is blocked in China. But we've already got ways to specify the docker mirror by overriding 'docker_registry_mirrors' defined in 'roles/kubespray-defaults/defaults/main.yaml':
|
|
Have the same variable for docker.io as for gcr.io and qua.ioy would ease the overridings of all *_image_repo variables in offline installations as well |
Why not use something like the following:
User then wants to use another registry:
Then
This would get rid of all the Additionally, it would be possible to use:
in case the user wants to use a single registry. Note: Be aware that the download role has a dynamic part: kubespray/roles/download/tasks/main.yml Line 30 in 7f74906
|
@mirwan That makes sense. I've updated the PR to add the variable for "docker.io" as well. Thanks. |
Thanks for the suggestion. But it doesn't solve the problem I'm trying to solve in this PR. I'd like to be able to just override the repo for all gcr/quay/docker images with a simple repo override (so that I can easily use mirror repos), instead of having to go through and override each image (etcd, cilium, dashboard, nodelocaldns, etc.). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The images repos with no namespace should have the library namespace added like nginx_image_repo: "{{ docker_image_repo }}/library/nginx"
Updated the PR to add library namespace. Thanks |
/lgtm |
It's been silent for a while. Anything else I should do here? |
roles/download/defaults/main.yml
Outdated
kube_ovn_cni_image_repo: "docker.io/kubeovn/kube-ovn-cni" | ||
kube_ovn_db_image_repo: "{{ docker_image_repo }}/kubeovn/kube-ovn-db" | ||
kube_ovn_node_image_repo: "{{ docker_image_repo }}/kubeovn/kube-ovn-node" | ||
kube_ovn_cni_image_repo: "{{ docker_image_repo }}/kubeovn/kube-ovn-cni" | ||
kube_ovn_controller_image_repo: "kubeovn/kube-ovn-controller" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{ docker_image_repo }}/kubeovn/kube-ovn-controller
I think this needs to be fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in the latest commit
I agree with this approach, otherwise users will have a lot of configuration options. |
/hold |
This allows to easily override the gcr, quay, and docker repos with the mirror repos in countries like China, where the default accesses are blocked or unstable.
I think @mirwan meant to also define a variable for docker.io, as I originally only defined variables for gcr.io and quay.io, and I've already done that. Please let me know if I misunderstood.
It may not help much in my case, as I need to override all images with the mirror repos and don't want to go through and override each of them (etcd, cilium, dashboard, nodelocaldns, etc.). In addition, since it requires a more involved code change and refactor, I suggest consider it in a separate PR. And in case we do want @Timoses 's suggestion, I still suggest keeping this PR to allow the mirror repo override. |
@qingkunl Thanks, |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: qingkunl, riverzhang 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 |
/hold cancel |
* 'master' of https://github.com/kubernetes-sigs/kubespray: Add support for k8s v1.14.6 (kubernetes-sigs#5182) Parameterize gcr, quay, and docker image repo defines (kubernetes-sigs#5146) use hyperkubeimage to run controlplane containers (kubernetes-sigs#5178) Update main.yml (kubernetes-sigs#5166) Fixes issue kubernetes-sigs#5160 (kubernetes-sigs#5171) Use more native way to update kubeconfigs using kubeadm (kubernetes-sigs#5165) Fix macro on local_volume_provisioner (kubernetes-sigs#5168) Move cri_socket var to kubespray-defaults (kubernetes-sigs#5149) Add support for k8s v1.16.0-beta.2 (kubernetes-sigs#5148) Fix ansible task titles (kubernetes-sigs#5154) Adjust endpoints for kube-proxy,controller,scheduler to proper ip (kubernetes-sigs#5150) Documenting Terraform variable `az_list` explicitly (kubernetes-sigs#5132) Make haproxy/nginx client timeout configurable (kubernetes-sigs#5140) print hostnames (kubernetes-sigs#5110) Cleanup: fix typo in doc (kubernetes-sigs#5105) Use python3-libselinux on RHEL8/Centos8 (kubernetes-sigs#5127)
…s#5146) This allows to easily override the gcr, quay, and docker repos with the mirror repos in countries like China, where the default accesses are blocked or unstable.
This allows to easily override the gcr, quay, and docker repos with the
mirror repos in countries like China, where the default accesses are
blocked or unstable.
What type of PR is this?
/kind feature
What this PR does / why we need it:
Allows to use ansible variables to define gcr, quay, and docker repos, so that people can easily override them (e.g. with the mirror repos) in the inventory file. This is very useful for Kubespray users in countries like China, where the access to gcr, quay, and docker repos are blocked or unstable.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
I've tested this change locally on the machines in China. Without this change, the gcr, quay, and docker images couldn't not be downloaded.
Does this PR introduce a user-facing change?: