lazy

package module
v0.0.0-...-ad1ae8c Latest Latest
Warning

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

Go to latest
Published: May 12, 2017 License: MIT Imports: 12 Imported by: 0

README

LazyKube

Easy deploy kuberentes

Requirement

  • docker
  • openssh-client ( used to generate CA )
  • qemu/KVM ( if deploy with qemu/KVM )
  • libvirt ( if deploy with qemu/KVM )
  • virst-install ( if deploy with qemu/KVM )

How to deploy

Clone this repository and just using deploy and repository's home folder

git clone http://github.com/lyanchih/Lazykube
cd Lazykube
sudo ./scripts/deploy

The deploy script will check and execute few scripts to do deploy job. You can study detail deploy steps at Detail deploy steps

lazy ini options

Arrary's content is seperate by ","

DEFAULT session

+--------------------+--------------------+--------------------+--------------------+--------------------+ | key | value | type | require | description | +--------------------+--------------------+--------------------+--------------------+--------------------+ | domain | example.com | string | * |cluster node's base | | | | | | domain | +--------------------+--------------------+--------------------+--------------------+--------------------+ | version | 1235.9.0 | string | * |coreos image version| +--------------------+--------------------+--------------------+--------------------+--------------------+ | channel | stable | string | * |coreos image channel| | | | | | (stable or dev) | +--------------------+--------------------+--------------------+--------------------+--------------------+ | keys | | []string | * | cluster node's ssh | | | | | | public key | +--------------------+--------------------+--------------------+--------------------+--------------------+ | nodes | | []string | * | cluster node list, | | | | | |this will reference | | | | | | to node session | +--------------------+--------------------+--------------------+--------------------+--------------------+

matchbox

+--------------------+------------------------+--------------------+--------------------+--------------------+ | key | value | type | require | description | +--------------------+------------------------+--------------------+--------------------+--------------------+ | ip | 172.17.0.2 | string | * |matchbox container's| | | | | | IP | +--------------------+------------------------+--------------------+--------------------+--------------------+ | url |http://matchbox.com:8080| string | * | matchbox's url | +--------------------+------------------------+--------------------+--------------------+--------------------+ | domain | matchbox.com | string | * | matchbox's domain | | | | | | name, dns will | | | | | |record this address | | | | | | to IP | +--------------------+------------------------+--------------------+--------------------+--------------------+

network

+--------------------+--------------------+--------------------+--------------------+-----------------------------+ | key | value | type | require | description | +--------------------+--------------------+--------------------+--------------------+-----------------------------+ | gateway | 172.17.0.1 | string | * | Default router IP | +--------------------+--------------------+--------------------+--------------------+-----------------------------+ | ips | | []string | * | Cluster network | | | | | | settings, format: | | | | | |:[<start_ip>[-<end_ip]]| +--------------------+--------------------+--------------------+--------------------+-----------------------------+

vip

+--------------------+--------------------+--------------------+--------------------+--------------------+ | key | value | type | require | description | +--------------------+--------------------+--------------------+--------------------+--------------------+ | enable | true | boolean | * | Enable vip | +--------------------+--------------------+--------------------+--------------------+--------------------+ | vip | 172.17.0.100 | string | * | VIP | +--------------------+--------------------+--------------------+--------------------+--------------------+ | domain | vip.cluster.com | string | | VIP domain | +--------------------+--------------------+--------------------+--------------------+--------------------+

dns

+--------------------+--------------------+--------------------+--------------------+--------------------+ | key | value | type | require | description | +--------------------+--------------------+--------------------+--------------------+--------------------+ | dns | 8.8.8.8 | []string | * | Cluster node's dns | | | | | | servers | +--------------------+--------------------+--------------------+--------------------+--------------------+

nodes

+--------------------+--------------------+--------------------+--------------------+--------------------+ | key | value | type | require | description | +--------------------+--------------------+--------------------+--------------------+--------------------+ | mac | | []string | * | Cluster node's mac | | | | | | address | +--------------------+--------------------+--------------------+--------------------+--------------------+ | role | | string | * |Cluster node's role | +--------------------+--------------------+--------------------+--------------------+--------------------+

contaienr

+--------------------+--------------------+--------------------+--------------------+--------------------+ | key | value | type | require | description | +--------------------+--------------------+--------------------+--------------------+--------------------+ | registries | | []string | | Container insecure | | | | | | registry list | +--------------------+--------------------+--------------------+--------------------+--------------------+

LIMIT

Currently only support deploy coreos

Documentation

Index

Constants

View Source
const DNSMASQ_TMPL = `` /* 976-byte string literal not displayed */
View Source
const K8S_CONTROLLER_TMPL = `` /* 652-byte string literal not displayed */
View Source
const K8S_WORKER_TMPL = `` /* 625-byte string literal not displayed */
View Source
const NODE_TMPL = `` /* 259-byte string literal not displayed */
View Source
const OS_INSTALL_TMPL = `` /* 275-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	InitialCluster     string
	Endpoints          string
	ControllerEndpoint string
	AuthorizedKeys     string
	Registries         []string
	M                  *MatchboxConfig
	*Network
}

type Config

type Config struct {
	*DefaultConfig
	C     *ContainerConfig
	N     *NetworkConfig
	M     *MatchboxConfig
	D     *DNSConfig
	DHCP  *DHCPConfig
	V     *VIPConfig
	Nodes []*Node
	Cls   *Cluster
}

func Load

func Load(file string) (*Config, error)

func (*Config) Generate

func (c *Config) Generate(outputPath string) error

type ContainerConfig

type ContainerConfig struct {
	Registries []string `ini:"registries"`
}

type DHCPConfig

type DHCPConfig struct {
	Enable    bool   `ini:"enable"`
	Interface string `ini:"interface"`
}

type DNSConfig

type DNSConfig struct {
	DNS    []string `ini:"dns"`
	Driver string   `ini:"driver"`
}

type DefaultConfig

type DefaultConfig struct {
	Version    string   `ini:"version"`
	Channel    string   `ini:"channel"`
	DomainBase string   `ini:"domain_base"`
	NodeIDs    []string `ini:"nodes"`
	Keys       []string `ini:"keys"`
}

type MatchboxConfig

type MatchboxConfig struct {
	URL    string `ini:"url"`
	IP     string `ini:"ip"`
	Domain string `ini:"domain"`
}

type Network

type Network struct {
	*NetworkConfig
	// contains filtered or unexported fields
}

func (*Network) ContainIP

func (n *Network) ContainIP(ip string, i int) bool

func (*Network) GetKeepIPRange

func (n *Network) GetKeepIPRange() (ir ipRange, err error)

type NetworkConfig

type NetworkConfig struct {
	Gateway       string   `ini:"gateway"`
	IPs           []string `ini:"ips"`
	DHCP_keep     int      `ini:"dhcp_keep"`
	InterfaceBase string   `ini:"interface_base"`
}

type Node

type Node struct {
	*NodeConfig
	*Cluster
	ID     string
	Domain string
	Nics   NodeInterfaces
	VIP    *NodeInterface
}

type NodeConfig

type NodeConfig struct {
	MAC     []string `ini:"mac"`
	Role    string   `ini:"role"`
	IP      []string `ini:"ip"`
	Profile string   `ini:"profile"`
}

type NodeInterface

type NodeInterface struct {
	MAC       string   `json:"mac"`
	IP        string   `json:"ip"`
	Interface string   `json:"interface"`
	DHCP      bool     `json:"dhcp"`
	Gateway   string   `json:"gateway"`
	DNS       []string `json:"dns"`
}

func (NodeInterface) String

func (nic NodeInterface) String() string

type NodeInterfaces

type NodeInterfaces []NodeInterface

func (NodeInterfaces) String

func (nis NodeInterfaces) String() string

type VIPConfig

type VIPConfig struct {
	Enable bool   `ini:"enable"`
	VIP    string `ini:"vip"`
	Domain string `ini:"domain"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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