Rke安装时不去指定的镜像仓库拉取镜像

RKE 版本:1.2.14

Docker 版本: 20.10.12

操作系统和内核: centos7.6, 3.10.0-957.el7.x86_64

cluster.yml 文件:

nodes:
- address: "172.200.101.92"
  port: "22"
  internal_address: ""
  role:
  - controlplane
  - worker
  - etcd
  hostname_override: ""
  user: rke
  docker_socket: /var/run/docker.sock
  ssh_key: ""
  ssh_key_path: ~/.ssh/id_rsa
  ssh_cert: ""
  ssh_cert_path: ""
  labels: {}
  taints: []
- address: 172.200.101.106
  port: "22"
  internal_address: ""
  role:
  - controlplane
  - worker
  - etcd
  hostname_override: ""
  user: rke
  docker_socket: /var/run/docker.sock
  ssh_key: ""
  ssh_key_path: ~/.ssh/id_rsa
  ssh_cert: ""
  ssh_cert_path: ""
  labels: {}
  taints: []
- address: 172.200.101.177
  port: "22"
  internal_address: ""
  role:
  - controlplane
  - worker
  - etcd
  hostname_override: ""
  user: rke
  docker_socket: /var/run/docker.sock
  ssh_key: ""
  ssh_key_path: ~/.ssh/id_rsa
  ssh_cert: ""
  ssh_cert_path: ""
  labels: {}
  taints: []
services:
  etcd:
    image: ""
    extra_args: {}
    extra_binds: []
    extra_env: []
    win_extra_args: {}
    win_extra_binds: []
    win_extra_env: []
    external_urls: []
    ca_cert: ""
    cert: ""
    key: ""
    path: ""
    uid: 0
    gid: 0
    snapshot: null
    retention: ""
    creation: ""
    backup_config: null
  kube-api:
    image: ""
    extra_args: {}
    extra_binds: []
    extra_env: []
    win_extra_args: {}
    win_extra_binds: []
    win_extra_env: []
    service_cluster_ip_range: 10.43.0.0/16
    service_node_port_range: ""
    pod_security_policy: false
    always_pull_images: false
    secrets_encryption_config: null
    audit_log: null
    admission_configuration: null
    event_rate_limit: null
  kube-controller:
    image: ""
    extra_args: {}
    extra_binds: []
    extra_env: []
    win_extra_args: {}
    win_extra_binds: []
    win_extra_env: []
    cluster_cidr: 10.42.0.0/16
    service_cluster_ip_range: 10.43.0.0/16
  scheduler:
    image: ""
    extra_args: {}
    extra_binds: []
    extra_env: []
    win_extra_args: {}
    win_extra_binds: []
    win_extra_env: []
  kubelet:
    image: ""
    extra_args: {}
    extra_binds: []
    extra_env: []
    win_extra_args: {}
    win_extra_binds: []
    win_extra_env: []
    cluster_domain: "core2rancher.com"
    infra_container_image: ""
    cluster_dns_server: 10.43.0.10
    fail_swap_on: false
    generate_serving_certificate: false
  kubeproxy:
    image: ""
    extra_args: {}
    extra_binds: []
    extra_env: []
    win_extra_args: {}
    win_extra_binds: []
    win_extra_env: []
network:
  plugin: canal
  options: {}
  mtu: 0
  node_selector: {}
  update_strategy: null
  tolerations: []
authentication:
  strategy: x509
  sans: []
  webhook: null
addons: ""
addons_include: []
private_registries:
     - url: registry.hsoftcloud.com
       user: admin
       password: ********
       is_default: true
system_images:
  etcd: rancher/mirrored-coreos-etcd:v3.4.15-rancher1
  alpine: rancher/rke-tools:v0.1.78
  nginx_proxy: rancher/rke-tools:v0.1.78
  cert_downloader: rancher/rke-tools:v0.1.78
  kubernetes_services_sidecar: rancher/rke-tools:v0.1.78
  kubedns: rancher/mirrored-k8s-dns-kube-dns:1.15.10
  dnsmasq: rancher/mirrored-k8s-dns-dnsmasq-nanny:1.15.10
  kubedns_sidecar: rancher/mirrored-k8s-dns-sidecar:1.15.10
  kubedns_autoscaler: rancher/mirrored-cluster-proportional-autoscaler:1.8.1
  coredns: rancher/mirrored-coredns-coredns:1.8.0
  coredns_autoscaler: rancher/mirrored-cluster-proportional-autoscaler:1.8.1
  nodelocal: rancher/mirrored-k8s-dns-node-cache:1.15.13
  kubernetes: rancher/hyperkube:v1.20.12-rancher1
  flannel: rancher/mirrored-coreos-flannel:v0.13.0
  flannel_cni: rancher/flannel-cni:v0.3.0-rancher6
  calico_node: rancher/mirrored-calico-node:v3.17.2
  calico_cni: rancher/mirrored-calico-cni:v3.17.2
  calico_controllers: rancher/mirrored-calico-kube-controllers:v3.17.2
  calico_ctl: rancher/mirrored-calico-ctl:v3.17.2
  calico_flexvol: rancher/mirrored-calico-pod2daemon-flexvol:v3.17.2
  canal_node: rancher/mirrored-calico-node:v3.17.2
  canal_cni: rancher/mirrored-calico-cni:v3.17.2
  canal_controllers: rancher/mirrored-calico-kube-controllers:v3.17.2
  canal_flannel: rancher/coreos-flannel:v0.13.0-rancher1
  canal_flexvol: rancher/mirrored-calico-pod2daemon-flexvol:v3.17.2
  weave_node: weaveworks/weave-kube:2.8.1
  weave_cni: weaveworks/weave-npc:2.8.1
  pod_infra_container: rancher/mirrored-pause:3.2
  ingress: rancher/nginx-ingress-controller:nginx-0.49.3-rancher1
  ingress_backend: rancher/mirrored-nginx-ingress-controller-defaultbackend:1.5-rancher1
  ingress_webhook: rancher/mirrored-ingress-nginx-kube-webhook-certgen:v1.1.1
  metrics_server: rancher/mirrored-metrics-server:v0.4.1
  windows_pod_infra_container: rancher/kubelet-pause:v0.1.6
  aci_cni_deploy_container: noiro/cnideploy:5.1.1.0.1ae238a
  aci_host_container: noiro/aci-containers-host:5.1.1.0.1ae238a
  aci_opflex_container: noiro/opflex:5.1.1.0.1ae238a
  aci_mcast_container: noiro/opflex:5.1.1.0.1ae238a
  aci_ovs_container: noiro/openvswitch:5.1.1.0.1ae238a
  aci_controller_container: noiro/aci-containers-controller:5.1.1.0.1ae238a
  aci_gbp_server_container: noiro/gbp-server:5.1.1.0.1ae238a
  aci_opflex_server_container: noiro/opflex-server:5.1.1.0.1ae238a
ssh_key_path: ~/.ssh/id_rsa
ssh_cert_path: ""
ssh_agent_auth: false
authorization:
  mode: rbac
  options: {}
ignore_docker_version: null
kubernetes_version: ""
ingress:
  provider: ""
  options: {}
  node_selector: {}
  extra_args: {}
  dns_policy: ""
  extra_envs: []
  extra_volumes: []
  extra_volume_mounts: []
  update_strategy: null
  http_port: 0
  http s_port: 0
  network_mode: ""
  tolerations: []
  default_backend: null
  default_http_backend_priority_class_name: ""
  nginx_ingress_controller_priority_class_name: ""
cluster_name: ""
cloud_provider:
  name: ""
prefix_path: ""
win_prefix_path: ""
addon_job_timeout: 0
bastion_host:
  address: ""
  port: ""
  user: ""
  ssh_key: ""
  ssh_key_path: ""
  ssh_cert: ""
  ssh_cert_path: ""
monitoring:
  provider: ""
  options: {}
  node_selector: {}
  update_strategy: null
  replicas: null
  tolerations: []
  metrics_server_priority_class_name: ""
restore:
  restore: false
  snapshot_name: ""
rotate_encryption_key: false
dns: null

重现步骤: rke up --config ./cluster.yml

结果:

INFO[0000] Running RKE version: v1.2.14                 
INFO[0000] Initiating Kubernetes cluster                
INFO[0000] [certificates] GenerateServingCertificate is disabled, checking if there are unused kubelet certificates 
INFO[0000] [certificates] Generating admin certificates and kubeconfig 
INFO[0000] Successfully Deployed state file at [./cluster.rkestate] 
INFO[0000] Building Kubernetes cluster                  
INFO[0000] [dialer] Setup tunnel for host [172.200.101.92] 
INFO[0000] [dialer] Setup tunnel for host [172.200.101.106] 
INFO[0000] [dialer] Setup tunnel for host [172.200.101.177] 
INFO[0000] [network] Deploying port listener containers 
INFO[0000] Pulling image [rancher/rke-tools:v0.1.78] on host [172.200.101.106], try #1 
INFO[0000] Pulling image [rancher/rke-tools:v0.1.78] on host [172.200.101.177], try #1 
INFO[0000] Pulling image [rancher/rke-tools:v0.1.78] on host [172.200.101.92], try #1 
WARN[0000] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.106]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:36722->[::1]:53: read: connection refused 
INFO[0000] Pulling image [rancher/rke-tools:v0.1.78] on host [172.200.101.106], try #2 
WARN[0000] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.177]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:33066->[::1]:53: read: connection refused 
INFO[0000] Pulling image [rancher/rke-tools:v0.1.78] on host [172.200.101.177], try #2 
WARN[0000] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.92]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:41251->[::1]:53: read: connection refused 
INFO[0000] Pulling image [rancher/rke-tools:v0.1.78] on host [172.200.101.92], try #2 
WARN[0000] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.106]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:45577->[::1]:53: read: connection refused 
INFO[0000] Pulling image [rancher/rke-tools:v0.1.78] on host [172.200.101.106], try #3 
WARN[0000] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.177]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:49915->[::1]:53: read: connection refused 
INFO[0000] Pulling image [rancher/rke-tools:v0.1.78] on host [172.200.101.177], try #3 
WARN[0000] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.92]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:52478->[::1]:53: read: connection refused 
INFO[0000] Pulling image [rancher/rke-tools:v0.1.78] on host [172.200.101.92], try #3 
WARN[0000] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.106]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:38579->[::1]:53: read: connection refused 
INFO[0000] Pulling image [rancher/rke-tools:v0.1.78] on host [172.200.101.106], try #1 
WARN[0000] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.177]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:56226->[::1]:53: read: connection refused 
INFO[0000] Pulling image [rancher/rke-tools:v0.1.78] on host [172.200.101.177], try #1 
WARN[0000] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.92]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:52837->[::1]:53: read: connection refused 
INFO[0000] Pulling image [rancher/rke-tools:v0.1.78] on host [172.200.101.92], try #1 
WARN[0000] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.106]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:57446->[::1]:53: read: connection refused 
INFO[0000] Pulling image [rancher/rke-tools:v0.1.78] on host [172.200.101.106], try #2 
WARN[0000] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.177]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:39252->[::1]:53: read: connection refused 
INFO[0000] Pulling image [rancher/rke-tools:v0.1.78] on host [172.200.101.177], try #2 
WARN[0000] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.92]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:54026->[::1]:53: read: connection refused 
INFO[0000] Pulling image [rancher/rke-tools:v0.1.78] on host [172.200.101.92], try #2 
WARN[0000] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.106]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:34080->[::1]:53: read: connection refused 
INFO[0000] Pulling image [rancher/rke-tools:v0.1.78] on host [172.200.101.106], try #3 
WARN[0000] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.177]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:53452->[::1]:53: read: connection refused 
INFO[0000] Pulling image [rancher/rke-tools:v0.1.78] on host [172.200.101.177], try #3 
WARN[0000] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.92]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:32904->[::1]:53: read: connection refused 
INFO[0000] Pulling image [rancher/rke-tools:v0.1.78] on host [172.200.101.92], try #3 
WARN[0000] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.106]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:52199->[::1]:53: read: connection refused 
WARN[0000] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.177]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:43203->[::1]:53: read: connection refused 
WARN[0000] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.92]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:55993->[::1]:53: read: connection refused 
INFO[0003] Pulling image [rancher/rke-tools:v0.1.78] on host [172.200.101.177], try #1 
INFO[0003] Pulling image [rancher/rke-tools:v0.1.78] on host [172.200.101.106], try #1 
INFO[0003] Pulling image [rancher/rke-tools:v0.1.78] on host [172.200.101.92], try #1 
WARN[0003] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.106]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:43644->[::1]:53: read: connection refused 
INFO[0003] Pulling image [rancher/rke-tools:v0.1.78] on host [172.200.101.106], try #2 
WARN[0003] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.177]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:36209->[::1]:53: read: connection refused 
INFO[0003] Pulling image [rancher/rke-tools:v0.1.78] on host [172.200.101.177], try #2 
WARN[0003] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.92]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:40026->[::1]:53: read: connection refused 
INFO[0003] Pulling image [rancher/rke-tools:v0.1.78] on host [172.200.101.92], try #2 
WARN[0003] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.106]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:51900->[::1]:53: read: connection refused 
INFO[0003] Pulling image [rancher/rke-tools:v0.1.78] on host [172.200.101.106], try #3 
WARN[0003] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.177]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:59355->[::1]:53: read: connection refused 
INFO[0003] Pulling image [rancher/rke-tools:v0.1.78] on host [172.200.101.177], try #3 
WARN[0003] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.92]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:58532->[::1]:53: read: connection refused 
INFO[0003] Pulling image [rancher/rke-tools:v0.1.78] on host [172.200.101.92], try #3 
WARN[0003] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.106]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:38928->[::1]:53: read: connection refused 
WARN[0003] [network] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.106]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:38928->[::1]:53: read: connection refused 
WARN[0003] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.177]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:40683->[::1]:53: read: connection refused 
WARN[0003] [network] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.177]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:40683->[::1]:53: read: connection refused 
WARN[0003] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.92]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:59003->[::1]:53: read: connection refused 
WARN[0003] [network] Can't pull Docker image [rancher/rke-tools:v0.1.78] on host [172.200.101.92]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:59003->[::1]:53: read: connection refused 
FATA[0003] [Failed to pull image [rancher/rke-tools:v0.1.78] on host [172.200.101.106]: Error response from daemon: Get "http s://registry-1.docker. io/v2/": dial tcp: lookup registry-1.docker. io on [::1]:53: read udp [::1]:38928->[::1]:53: read: connection refused]

你的私有镜像仓库启用 https 了吗?

麻烦你用 Mackdown 格式化一下你的配置文件。

私有镜像仓库没有启用https,用的是http。
mackdown正在研究咋用

如果没记错的话,同时设置 system_imagesprivate_registries ,会优先使用 system_images 下的镜像去拉取。

你可以试试将 system_images 和 下面列的镜像都删掉试试

1 个赞

你说的没错,好使了,谢谢