remche / terraform-openstack-rke

Terraform Openstack RKE
Mozilla Public License 2.0
37 stars 20 forks source link

Install fails because no docker engine is installed #69

Closed Linutux closed 4 years ago

Linutux commented 4 years ago

I tested the script, but unfortunately the install fails, because no docker engine is installed. I tried with

wait_for_commands = [ "sudo apt update", "sudo apt upgrade -y", "sudo curl https://releases.rancher.com/install-docker/19.03.sh | sh" ]

but without any success, because the worker nodes have no direct internet connection. Only private IP. How do I do that?

remche commented 4 years ago
  1. Note that best practice is to use Packer to prepare your own Openstack image embedding docker instead of installing it at deploy time.
  2. If you want to install in an air gaped environment, you will have to cook an Openstack image embedding all RKE docker images (or use a private registry). See here for a Packer recipe that pull RKE images.
Linutux commented 4 years ago

Thank you @remche for your help!

If anyone needs a script to build an image with docker, here is a recipe for packer.io I wrote tonight. It builds an Ubuntu 20.04 with Docker.

docker.json { "builders": [ { "type": "openstack", "identity_endpoint": "https://identity.api.ams.fuga.cloud:443/v3", "ssh_username": "ubuntu", "image_name": "Ubuntu 20.04 LTS Docker", "source_image": "23970310-5513-470d-9ae0-dfffad57b3ac", "flavor": "p2.medium", "floating_ip_network": "bf66495a-4c0d-4725-88c0-462198f1b1fc", "networks": "bf66495a-4c0d-4725-88c0-462198f1b1fc", "security_groups": "Packer", "insecure": "true" } ], "provisioners": [ { "type": "shell", "inline": ["sleep 10"] }, { "type": "shell", "inline": ["echo 'the following file can be downloaded here: https://releases.rancher.com/install-docker/19.03.sh'"] }, { "type": "shell", "script": "19.03.sh" }, { "type": "shell", "inline": ["sudo usermod -aG docker ubuntu"] } ] }

You need to adjust identity_endpoint: the endpoint of your openstack install flavor: the flavor of the build machine source_image: the ID of the Ubuntu 20.04 LTS image in Openstack floating_ip_network and network: the ID of the "public" network

Create a sec group in Openstack with full ingress and egress rights, call it Packer.

Execute "wget https://releases.rancher.com/install-docker/19.03.sh"

Source your openrc.sh, then execute "/usr/bin/packer validate docker.json" and "/usr/bin/packer build docker.json"

Linutux commented 4 years ago

But there is still a question left for me: How do I assign a floatingip to the worker nodes automatically? I want them to have a floatingip too, not only the master nodes.

remche commented 4 years ago

@Linutux edge nodes are worker nodes that get a floating ip. Simply use them instead of worker nodes.

Linutux commented 4 years ago

Oh. Thanks!