Documentation ¶
Index ¶
- Constants
- func BuildCherry(opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, ...) cloudprovider.CloudProvider
- func BuildGenericLabels(nodegroup string, plan *Plan) map[string]string
- func Contains(a []string, x string) bool
- func Find(a []string, x string) int
- type AssignedTo
- type AttachedTo
- type AvailableRegions
- type BGPRoute
- type Bandwidth
- type BlockStorage
- type CloudInitTemplateData
- type ConfigFile
- type ConfigNodepool
- type Cpus
- type CreateServer
- type ErrorResponse
- type HostnameTemplateData
- type IPAddressCreateRequest
- type IPAddresses
- type Memory
- type Nics
- type NodeRef
- type Plan
- type Plans
- type Pricing
- type Project
- type ProjectBGP
- type Raid
- type Region
- type RegionBGP
- type RoutedTo
- type SSHKeys
- type Server
- type ServerBGP
- type Specs
- type Storage
Constants ¶
const ( // ProviderName is the cloud provider name for Cherry Servers ProviderName = "cherryservers" // GPULabel is the label added to nodes with GPU resource. GPULabel = "cherryservers.com/gpu" // DefaultControllerNodeLabelKey is the label added to Master/Controller to identify as // master/controller node. DefaultControllerNodeLabelKey = "node-role.kubernetes.io/master" // ControllerNodeIdentifierEnv is the string for the environment variable. ControllerNodeIdentifierEnv = "CHERRY_CONTROLLER_NODE_IDENTIFIER_LABEL" )
Variables ¶
This section is empty.
Functions ¶
func BuildCherry ¶
func BuildCherry(opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, rl *cloudprovider.ResourceLimiter) cloudprovider.CloudProvider
BuildCherry is called by the autoscaler to build a Cherry Servers cloud provider.
The cherryManager is created here, and the node groups are created based on the specs provided via the command line parameters.
func BuildGenericLabels ¶
BuildGenericLabels builds basic labels for Cherry Servers nodes
Types ¶
type AssignedTo ¶
type AssignedTo struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` Href string `json:"href,omitempty"` Hostname string `json:"hostname,omitempty"` Image string `json:"image,omitempty"` Region Region `json:"region,omitempty"` State string `json:"state,omitempty"` Pricing Pricing `json:"pricing,omitempty"` }
AssignedTo assignment of a network floating IP to a server
type AttachedTo ¶
type AttachedTo struct {
Href string `json:"href"`
}
AttachedTo what a resource is attached to
type AvailableRegions ¶
type AvailableRegions struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` RegionIso2 string `json:"region_iso_2,omitempty"` StockQty int `json:"stock_qty,omitempty"` }
AvailableRegions regions that are available to the user
type BGPRoute ¶
type BGPRoute struct { Subnet string `json:"subnet,omitempty"` Active bool `json:"active,omitempty"` Router string `json:"router,omitempty"` Age string `json:"age,omitempty"` Updated string `json:"updated,omitempty"` }
BGPRoute single server BGP route
type Bandwidth ¶
type Bandwidth struct {
Name string `json:"name,omitempty"`
}
Bandwidth total bandwidth available
type BlockStorage ¶
type BlockStorage struct { ID int `json:"id"` Name string `json:"name"` Href string `json:"href"` Size int `json:"size"` AllowEditSize bool `json:"allow_edit_size"` Unit string `json:"unit"` Description string `json:"description,omitempty"` AttachedTo AttachedTo `json:"attached_to,omitempty"` VlanID string `json:"vlan_id"` VlanIP string `json:"vlan_ip"` Initiator string `json:"initiator"` DiscoveryIP string `json:"discovery_ip"` }
BlockStorage cloud block storage
type CloudInitTemplateData ¶
type CloudInitTemplateData struct { BootstrapTokenID string BootstrapTokenSecret string APIServerEndpoint string NodeGroup string }
CloudInitTemplateData represents the variables that can be used in cloudinit templates
type ConfigFile ¶
type ConfigFile struct { DefaultNodegroupdef ConfigNodepool `gcfg:"global"` Nodegroupdef map[string]*ConfigNodepool `gcfg:"nodegroupdef"` }
ConfigFile is used to read and store information from the cloud configuration file
type ConfigNodepool ¶
type ConfigNodepool struct { ClusterName string `gcfg:"cluster-name"` ProjectID int `gcfg:"project-id"` APIServerEndpoint string `gcfg:"api-server-endpoint"` Region string `gcfg:"region"` Plan string `gcfg:"plan"` OS string `gcfg:"os"` SSHKeys []string `gcfg:"ssh-key-ids"` CloudInit string `gcfg:"cloudinit"` HostnamePattern string `gcfg:"hostname-pattern"` OsPartitionSize int `gcfg:"os-partition-size"` }
ConfigNodepool options only include the project-id for now
func (ConfigNodepool) IsEmpty ¶
func (c ConfigNodepool) IsEmpty() bool
IsEmpty determine if this is an empty config
type Cpus ¶
type Cpus struct { Count int `json:"count,omitempty"` Name string `json:"name,omitempty"` Cores int `json:"cores,omitempty"` Frequency float32 `json:"frequency,omitempty"` Unit string `json:"unit,omitempty"` }
Cpus cpu information for a server
type CreateServer ¶
type CreateServer struct { ProjectID int `json:"project_id,omitempty"` Plan string `json:"plan,omitempty"` Hostname string `json:"hostname,omitempty"` Image string `json:"image,omitempty"` Region string `json:"region,omitempty"` SSHKeys []int `json:"ssh_keys"` IPAddresses []string `json:"ip_addresses"` UserData string `json:"user_data,omitempty"` Tags *map[string]string `json:"tags,omitempty"` SpotInstance int `json:"spot_market,omitempty"` OSPartitionSize int `json:"os_partition_size,omitempty"` }
CreateServer represents a request to create a new Cherry Servers server. Used by createNodes
type ErrorResponse ¶
type ErrorResponse struct { Response *http.Response Errors []string `json:"errors"` SingleError string `json:"error"` }
ErrorResponse is the http response used on errors
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
Error implements the error interface
type HostnameTemplateData ¶
HostnameTemplateData represents the template variables used to construct host names for new nodes
type IPAddressCreateRequest ¶
type IPAddressCreateRequest struct { AddressFamily int `json:"address_family"` Public bool `json:"public"` }
IPAddressCreateRequest represents a request to create a new IP address within a CreateServer request
type IPAddresses ¶
type IPAddresses struct { ID string `json:"id,omitempty"` Address string `json:"address,omitempty"` AddressFamily int `json:"address_family,omitempty"` Cidr string `json:"cidr,omitempty"` Gateway string `json:"gateway,omitempty"` Type string `json:"type,omitempty"` Region Region `json:"region,omitempty"` RoutedTo RoutedTo `json:"routed_to,omitempty"` AssignedTo AssignedTo `json:"assigned_to,omitempty"` TargetedTo AssignedTo `json:"targeted_to,omitempty"` Project Project `json:"project,omitempty"` PtrRecord string `json:"ptr_record,omitempty"` ARecord string `json:"a_record,omitempty"` Tags map[string]string `json:"tags,omitempty"` Href string `json:"href,omitempty"` }
IPAddresses individual IP address
type Memory ¶
type Memory struct { Count int `json:"count,omitempty"` Total int `json:"total,omitempty"` Unit string `json:"unit,omitempty"` Name string `json:"name,omitempty"` }
Memory cpu information for a server
type Nics ¶
type Nics struct {
Name string `json:"name,omitempty"`
}
Nics network interface information for a server
type Plan ¶
type Plan struct { ID int `json:"id,omitempty"` Slug string `json:"slug,omitempty"` Name string `json:"name,omitempty"` Custom bool `json:"custom,omitempty"` Specs Specs `json:"specs,omitempty"` Pricing []Pricing `json:"pricing,omitempty"` AvailableRegions []AvailableRegions `json:"available_regions,omitempty"` }
Plan a server plan
type Pricing ¶
type Pricing struct { Price float32 `json:"price,omitempty"` Taxed bool `json:"taxed,omitempty"` Currency string `json:"currency,omitempty"` Unit string `json:"unit,omitempty"` }
Pricing price for a specific plan
type Project ¶
type Project struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` Bgp ProjectBGP `json:"bgp,omitempty"` Href string `json:"href,omitempty"` }
Project a CherryServers project
type ProjectBGP ¶
type ProjectBGP struct { Enabled bool `json:"enabled,omitempty"` LocalASN int `json:"local_asn,omitempty"` }
ProjectBGP information about BGP on an individual project
type Raid ¶
type Raid struct {
Name string `json:"name,omitempty"`
}
Raid raid for block storage on a server
type Region ¶
type Region struct { ID int `json:"id,omitempty"` Slug string `json:"slug,omitempty"` Name string `json:"name,omitempty"` RegionIso2 string `json:"region_iso_2,omitempty"` BGP RegionBGP `json:"bgp,omitempty"` Href string `json:"href,omitempty"` }
Region a CherryServers region
type RoutedTo ¶
type RoutedTo struct { ID string `json:"id,omitempty"` Address string `json:"address,omitempty"` AddressFamily int `json:"address_family,omitempty"` Cidr string `json:"cidr,omitempty"` Gateway string `json:"gateway,omitempty"` Type string `json:"type,omitempty"` Region Region `json:"region,omitempty"` }
RoutedTo routing of a floating IP to an underlying IP
type SSHKeys ¶
type SSHKeys struct { ID int `json:"id,omitempty"` Label string `json:"label,omitempty"` Key string `json:"key,omitempty"` Fingerprint string `json:"fingerprint,omitempty"` Updated string `json:"updated,omitempty"` Created string `json:"created,omitempty"` Href string `json:"href,omitempty"` }
SSHKeys an ssh key
type Server ¶
type Server struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` Href string `json:"href,omitempty"` Hostname string `json:"hostname,omitempty"` Image string `json:"image,omitempty"` SpotInstance bool `json:"spot_instance"` BGP ServerBGP `json:"bgp,omitempty"` Project Project `json:"project,omitempty"` Region Region `json:"region,omitempty"` State string `json:"state,omitempty"` Plan Plan `json:"plan,omitempty"` AvailableRegions AvailableRegions `json:"availableregions,omitempty"` Pricing Pricing `json:"pricing,omitempty"` IPAddresses []IPAddresses `json:"ip_addresses,omitempty"` SSHKeys []SSHKeys `json:"ssh_keys,omitempty"` Tags map[string]string `json:"tags,omitempty"` Storage BlockStorage `json:"storage,omitempty"` Created string `json:"created_at,omitempty"` TerminationDate string `json:"termination_date,omitempty"` }
Server represents a Cherry Servers server
type ServerBGP ¶
type ServerBGP struct { Enabled bool `json:"enabled"` Available bool `json:"available,omitempty"` Status string `json:"status,omitempty"` Routers int `json:"routers,omitempty"` Connected int `json:"connected,omitempty"` Limit int `json:"limit,omitempty"` Active int `json:"active,omitempty"` Routes []BGPRoute `json:"routes,omitempty"` Updated string `json:"updated,omitempty"` }
ServerBGP status of BGP on a server
type Specs ¶
type Specs struct { Cpus Cpus `json:"cpus,omitempty"` Memory Memory `json:"memory,omitempty"` Storage []Storage `json:"storage,omitempty"` Raid Raid `json:"raid,omitempty"` Nics Nics `json:"nics,omitempty"` Bandwidth Bandwidth `json:"bandwidth,omitempty"` }
Specs aggregated specs for a server