Documentation ¶
Index ¶
- Constants
- type Addons
- type CIDRv4
- type Cluster
- type Config
- type Connection
- type ConnectionSSH
- type ConnectionType
- type CpuMode
- type DataDisk
- type DataResourcePool
- type DnsMode
- type File
- type GB
- type Host
- type IP
- type IPv4
- type Instance
- type Kubernetes
- type KubernetesVersion
- type Kubitect
- type LB
- type LBDefault
- type LBInstance
- type LBPortForward
- type LBPortForwardTarget
- type Labels
- type MAC
- type Master
- type MasterDefault
- type MasterInstance
- type MasterVersion
- type Network
- type NetworkBridge
- type NetworkMode
- type NetworkPlugin
- type NodeTemplate
- type NodeTemplateSSH
- type Nodes
- type OS
- type OSDistro
- type OSNetworkInterface
- type OSSource
- type Other
- type Port
- type Rook
- type Taint
- type URL
- type Uint8
- type User
- type VCpu
- type Version
- type Worker
- type WorkerDefault
- type WorkerInstance
Constants ¶
View Source
const ( IP_IN_CIDR = "ipInCidr" LB_REQUIRED = "lbRequired" VALID_HOST = "validHost" VALID_POOL = "validPool" )
Keys of custom validators
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Addons ¶
type Cluster ¶
type Cluster struct { Name string `yaml:"name"` Network Network `yaml:"network"` NodeTemplate NodeTemplate `yaml:"nodeTemplate"` Nodes Nodes `yaml:"nodes"` }
type Config ¶
type Config struct { Hosts []Host `yaml:"hosts"` Cluster Cluster `yaml:"cluster"` Kubernetes Kubernetes `yaml:"kubernetes"` Addons Addons `yaml:"addons,omitempty"` Kubitect Kubitect `yaml:"kubitect,omitempty"` }
func MockConfig ¶
func (*Config) SetDefaults ¶
func (c *Config) SetDefaults()
type Connection ¶
type Connection struct { User User `yaml:"user,omitempty"` IP IPv4 `yaml:"ip,omitempty"` Type ConnectionType `yaml:"type"` SSH ConnectionSSH `yaml:"ssh,omitempty"` }
func (Connection) Validate ¶
func (c Connection) Validate() error
type ConnectionSSH ¶
type ConnectionSSH struct { Keyfile File `yaml:"keyfile,omitempty"` Port Port `yaml:"port,omitempty"` Verify bool `yaml:"verify,omitempty"` }
func (*ConnectionSSH) SetDefaults ¶
func (s *ConnectionSSH) SetDefaults()
func (ConnectionSSH) Validate ¶
func (s ConnectionSSH) Validate() error
type ConnectionType ¶
type ConnectionType string
const ( LOCAL ConnectionType = "local" LOCALHOST ConnectionType = "localhost" // equivalent to local REMOTE ConnectionType = "remote" )
func (ConnectionType) Validate ¶
func (t ConnectionType) Validate() error
type DataDisk ¶
type DataResourcePool ¶
func (*DataResourcePool) SetDefaults ¶
func (rp *DataResourcePool) SetDefaults()
func (DataResourcePool) Validate ¶
func (rp DataResourcePool) Validate() error
type Host ¶
type Host struct { Name string `yaml:"name" opt:",id"` Default bool `yaml:"default"` Connection Connection `yaml:"connection,omitempty"` MainResourcePoolPath string `yaml:"mainResourcePoolPath"` DataResourcePools []DataResourcePool `yaml:"dataResourcePools,omitempty"` }
func (*Host) SetDefaults ¶
func (h *Host) SetDefaults()
type Kubernetes ¶
type Kubernetes struct { Version KubernetesVersion `yaml:"version"` DnsMode DnsMode `yaml:"dnsMode"` NetworkPlugin NetworkPlugin `yaml:"networkPlugin"` Other Other `yaml:"other"` }
func (*Kubernetes) SetDefaults ¶
func (k *Kubernetes) SetDefaults()
func (Kubernetes) Validate ¶
func (k Kubernetes) Validate() error
type KubernetesVersion ¶
type KubernetesVersion string
func (KubernetesVersion) Validate ¶
func (ver KubernetesVersion) Validate() error
type Kubitect ¶
type Kubitect struct { Url URL `yaml:"url,omitempty"` Version MasterVersion `yaml:"version,omitempty"` }
type LB ¶
type LB struct { VIP IPv4 `yaml:"vip,omitempty"` VirtualRouterId *Uint8 `yaml:"virtualRouterId,omitempty"` Default LBDefault `yaml:"default"` Instances []LBInstance `yaml:"instances,omitempty"` ForwardPorts []LBPortForward `yaml:"forwardPorts,omitempty"` }
func (*LB) SetDefaults ¶
func (lb *LB) SetDefaults()
type LBDefault ¶
type LBDefault struct { CPU VCpu `yaml:"cpu"` RAM GB `yaml:"ram"` MainDiskSize GB `yaml:"mainDiskSize"` }
func (*LBDefault) SetDefaults ¶
func (def *LBDefault) SetDefaults()
type LBInstance ¶
type LBInstance struct { Name string `yaml:"name,omitempty" opt:"-"` Id string `yaml:"id" opt:",id"` Host string `yaml:"host,omitempty"` IP IPv4 `yaml:"ip,omitempty"` MAC MAC `yaml:"mac,omitempty"` CPU VCpu `yaml:"cpu"` RAM GB `yaml:"ram"` MainDiskSize GB `yaml:"mainDiskSize"` Priority *Uint8 `yaml:"priority,omitempty"` }
func (LBInstance) GetID ¶
func (i LBInstance) GetID() string
func (LBInstance) GetIP ¶
func (i LBInstance) GetIP() IPv4
func (LBInstance) GetMAC ¶
func (i LBInstance) GetMAC() MAC
func (LBInstance) GetTypeName ¶
func (i LBInstance) GetTypeName() string
func (LBInstance) Validate ¶
func (i LBInstance) Validate() error
type LBPortForward ¶
type LBPortForward struct { Name string `yaml:"name"` Port Port `yaml:"port"` TargetPort Port `yaml:"targetPort,omitempty"` Target LBPortForwardTarget `yaml:"target"` }
func (*LBPortForward) SetDefaults ¶
func (pf *LBPortForward) SetDefaults()
func (LBPortForward) Validate ¶
func (pf LBPortForward) Validate() error
type LBPortForwardTarget ¶
type LBPortForwardTarget string
const ( WORKERS LBPortForwardTarget = "workers" MASTERS LBPortForwardTarget = "masters" ALL LBPortForwardTarget = "all" )
func (LBPortForwardTarget) Validate ¶
func (pft LBPortForwardTarget) Validate() error
type Master ¶
type Master struct { Default MasterDefault `yaml:"default"` Instances []MasterInstance `yaml:"instances"` }
func (*Master) SetDefaults ¶
func (m *Master) SetDefaults()
type MasterDefault ¶
type MasterDefault struct { CPU VCpu `yaml:"cpu"` RAM GB `yaml:"ram"` MainDiskSize GB `yaml:"mainDiskSize"` Labels Labels `yaml:"labels,omitempty"` Taints []Taint `yaml:"taints,omitempty"` DataDisks []DataDisk `yaml:"dataDisks,omitempty"` }
func (*MasterDefault) SetDefaults ¶
func (def *MasterDefault) SetDefaults()
func (MasterDefault) Validate ¶
func (d MasterDefault) Validate() error
type MasterInstance ¶
type MasterInstance struct { Name string `yaml:"name,omitempty" opt:"-"` Id string `yaml:"id" opt:",id"` Host string `yaml:"host,omitempty"` IP IPv4 `yaml:"ip,omitempty"` MAC MAC `yaml:"mac,omitempty"` CPU VCpu `yaml:"cpu"` RAM GB `yaml:"ram"` MainDiskSize GB `yaml:"mainDiskSize"` DataDisks []DataDisk `yaml:"dataDisks,omitempty"` Labels Labels `yaml:"labels,omitempty"` Taints []Taint `yaml:"taints,omitempty"` }
func (MasterInstance) GetID ¶
func (i MasterInstance) GetID() string
func (MasterInstance) GetIP ¶
func (i MasterInstance) GetIP() IPv4
func (MasterInstance) GetMAC ¶
func (i MasterInstance) GetMAC() MAC
func (MasterInstance) GetTypeName ¶
func (i MasterInstance) GetTypeName() string
func (MasterInstance) Validate ¶
func (i MasterInstance) Validate() error
type MasterVersion ¶
type MasterVersion string
func (MasterVersion) Validate ¶
func (ver MasterVersion) Validate() error
type Network ¶
type Network struct { CIDR CIDRv4 `yaml:"cidr"` Gateway *IPv4 `yaml:"gateway,omitempty"` Mode NetworkMode `yaml:"mode"` Bridge NetworkBridge `yaml:"bridge,omitempty"` }
func (*Network) SetDefaults ¶
func (n *Network) SetDefaults()
type NetworkBridge ¶
type NetworkBridge string
func (NetworkBridge) Validate ¶
func (br NetworkBridge) Validate() error
type NetworkMode ¶
type NetworkMode string
const ( NAT NetworkMode = "nat" ROUTE NetworkMode = "route" BRIDGE NetworkMode = "bridge" )
func (NetworkMode) Validate ¶
func (mode NetworkMode) Validate() error
type NetworkPlugin ¶
type NetworkPlugin string
const ( CALICO NetworkPlugin = "calico" CILIUM NetworkPlugin = "cilium" CANAL NetworkPlugin = "canal" FLANNEL NetworkPlugin = "flannel" WEAVE NetworkPlugin = "weave" KUBE_ROUTER NetworkPlugin = "kube-router" )
func (NetworkPlugin) Validate ¶
func (p NetworkPlugin) Validate() error
type NodeTemplate ¶
type NodeTemplate struct { User User `yaml:"user"` OS OS `yaml:"os"` SSH NodeTemplateSSH `yaml:"ssh,omitempty"` CpuMode CpuMode `yaml:"cpuMode,omitempty"` DNS []IP `yaml:"dns,omitempty"` UpdateOnBoot bool `yaml:"updateOnBoot"` }
func (*NodeTemplate) SetDefaults ¶
func (n *NodeTemplate) SetDefaults()
func (NodeTemplate) Validate ¶
func (n NodeTemplate) Validate() error
type NodeTemplateSSH ¶
type NodeTemplateSSH struct { AddToKnownHosts bool `yaml:"addToKnownHosts"` PrivateKeyPath File `yaml:"privateKeyPath"` }
func (*NodeTemplateSSH) SetDefaults ¶
func (ssh *NodeTemplateSSH) SetDefaults()
func (NodeTemplateSSH) Validate ¶
func (ssh NodeTemplateSSH) Validate() error
type Nodes ¶
type OS ¶
type OS struct { Distro OSDistro `yaml:"distro"` NetworkInterface OSNetworkInterface `yaml:"networkInterface"` Source OSSource `yaml:"source"` }
func (*OS) SetDefaults ¶
func (s *OS) SetDefaults()
type OSNetworkInterface ¶
type OSNetworkInterface string
func (OSNetworkInterface) Validate ¶
func (nic OSNetworkInterface) Validate() error
type Rook ¶
type Uint8 ¶
type Uint8 int
Uint8 is intentionally set to int to avoid panic if value is set outside the uint8 size.
For example, if LB priority is set to -1, raising a custom error is not possible since go will panic when converting -1 to uint8.
type Worker ¶
type Worker struct { Default WorkerDefault `yaml:"default"` Instances []WorkerInstance `yaml:"instances,omitempty"` }
func (*Worker) SetDefaults ¶
func (w *Worker) SetDefaults()
type WorkerDefault ¶
type WorkerDefault struct { CPU VCpu `yaml:"cpu"` RAM GB `yaml:"ram"` MainDiskSize GB `yaml:"mainDiskSize"` Labels Labels `yaml:"labels,omitempty"` Taints []Taint `yaml:"taints,omitempty"` DataDisks []DataDisk `yaml:"dataDisks,omitempty"` }
func (*WorkerDefault) SetDefaults ¶
func (def *WorkerDefault) SetDefaults()
func (WorkerDefault) Validate ¶
func (d WorkerDefault) Validate() error
type WorkerInstance ¶
type WorkerInstance struct { Name string `yaml:"name,omitempty" opt:"-"` Id string `yaml:"id" opt:",id"` Host string `yaml:"host,omitempty"` IP IPv4 `yaml:"ip,omitempty"` MAC MAC `yaml:"mac,omitempty"` CPU VCpu `yaml:"cpu"` RAM GB `yaml:"ram"` MainDiskSize GB `yaml:"mainDiskSize"` DataDisks []DataDisk `yaml:"dataDisks,omitempty"` Labels Labels `yaml:"labels,omitempty"` Taints []Taint `yaml:"taints,omitempty"` }
func (WorkerInstance) GetID ¶
func (i WorkerInstance) GetID() string
func (WorkerInstance) GetIP ¶
func (i WorkerInstance) GetIP() IPv4
func (WorkerInstance) GetMAC ¶
func (i WorkerInstance) GetMAC() MAC
func (WorkerInstance) GetTypeName ¶
func (i WorkerInstance) GetTypeName() string
func (WorkerInstance) Validate ¶
func (i WorkerInstance) Validate() error
Click to show internal directories.
Click to hide internal directories.