Skip to content
This repository was archived by the owner on Jan 12, 2023. It is now read-only.

Repository files navigation

Selectel VPC driver for Docker Machine

Build Status

This is a driver plugin for Docker Machine. It allows you to orchestrate virtual machines in Selectel Virtual Private Cloud (VPC)

Installation

Requirements

  • Docker CLI (the daemon is not required) must be installed on the client machine. Tested with version 18.03.1-ce, build 9ee9f40
  • Docker Machine. Tested with version: 0.14.0, build 89b8332
  • Access to an Selectel Cloud.

From Source

Clone this repo and run cmd which will install the driver into /usr/local/bin

$ make install

Obtaining credentials

To use the driver you will need to complete those steps:

  1. Create a project that will contain VMshere
  2. Set CPU, RAM and volume quotas
  3. Add floating IP to the project
  4. Create a new user and set the project role here

Then download the rc.shfile that contains env variables for managing OpenStack from CLI

🔥🔥 Attention! rc.sh does not contain information about OS_AVAILABILITY_ZONE

You should add it manually to the file or provide via --os-availability-zone as a СLI option.

Example of rc.sh

#!/bin/bash
export OS_AUTH_URL="https://api.selvpc.ru/identity/v3"
export OS_IDENTITY_API_VERSION="3"
export OS_VOLUME_API_VERSION="2"
export OS_PROJECT_DOMAIN_NAME='your_domain_name_here'
export OS_PROJECT_ID='your_project_id_here'
export OS_REGION_NAME='ru-1'
export OS_AVAILABILITY_ZONE='ru-1b'
export OS_USER_DOMAIN_NAME='your_domain_name_here'
export OS_USERNAME='you_user_name_here'
export OS_PASSWORD='you_user_password_here'

Usage

You may want to refer to the Docker Machine official documentation before using the driver.

Verify that the Selectel driver shows up in Docker Machine:

docker-machine create -d selectel --help

To create a Docker host, make sure that you have followed the instructions from Obtaining credentials section.

Create a VM with Docker and bind the local docker-client to the backend:

docker-machine create -d selectel you-server-name
eval$(docker-machine env you-server-name)

asciicast

CLI Options, Environment variables and default values:

CLI optionDefaultEnvironment variableDescription
--os-auth-url$OS_AUTH_URLOpenStack authentication URL
--os-domain-name$OS_PROJECT_DOMAIN_NAMEOpenStack domain name (identity v3 only)
--os-flavor-id$OS_FLAVOR_IDOpenStack flavor id to use for the instance
--os-flavor-name$OS_FLAVOR_NAMEOpenStack flavor name to use for the instance
--os-image-id$OS_IMAGE_IDOpenStack image id to use for the instance
--os-image-name"Ubuntu 16.04 LTS 64-bit"$OS_IMAGE_NAMEOpenStack flavor name to use for the instance
--os-net-id$OS_NETWORK_IDOpenStack network id the machine will be connected on
--os-project-id$OS_PROJECT_IDOpenStack project id
--os-region$OS_REGION_NAMEOpenStack region name
--os-availability-zone$OS_AVAILABILITY_ZONEOpenStack availability zone
--os-username$OS_USERNAMEOpenStack username
--os-password$OS_PASSWORDOpenStack user password
--sel-cpu"1"$SEL_CPU_VALUECount of vCPU for server
--sel-proxy$SEL_PROXYProxy for the OS services
--sel-ram"512"$SEL_RAM_VALUECount of RAM for server
--sel-server-name$SEL_SERVER_NAMEName of future server
--sel-ssh-pair-name"docker-machine-key"$SEL_SSH_PAIR_NAMEExisting keypair name
--sel-ssh-port"22"$SEL_SSH_PORTSSH port for connecting to the server
--sel-ssh-private-key-path$SEL_SSH_PRIVATE_KEY_PATHPrivate keyfile to use for SSH (absolute path)
--sel-ssh-user"root"$SEL_SSH_USERSSH user for connecting to the server
--sel-volume-name$SEL_VOLUME_NAMEName of the server volume
--sel-volume-size"5"$SEL_VOLUME_SIZEVolume size
--sel-volume-type$SEL_VOLUME_TYPEBase volume type for server

Related links

Authors

Contributing

We hope you'll get involved!

License

Apache 2.0

About

Selectel VPC driver for Docker Machine

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages