From 3c7f682e90341744b5a62e9ffff86b4ac7311f94 Mon Sep 17 00:00:00 2001 From: Qingkun Li Date: Wed, 18 Sep 2019 02:49:30 -0700 Subject: [PATCH] Parameterize gcr, quay, and docker image repo defines (#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. --- roles/download/defaults/main.yml | 107 ++++++++++++++++--------------- 1 file changed, 57 insertions(+), 50 deletions(-) diff --git a/roles/download/defaults/main.yml b/roles/download/defaults/main.yml index 0cdb87b16..da629f55b 100644 --- a/roles/download/defaults/main.yml +++ b/roles/download/defaults/main.yml @@ -53,8 +53,15 @@ kube_version: v1.15.3 kubeadm_version: "{{ kube_version }}" etcd_version: v3.3.10 -# kubernetes image repo define -kube_image_repo: "gcr.io/google-containers" +# gcr and kubernetes image repo define +gcr_image_repo: "gcr.io" +kube_image_repo: "{{ gcr_image_repo }}/google-containers" + +# docker image repo define +docker_image_repo: "docker.io" + +# quay image repo define +quay_image_repo: "quay.io" # TODO(mattymo): Move calico versions to roles/network_plugins/calico/defaults # after migration to container download @@ -220,115 +227,115 @@ crictl_binary_checksum: "{{ crictl_checksums[image_arch][crictl_version] }}" # You need to deploy kubernetes cluster on local private development. # Also provide the address of your own private registry. # And use --insecure-registry options for docker -etcd_image_repo: "quay.io/coreos/etcd" +etcd_image_repo: "{{ quay_image_repo }}/coreos/etcd" etcd_image_tag: "{{ etcd_version }}{%- if image_arch != 'amd64' -%}-{{ image_arch }}{%- endif -%}" -flannel_image_repo: "quay.io/coreos/flannel" +flannel_image_repo: "{{ quay_image_repo }}/coreos/flannel" flannel_image_tag: "{{ flannel_version }}" -flannel_cni_image_repo: "quay.io/coreos/flannel-cni" +flannel_cni_image_repo: "{{ quay_image_repo }}/coreos/flannel-cni" flannel_cni_image_tag: "{{ flannel_cni_version }}" -calico_node_image_repo: "docker.io/calico/node" +calico_node_image_repo: "{{ docker_image_repo }}/calico/node" calico_node_image_tag: "{{ calico_version }}" -calico_cni_image_repo: "docker.io/calico/cni" +calico_cni_image_repo: "{{ docker_image_repo }}/calico/cni" calico_cni_image_tag: "{{ calico_cni_version }}" -calico_policy_image_repo: "docker.io/calico/kube-controllers" +calico_policy_image_repo: "{{ docker_image_repo }}/calico/kube-controllers" calico_policy_image_tag: "{{ calico_policy_version }}" -calico_rr_image_repo: "docker.io/calico/routereflector" +calico_rr_image_repo: "{{ docker_image_repo }}/calico/routereflector" calico_rr_image_tag: "{{ calico_rr_version }}" -calico_typha_image_repo: "docker.io/calico/typha" +calico_typha_image_repo: "{{ docker_image_repo }}/calico/typha" calico_typha_image_tag: "{{ calico_typha_version }}" -pod_infra_image_repo: "gcr.io/google_containers/pause-{{ image_arch }}" +pod_infra_image_repo: "{{ gcr_image_repo }}/google_containers/pause-{{ image_arch }}" pod_infra_image_tag: "{{ pod_infra_version }}" -install_socat_image_repo: "docker.io/xueshanf/install-socat" +install_socat_image_repo: "{{ docker_image_repo }}/xueshanf/install-socat" install_socat_image_tag: "latest" netcheck_version: "v1.0" -netcheck_agent_image_repo: "quay.io/l23network/k8s-netchecker-agent" +netcheck_agent_image_repo: "{{ quay_image_repo }}/l23network/k8s-netchecker-agent" netcheck_agent_image_tag: "{{ netcheck_version }}" -netcheck_server_image_repo: "quay.io/l23network/k8s-netchecker-server" +netcheck_server_image_repo: "{{ quay_image_repo }}/l23network/k8s-netchecker-server" netcheck_server_image_tag: "{{ netcheck_version }}" -weave_kube_image_repo: "docker.io/weaveworks/weave-kube" +weave_kube_image_repo: "{{ docker_image_repo }}/weaveworks/weave-kube" weave_kube_image_tag: "{{ weave_version }}" -weave_npc_image_repo: "docker.io/weaveworks/weave-npc" +weave_npc_image_repo: "{{ docker_image_repo }}/weaveworks/weave-npc" weave_npc_image_tag: "{{ weave_version }}" -contiv_image_repo: "docker.io/contiv/netplugin" +contiv_image_repo: "{{ docker_image_repo }}/contiv/netplugin" contiv_image_tag: "{{ contiv_version }}" -contiv_init_image_repo: "docker.io/contiv/netplugin-init" +contiv_init_image_repo: "{{ docker_image_repo }}/contiv/netplugin-init" contiv_init_image_tag: "latest" -contiv_auth_proxy_image_repo: "docker.io/contiv/auth_proxy" +contiv_auth_proxy_image_repo: "{{ docker_image_repo }}/contiv/auth_proxy" contiv_auth_proxy_image_tag: "{{ contiv_version }}" -contiv_etcd_init_image_repo: "docker.io/ferest/etcd-initer" +contiv_etcd_init_image_repo: "{{ docker_image_repo }}/ferest/etcd-initer" contiv_etcd_init_image_tag: latest -contiv_ovs_image_repo: "docker.io/contiv/ovs" +contiv_ovs_image_repo: "{{ docker_image_repo }}/contiv/ovs" contiv_ovs_image_tag: "latest" -cilium_image_repo: "docker.io/cilium/cilium" +cilium_image_repo: "{{ docker_image_repo }}/cilium/cilium" cilium_image_tag: "{{ cilium_version }}" -cilium_init_image_repo: "docker.io/cilium/cilium-init" +cilium_init_image_repo: "{{ docker_image_repo }}/cilium/cilium-init" cilium_init_image_tag: "2019-04-05" -cilium_operator_image_repo: "docker.io/cilium/operator" +cilium_operator_image_repo: "{{ docker_image_repo }}/cilium/operator" cilium_operator_image_tag: "{{ cilium_version }}" -kube_ovn_db_image_repo: "docker.io/kubeovn/kube-ovn-db" -kube_ovn_node_image_repo: "docker.io/kubeovn/kube-ovn-node" -kube_ovn_cni_image_repo: "docker.io/kubeovn/kube-ovn-cni" -kube_ovn_controller_image_repo: "kubeovn/kube-ovn-controller" +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: "{{ docker_image_repo }}/kubeovn/kube-ovn-controller" kube_ovn_db_image_tag: "{{ kube_ovn_version }}" kube_ovn_node_image_tag: "{{ kube_ovn_version }}" kube_ovn_controller_image_tag: "{{ kube_ovn_version }}" kube_ovn_cni_image_tag: "{{ kube_ovn_version }}" -kube_router_image_repo: "docker.io/cloudnativelabs/kube-router" +kube_router_image_repo: "{{ docker_image_repo }}/cloudnativelabs/kube-router" kube_router_image_tag: "{{ kube_router_version }}" -multus_image_repo: "docker.io/nfvpe/multus" +multus_image_repo: "{{ docker_image_repo }}/nfvpe/multus" multus_image_tag: "{{ multus_version }}" -nginx_image_repo: docker.io/nginx +nginx_image_repo: "{{ docker_image_repo }}/library/nginx" nginx_image_tag: 1.15 -haproxy_image_repo: docker.io/haproxy +haproxy_image_repo: "{{ docker_image_repo }}/library/haproxy" haproxy_image_tag: 1.9 coredns_version: "1.6.0" -coredns_image_repo: "docker.io/coredns/coredns" +coredns_image_repo: "{{ docker_image_repo }}/coredns/coredns" coredns_image_tag: "{{ coredns_version }}" nodelocaldns_version: "1.15.4" -nodelocaldns_image_repo: "k8s.gcr.io/k8s-dns-node-cache" +nodelocaldns_image_repo: "{{ kube_image_repo }}/k8s-dns-node-cache" nodelocaldns_image_tag: "{{ nodelocaldns_version }}" dnsautoscaler_version: 1.6.0 -dnsautoscaler_image_repo: "k8s.gcr.io/cluster-proportional-autoscaler-{{ image_arch }}" +dnsautoscaler_image_repo: "{{ kube_image_repo }}/cluster-proportional-autoscaler-{{ image_arch }}" dnsautoscaler_image_tag: "{{ dnsautoscaler_version }}" -test_image_repo: docker.io/busybox +test_image_repo: "{{ docker_image_repo }}/library/busybox" test_image_tag: latest -busybox_image_repo: docker.io/busybox +busybox_image_repo: "{{ docker_image_repo }}/library/busybox" busybox_image_tag: 1.29.2 helm_version: "v2.14.3" -helm_image_repo: "docker.io/lachlanevenson/k8s-helm" +helm_image_repo: "{{ docker_image_repo }}/lachlanevenson/k8s-helm" helm_image_tag: "{{ helm_version }}" -tiller_image_repo: "gcr.io/kubernetes-helm/tiller" +tiller_image_repo: "{{ gcr_image_repo }}/kubernetes-helm/tiller" tiller_image_tag: "{{ helm_version }}" -registry_image_repo: "docker.io/registry" +registry_image_repo: "{{ docker_image_repo }}/library/registry" registry_image_tag: "2.6" -registry_proxy_image_repo: "gcr.io/google_containers/kube-registry-proxy" +registry_proxy_image_repo: "{{ gcr_image_repo }}/google_containers/kube-registry-proxy" registry_proxy_image_tag: "0.4" metrics_server_version: "v0.3.3" -metrics_server_image_repo: "gcr.io/google_containers/metrics-server-amd64" +metrics_server_image_repo: "{{ gcr_image_repo }}/google_containers/metrics-server-amd64" metrics_server_image_tag: "{{ metrics_server_version }}" -local_volume_provisioner_image_repo: "quay.io/external_storage/local-volume-provisioner" +local_volume_provisioner_image_repo: "{{ quay_image_repo }}/external_storage/local-volume-provisioner" local_volume_provisioner_image_tag: "v2.3.2" -cephfs_provisioner_image_repo: "quay.io/external_storage/cephfs-provisioner" +cephfs_provisioner_image_repo: "{{ quay_image_repo }}/external_storage/cephfs-provisioner" cephfs_provisioner_image_tag: "v2.1.0-k8s1.11" -rbd_provisioner_image_repo: "quay.io/external_storage/rbd-provisioner" +rbd_provisioner_image_repo: "{{ quay_image_repo }}/external_storage/rbd-provisioner" rbd_provisioner_image_tag: "v2.1.1-k8s1.11" -local_path_provisioner_image_repo: "docker.io/rancher/local-path-provisioner" +local_path_provisioner_image_repo: "{{ docker_image_repo }}/rancher/local-path-provisioner" local_path_provisioner_image_tag: "v0.0.2" -ingress_nginx_controller_image_repo: "quay.io/kubernetes-ingress-controller/nginx-ingress-controller" +ingress_nginx_controller_image_repo: "{{ quay_image_repo }}/kubernetes-ingress-controller/nginx-ingress-controller" ingress_nginx_controller_image_tag: "0.25.1" cert_manager_version: "v0.5.2" -cert_manager_controller_image_repo: "quay.io/jetstack/cert-manager-controller" +cert_manager_controller_image_repo: "{{ quay_image_repo }}/jetstack/cert-manager-controller" cert_manager_controller_image_tag: "{{ cert_manager_version }}" addon_resizer_version: "1.8.3" -addon_resizer_image_repo: "k8s.gcr.io/addon-resizer" +addon_resizer_image_repo: "{{ kube_image_repo }}/addon-resizer" addon_resizer_image_tag: "{{ addon_resizer_version }}" -dashboard_image_repo: "gcr.io/google_containers/kubernetes-dashboard-{{ image_arch }}" +dashboard_image_repo: "{{ gcr_image_repo }}/google_containers/kubernetes-dashboard-{{ image_arch }}" dashboard_image_tag: "v1.10.1" image_pull_command: "{{ docker_bin_dir }}/docker pull"