glesys

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: MIT Imports: 14 Imported by: 0

README

Build Status

GleSYS driver for Docker Machine

This is the official Docker Machine driver to create Docker machines with GleSYS.

Installation

From a Release

Binaries are available for Linux, OS X and Windows on the releases page.

Download the binary for your platform, make sure to add it to your PATH and make it executable.

Rename the file to docker-machine-driver-glesys.

Windows

Rename the file to docker-machine-driver-glesys.exe

Building from Source

Make sure you have Go and GOPATH setup correctly. Then run:

go get github.com/glesys/docker-machine-driver-glesys
cd $GOPATH/src/github.com/glesys/docker-machine-driver-glesys
go install ./cmd/docker-machine-driver-glesys

Obtaining Credentials

To use this driver you need a GleSYS Cloud account and a valid API key. You can sign up for a free account at https://glesys.com/signup then visit https://customer.glesys.com to create an API key for any of your projects.

Using the Driver

You can ensure that docker-machine can find the GleSYS driver by asking for the driver help:

docker-machine create -d glesys | grep glesys

  --glesys-project                             GleSYS project (e.g. CL12345) [$GLESYS_PROJECT]
  --glesys-api-key                             GleSYS API key [$GLESYS_API_KEY]

  --glesys-bandwidth "100"                     Bandwidth in MBit/s
  --glesys-campaign-code                       Campaign code to use for the machine
  --glesys-cpu "2"                             Number of CPU cores
  --glesys-data-center "Falkenberg"            Data center to place the machine in
  --glesys-memory "2048"                       Memory in MB
  --glesys-root-password                       Root password to use for the machine. If omitted, a random password will be generated (VMware only)
  --glesys-username-kvm "docker-machine"       Username to use in KVM platform
  --glesys-ssh-key-path                        Path to the SSH key file you want to use. If omitted, a new key will be generated
  --glesys-storage "20"                        Storage in GB
  --glesys-template "Ubuntu 16.04 LTS 64-bit"  Template to use for the machine
  --glesys-platform "VMware"                   Virtualization platform (VMware or KVM)

To create a machine you need to specify a project and an API key:

docker-machine create -d glesys --glesys-project=CL12345 --glesys-api-key=my-api-key example-host

Running pre-create checks...
Creating machine...
(example-host) Waiting for machine to come online...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with ubuntu(systemd)...
Installing Docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine,
run: docker-machine env example-host

Help

If you need any help using this driver feel free to send an email to support@glesys.com.

License

The contents of this repository are distributed under the MIT license, see LICENSE.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDriver

func NewDriver(hostName, storePath string) drivers.Driver

NewDriver creates a new driver

Types

type Driver

type Driver struct {
	*drivers.BaseDriver
	APIKey       string
	Bandwidth    int
	CampaignCode string
	CPU          int
	DataCenter   string
	Memory       int
	Project      string
	RootPassword string
	ServerID     string
	Storage      int
	Template     string
	Platform     string
	UsernameKVM  string
}

Driver for GleSYS

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

func (*Driver) GetCreateFlags

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

GetCreateFlags defines all flags and environment variables that can be used with docker-machine create

func (*Driver) GetSSHHostname

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

GetSSHHostname returns hostname for use with ssh

func (*Driver) GetSSHPort

func (d *Driver) GetSSHPort() (int, error)

GetSSHPort returns port for use with ssh

func (*Driver) GetSSHUsername

func (d *Driver) GetSSHUsername() string

GetSSHUsername returns username for use with ssh

func (*Driver) GetState

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

GetState returns the current state of a machine

func (*Driver) GetURL

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

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

func (*Driver) Kill

func (d *Driver) Kill() error

Kill stops a machine forcefully

func (*Driver) PreCreateCheck

func (d *Driver) PreCreateCheck() error

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

func (*Driver) Remove

func (d *Driver) Remove() error

Remove a machine

func (*Driver) Restart

func (d *Driver) Restart() error

Restart a machine.

func (*Driver) SetConfigFromFlags

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

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

func (*Driver) Start

func (d *Driver) Start() error

Start a machine

func (*Driver) Stop

func (d *Driver) Stop() error

Stop a machine gracefully

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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