rancher / os

Tiny Linux distro that runs the entire OS as Docker containers
https://rancher.com/docs/os/v1.x/en/
Apache License 2.0
6.44k stars 655 forks source link

DHCP + cloud-config #2691

Open kinolaev opened 5 years ago

kinolaev commented 5 years ago

RancherOS Version: (ros os version) 1.5.1

Where are you running RancherOS? (docker-machine, AWS, GCE, baremetal, etc.) docker-machine vmwarevsphere

Hello! I use this cloud-config to provision nodes on vsphere with rancher

#cloud-config
rancher:
  docker:
    engine: docker-17.03.2-ce
  network:
    dns:
      nameservers:
      - 10.0.0.1
    interfaces:
      eth0:
        addresses:
        - 10.0.0.0/24
        gateway: 10.0.0.1

When network has dhcp server rancheros doesn't switch docker engine: Get https://raw.githubusercontent.com/rancher/os-services/v1.5.1/d/docker-17.03.2-ce.yml: dial tcp: lookup raw.githubusercontent.com on [::1]:53: read udp [::1]:47930->[::1]:53: read: connection refused

If I remove rancher.network from cloud-config OR stop dhcp server rancheros switch docker engine correctly. So problem only appears when dhcp server enabled AND static network config provided via cloud-config.

Related: https://github.com/rancher/os/issues/2653 https://github.com/rancher/os/issues/1904

niusmallnan commented 5 years ago

This is because ros may not have obtained the address from DHCP when trying to get docker-17.03.2-ce.yml.

@Jason-ZW Can you try to add a mechanism to wait or retry when ros is getting the yml files.

kinolaev commented 5 years ago

I think it is not true, because if I remove static network config ros always receive address from DHCP before trying to get docker-17.03.2-ce.yml. Only when both: 1) static config provided 2) dhcp available, - ros can't get docker-17.03.2-ce.yml.