cloudca

package module
v2.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2018 License: MIT Imports: 14 Imported by: 0

README

docker-machine-cloudca

Create Docker machines on cloud.ca

You need to get your cloud.ca API key from the cloud.ca portal through the API keys option under the user profile menu and pass that to docker-machine create with the --cloudca-api-key option.

Requirements

Installation

  1. Download the cloud.ca Docker Machine driver binary for your OS from the releases page.
  2. Copy the driver to the directory where Docker Machine is located.

Usage

docker-machine create -d cloudca \
   --cloudca-api-key "APIkey****************" \
   --cloudca-service-code "compute-qc" \
   --cloudca-environment-name "test-area" \
   --cloudca-template "Ubuntu 16.04.01 HVM" \
   --cloudca-compute-offering "1vCPU.1GB" \
   --cloudca-network-id "bbefe8dd-bb3e-4f37-b467-b63f8334c15b" \
   --cloudca-root-disk-size-in-gb 60 \
   --cloudca-additional-disk-offering "50GB - 50 IOPS Min." \
   test-machine1

Notes:

  • It is recommended to use Environment variables to store sensitive information like API keys. See the options below for the list of supported variables.
  • The cloud.ca instances have limited disk space on their root volumes. In order to get more disk space for your Docker machines, use the --cloudca-root-disk-size-in-gb if you have a resizable template or --cloudca-additional-disk-offering option to specify an additional volume that Docker will be able to use.

Options

Option Name Environment Variable Name Description Default Value required
--cloudca-api-key CLOUDCA_API_KEY cloud.ca API key none yes
--cloudca-service-code CLOUDCA_SERVICE_CODE cloud.ca service code none yes
--cloudca-environment-name CLOUDCA_ENVIRONMENT_NAME cloud.ca environment name none yes
--cloudca-template CLOUDCA_TEMPLATE cloud.ca template name or ID none yes
--cloudca-compute-offering CLOUDCA_COMPUTE_OFFERING cloud.ca compute offering name or ID none yes
--cloudca-network-id CLOUDCA_NETWORK_ID cloud.ca network ID (where the machine will be deployed) none yes
--cloudca-root-disk-size-in-gb CLOUDCA_ROOT_DISK_SIZE_IN_GB cloud.ca root disk size in gb (for resizable templates) size defined by template no
--cloudca-additional-disk-offering CLOUDCA_ADDITIONAL_DISK_OFFERING cloud.ca additional disk offering name or ID to attach to the machine none no
--cloudca-use-private-ip CLOUDCA_USE_PRIVATE_IP Use a private IP to access the machine false no
--cloudca-ssh-user CLOUDCA_SSH_USER cloud.ca SSH user cca-user no

Build from source

Download the driver source:

$ go get github.com/cloud-ca/docker-machine-driver-cloudca

Compile the driver:

$ cd $GOPATH/src/github.com/cloud-ca/docker-machine-driver-cloudca
$ make install

License

This project is licensed under the terms of the MIT license.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDriver

func NewDriver(hostName, storePath string) drivers.Driver

Types

type Driver

type Driver struct {
	*drivers.BaseDriver
	Id                       string
	ApiUrl                   string
	ApiKey                   string
	ServiceCode              string
	EnvironmentName          string
	UsePrivateIp             bool
	PublicIp                 string
	PublicIpId               string
	PrivateIp                string
	PrivateIpId              string
	TemplateId               string
	ComputeOfferingId        string
	CpuCount                 string
	MemoryInMb               string
	NetworkId                string
	VpcId                    string
	RootDiskSizeInGb         string
	AdditionalDiskOfferingId string
	AdditionalDiskSizeGb     string
	AdditionalDiskIops       string
	AdditionalVolumeId       string
}

func (*Driver) Create

func (d *Driver) Create() error

Create a host using the driver's config

func (*Driver) DriverName

func (d *Driver) DriverName() string

DriverName returns the name of the driver as it is registered

func (*Driver) GetCreateFlags

func (d *Driver) GetCreateFlags() []mcnflag.Flag

GetCreateFlags registers the flags this driver adds to "docker hosts create"

func (*Driver) GetIP

func (d *Driver) GetIP() (string, error)

GetIP returns the IP that this host is available at

func (*Driver) GetSSHHostname

func (d *Driver) GetSSHHostname() (string, error)

func (*Driver) GetSSHUsername

func (d *Driver) GetSSHUsername() string

func (*Driver) GetState

func (d *Driver) GetState() (state.State, error)

GetState returns the state that the host is in (running, stopped, etc)

func (*Driver) GetURL

func (d *Driver) GetURL() (string, error)

GetURL returns a Docker compatible host URL for connecting to this host e.g. tcp://1.2.3.4:2376

func (*Driver) Kill

func (d *Driver) Kill() (err error)

func (*Driver) PreCreateCheck

func (d *Driver) PreCreateCheck() error

PreCreate allows for pre-create operations to make sure a driver is ready for creation

func (*Driver) Remove

func (d *Driver) Remove() error

func (*Driver) Restart

func (d *Driver) Restart() (err error)

func (*Driver) SetConfigFromFlags

func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error

SetConfigFromFlags configures the driver with the object that was returned by RegisterCreateFlags

func (*Driver) Start

func (d *Driver) Start() (err error)

func (*Driver) Stop

func (d *Driver) Stop() (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL