Giter VIP home page Giter VIP logo

docker-machine-driver-vultr's Introduction

docker-machine-driver-vultr

Vultr Driver for docker-machine and Rancher Node Driver

Install as a docker-machine driver

docker-machine is required, see the installation documentation.

Then install the docker-machine-driver-vultr driver by copying the build to /usr/local/bin/.

Install as a Rancher Node Driver

Use overlay2 as the storage engine

Installing from source

If you would rather build from source, you will need to have a working go 1.11+ environment,

eval $(go env)
export PATH="$PATH:$GOPATH/bin"
curl -O "https://gitlab-docker-machine-downloads.s3.amazonaws.com/v0.16.2-gitlab.11/docker-machine-Linux-x86_64"
cp docker-machine-Linux-x86_64 /usr/local/bin/docker-machine
chmod +x /usr/local/bin/docker-machine

And then compile the docker-machine-driver-vultr driver:

go get -u github.com/vultr/docker-machine-driver-vultr@latest
cd $GOPATH/src/github.com/vultr/docker-machine-driver-vultr
make install

Run

You will need a Vultr APIv4 Personal API key. Is only available in members area https://my.vultr.com/settings/#settingsapi, you need to create an account (https://www.vultr.com/register/) to get there

You will also need to use the 19.03.9 install enginer as shown in the example below

docker-machine create -d vultr --vultr-api-key=<vultr-api-key> --engine-install-url "https://releases.rancher.com/install-docker/19.03.9.sh" <machine-name>

Options

Argument Env Default Description
vultr-api-key VULTR_API_KEY None required Vultr API key (see here)
vultr-server-type VULTR_SERVER_TYPE 1 Vultr Server Type ( 1-SSD, 2-BareMetal, 3-DedicatedCloud)
vultr-region VULTR_REGION 1 (New Jersey) VPS DCID (Region) (see here)
vultr-vps-plan-id VULTR_VPS_PLAN_ID 201 (1024 MB RAM,25 GB SSD,1.00 TB BW) VPS Plan ID (see here)
vultr-os-id VULTR_OS_ID 270 (Ubuntu 18.04 x64) VPS Operating System ID (see here)
vultr-ipxe-chain-url VULTR_IPXE_CHAIN_URL None (optional) If you've selected the 'custom' operating system, this can be set to chainload the specified URL on bootup, via iPXE
vultr-iso-id VULTR_ISO_ID None (optional) If you've selected the 'custom' operating system, this is the ID of a specific ISO to mount during the deployment
vultr-script-id VULTR_SCRIPT_ID None (optional) If you've not selected a 'custom' operating system, this can be the SCRIPTID of a startup script to execute on boot
vultr-snapshot-id VULTR_SNAPSHOT_ID None (optional) If you've selected the 'snapshot' operating system, this should be the SNAPSHOTID (see v1/snapshot/list) to restore for the initial installation
vultr-app-id VULTR_APP_ID None (optional) If launching an application (OSID 186), this is the APPID to launch
vultr-reserved-ip-v4 VULTR_RESERVED_IP_V4 None (optional) IP address of the floating IP to use as the main IP of this server
vultr-ip-v6 VULTR_IP_V6 None (optional) If true, an IPv6 subnet will be assigned to the machine (where available)
vultr-auto-backups VULTR_AUTO_BACKUPS None (optional) If true, automatic backups will be enabled for this server (these have an extra charge associated with them)
vultr-private-network VULTR_PRIVATE_NETWORK None (optional) If true, private networking support will be added to the new server
vultr-network-id VULTR_NETWORK_ID None (optional) List of private networks to attach to this server. Use either this field or enable_private_network, not both
vultr-notify-activate VULTR_NOTIFY_ACTIVATE None (optional) If true, an activation email will be sent when the server is ready
vultr-ddos-protection VULTR_DDOS_PROTECTION None (optional) If true, DDOS protection will be enabled on the subscription (there is an additional charge for this)
vultr-userdata VULTR_USERDATA None (optional) Base64 encoded user-data
vultr-label VULTR_LABEL None (optional) This is a text label that will be shown in the control panel
vultr-hostname VULTR_HOSTNAME None (optional) The hostname to assign to this server
vultr-tag VULTR_TAG None (optional) The tag to assign to this server
vultr-firewall-group-id VULTR_FIREWALL_GROUP_ID None (optional) The firewall group to assign to this server
vultr-sshkey-id VULTR_SSHKEY_ID None (optional) List of SSH keys to apply to this server on install (only valid for Linux/FreeBSD)

Debugging

Detailed run output will be emitted when using the docker-machine --debug option.

docker-machine --debug  create -d vultr --vultr-api-key=<vultr-api-key> machinename

Examples

Simple Example

docker-machine create -d vultr --vultr-api-key=<vultr-api-key> vultr
eval $(docker-machine env vultr)
$ docker-machine ls
NAME      ACTIVE   DRIVER   STATE     URL                         SWARM   DOCKER     ERRORS
vultr     -        vultr    Running   tcp://207.246.87.114:2376           v19.03.5

$ docker-machine rm vultr
About to remove vultr
WARNING: This action will delete both local reference and remote instance.
Are you sure? (y/n): y
Successfully removed vultr

Required Ports

By default, Vultr images have UFW enabled with only port 22 open. The default cloud-init script in this driver completely disables UFW, however, for production environments we recommend only opening specific ports as needed.

The port requirements for Rancher can be found here: https://ranchermanager.docs.rancher.com/getting-started/installation-and-upgrade/installation-requirements/port-requirements

docker-machine-driver-vultr's People

Contributors

allen-munsch avatar biondizzle avatar ddymko avatar dependabot-preview[bot] avatar happytreees avatar optik-aper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

docker-machine-driver-vultr's Issues

[BUG] - Node provisioning using Rancher RKE and Vultr docker-machine driver fails with certificate validation error

Describe the bug
Node provisioning using Rancher RKE and Vultr docker-machine driver fails with certificate validation error

To Reproduce

  • Import the latest Vultr docker-machine driver into Rancher (current release v2.1.0)

  • Create some node template (used one attached)

  • Try to spin up a cluster using Vultr as provider (one node acting as etcd, control plane and worker is enough for testing)

    --> Compute resource gets created, OS is successfully installed, SSH connection gets established to install the Docker Runtime
    but fails afterward, validating the previously copied certs

    --> Rancher UI shows error:
    Error checking the host: Error checking and/or regenerating the certs: There was an error validating certificates for host "80.240.20.22:2376": dial tcp 80.240.20.22:2376: i/o timeout

    --> Rancher Server Log shows error:
    2023/11/13 08:51:52 [INFO] [node-controller-rancher-machine] The default lines below are for a sh/bash shell, you can specify the shell you're using, with the --shell flag. 2023/11/13 08:51:52 [INFO] [node-controller-rancher-machine] 2023/11/13 08:51:52 [INFO] Generating and uploading node config vultr-fra-dev-rt7-01-wrk1 2023/11/13 08:51:52 [DEBUG] getNodeTemplate parsed [cattle-global-nt:nt-vq94x] to ns: [cattle-global-nt] and n: [nt-vq94x] 2023/11/13 08:51:52 [DEBUG] Cleaning up [/opt/jail/c-rg7nj/management-state/node/nodes/vultr-fra-dev-rt7-01-wrk1] 2023/11/13 08:51:52 [ERROR] error syncing 'c-rg7nj/m-twnxp': handler node-controller: Error creating machine: Error checking the host: Error checking and/or regenerating the certs: There was an error validating certificates for host "209.250.239.253:2376": dial tcp 209.250.239.253:2376: i/o timeout, requeuing 2023/11/13 08:51:52 [DEBUG] [nodepool] bad node found: m-twnxp

Used Environment:

  • Rancher v2.5.9 (tested k8s version: v1.20.11-rancher1-1 / RKE template in attachment)
  • Rancher v2.7.1 (tested k8s version: v1.24.17-rancher1-1 / RKE template in attachment)
  • (Vultr docker-machine driver v2.1.0)

Additional context
Vultr Ticket Number: #RCS-91QFV --> requested to open an issue in this project

vultrMasterNodeTemplate.json
vultrRKETemplateRancher259.json
vultrRKETemplateRancher271.json

[BUG] - Nodes remain uninitialized --> CCM complains about "providerID cannot be an empty string"

After creating a cluster with one or more node pools, the nodes in the pools keep the taint "node.cloudprovider.kubernetes.io/uninitialized=true:NoSchedule" and therefor are not usable for normal workloads without taint toleration.

Also, the deployed Vultr CCM can not create a new Load Balancer due to the fact that it misses a ProviderID.

By searching for a solution for the first issue I stumbled upon some similar cases on vSphere and OpenStack clusters, where in both cases it seemed that the Docker Machine Driver which was used, did not return the required ProviderID.

Rancher v2.5.9
K8s: v1.20.11
Vultr Docker Machine Driver v1.2.0
Vultr CCM v0.10.0

Used RKE Template:
vultr_rke_template.yml.json

Used Node Template:
vultr_node_template.json

EDIT

found on another Node from a different provider the following k/v in the node spec
providerId": "digitalocean://379349108",

So this is simply missing on the Vultr Nodes.
image

See also:
here

[BUG] - Vultr instance never arrives at "ok" state in docker-machine

Describe the bug
I am trying to use docker-machine to spin up a vultr instance but it never fully finishes. It gets stuck at the "(vultr) waiting for server state to become 'ok'..." stage. On the vultr panel I can see the instance did actually spin up fully but docker-machine doesn't seem to think so. I run into this issue even using the very basic example from the docs.

To Reproduce
Steps to reproduce the behavior:

  1. docker-machine.exe --debug create -d vultr --vultr-api-key= vultr
  2. Hangs

Expected behavior
For docker-machine to finish and the instance show up as a docker container

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information where applicable:

  • OS: Win10
  • Language Version: go version go1.14.3 windows/amd64
  • Docker-Machine Version: docker-machine.exe version 0.12.2, build 9371605

Additional context

Docker-machine output:

PS C:\Users\Tanner\go\src\github.com\vultr\docker-machine-driver-vultr> docker-machine.exe --debug create -d vultr --vultr-api-key=****** vultr
Docker Machine Version: 0.12.2, build 9371605
Found binary path at C:\Users\Tanner\go\bin\docker-machine-driver-vultr.exe
Launching plugin server for driver vultr
Plugin server listening at address 127.0.0.1:61773
() Calling .GetVersion
Using API Version 1
() Calling .SetConfigRaw
() Calling .GetMachineName
(flag-lookup) Calling .GetMachineName
(flag-lookup) Calling .DriverName
(flag-lookup) Calling .GetCreateFlags
Found binary path at C:\Users\Tanner\go\bin\docker-machine-driver-vultr.exe
Launching plugin server for driver vultr
Plugin server listening at address 127.0.0.1:61775
() Calling .GetVersion
Using API Version 1
() Calling .SetConfigRaw
() Calling .GetMachineName
(vultr) Calling .GetMachineName
(vultr) Calling .DriverName
(vultr) Calling .GetCreateFlags
(vultr) Calling .SetConfigFromFlags
Running pre-create checks...
(vultr) Calling .PreCreateCheck
(vultr) Calling .GetConfigRaw
Creating machine...
(vultr) Calling .Create
(vultr) DBG | Generating SSH key...
(vultr) waiting for ip address to become available...
(vultr) Created Vultr VPS with ID: 42476196, Public IP: 207.246.87.6
(vultr) waiting for server state to become 'ok'...

docker-machine ls output:

PS C:\Users\Tanner> docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
job - vultr Error Unknown Invalid server.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.