p2pubmachine

package module
v0.0.0-...-3dcf0e2 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2017 License: Apache-2.0 Imports: 17 Imported by: 0

README

Docker Machine driver for IIJ GIO P2PUB

This is the P2PUB driver plugin for docker-machine. It allows you to automate provisioning of Docker hosts on IIJ GIO P2PUB cloud.

日本語

Requirements

  • Docker Machine 0.8+ (included in Docker Toolbox)

Installation

Build from Source
  • go get -d -u github.com/iij/docker-machine-driver-p2pub
  • go build -o /usr/local/bin/docker-machine-driver-p2pub github.com/iij/docker-machine-driver-p2pub/bin
Windows
  • Download release
    • docker-machine-driver-p2pub-windows-amd64.exe
  • copy executable to the same folder as docker-machine.exe
Linux, OS X
  • Download release
    • docker-machine-driver-p2pub-linux-amd64 (Linux)
    • docker-machine-driver-p2pub-darwin-amd64 (OS X)
  • install -c -m 755 docker-machine-driver-p2pub-linux-amd64 /usr/local/bin/docker-machine-driver-p2pub

Usage

[local]# export IIJAPI_ACCESS_KEY=<your access key>
[local]# export IIJAPI_SECRET_KEY=<your secret key>
[local]# export GISSERVICECODE=<your gis service code>
[local]# docker-machine create -d p2pub p2machine
  :

Options

Option EnvVar Default description
--p2pub-access-key IIJAPI_ACCESS_KEY API Access Key(required)
--p2pub-secret-key IIJAPI_SECRET_KEY API Secret Key(required)
--p2pub-gis GISSERVICECODE P2(GIS) Service Code(required)
--p2pub-server-type VB0-1 Grade of Virtual Machine -> 仮想サーバ品目
--p2pub-server-group Server Group (A or B)
--p2pub-system-storage S30GB_UBUNTU14_64 Type of System Storage(Operating System) -> ストレージ品目
--p2pub-data-storage Grade of Additional Storage -> ストレージ品目
--p2pub-storage-group Storage Group (Y or Z)
--p2pub-docker-port 2376 Port Number of Docker daemon
--p2pub-iba IBASERVICECODE System Storage Service Code. add new if not specified
--p2pub-ibb IBBSERVICECODE Data Storage Service Code
--p2pub-ivm IVMSERVICECODE Virtual Machine Service Code. add new if not specified
--p2pub-private-only don't attach global IP and set up DNS/Gateway for private network
--p2pub-custom-image Create boot device from storage archive. specify in the form of iar service code,image id
--p2pub-extra-ports Open some extra ports. specify in the form of portnum/protocol(tcp,udp)
--p2pub-reply-any-arp Set kernel parameters to reply any ARP requests.
create Swarm cluster

Build Cluster

[local]# export IIJAPI_ACCESS_KEY=<your access key>
[local]# export IIJAPI_SECRET_KEY=<your secret key>
[local]# export GISSERVICECODE=<your gis service code>
[local]# docker pull swarm
[local]# token=$(docker run --rm swarm create)
[local]# docker-machine create -d p2pub --swarm --master --swarm-discovery token://$token swarm-mng
  :
[local]# docker-machine create -d p2pub --swarm --swarm-discovery token://$tokne swarm-node01
  :
[local]# docker-machine create -d p2pub --swarm --swarm-discovery token://$tokne swarm-node02
  :

Use Cluster

[local]# docker $(docker-machine config --swarm swarm-mng) version
[local]# docker $(docker-machine config --swarm swarm-mng) info
[local]# docker $(docker-machine config --swarm swarm-mng) ps
[local]# docker $(docker-machine config --swarm swarm-mng) pull alpine
[local]# docker $(docker-machine config --swarm swarm-mng) run alpine date

Author

  • Takashi WATANABE (@wtnb75)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct {
	*drivers.BaseDriver
	GisServiceCode string
	AccessKey      string
	SecretKey      string
	IvmServiceCode string
	IbaServiceCode string
	IPv4           string
	IPv6           string
	DockerPort     int
	ServerType     string
	ImageName      string
	StorageGroup   string
	ServerGroup    string
	IbbServiceCode string
	// contains filtered or unexported fields
}

Driver for P2PUB

func NewDriver

func NewDriver(hostName, storePath string) *Driver

NewDriver is constructor

func (*Driver) Create

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

Create machine

func (*Driver) DriverName

func (d *Driver) DriverName() string

DriverName returns name of driver(p2pub)

func (*Driver) GetCreateFlags

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

GetCreateFlags defines option for docker-machine command

func (*Driver) GetSSHHostname

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

GetSSHHostname returns IP address of machine

func (*Driver) GetState

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

GetState returns state of machine

func (*Driver) GetURL

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

GetURL returns URL for DOCKER_HOST

func (*Driver) Kill

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

Kill machine

func (*Driver) PreCreateCheck

func (d *Driver) PreCreateCheck() error

PreCreateCheck checks required options

func (*Driver) Remove

func (d *Driver) Remove() error

Remove machine

func (*Driver) Restart

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

Restart machine

func (*Driver) SetConfigFromFlags

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

SetConfigFromFlags set option to driver structure

func (*Driver) Start

func (d *Driver) Start() error

Start machine

func (*Driver) Stop

func (d *Driver) Stop() error

Stop machine

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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