Documentation ¶
Index ¶
- func BuildKamatera(opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, ...) cloudprovider.CloudProvider
- type GcfgGlobalConfig
- type GcfgNodeGroupConfig
- type Instance
- type KamateraApiClientRest
- func (c *KamateraApiClientRest) CreateServers(ctx context.Context, count int, config ServerConfig) ([]Server, error)
- func (c *KamateraApiClientRest) DeleteServer(ctx context.Context, name string) error
- func (c *KamateraApiClientRest) ListServers(ctx context.Context, instances map[string]*Instance) ([]Server, error)
- type KamateraServerCreatePostRequest
- type KamateraServerPostRequest
- type KamateraServerTerminatePostRequest
- type NodeGroup
- func (n *NodeGroup) AtomicIncreaseSize(delta int) error
- func (n *NodeGroup) Autoprovisioned() bool
- func (n *NodeGroup) Create() (cloudprovider.NodeGroup, error)
- func (n *NodeGroup) Debug() string
- func (n *NodeGroup) DecreaseTargetSize(delta int) error
- func (n *NodeGroup) Delete() error
- func (n *NodeGroup) DeleteNodes(nodes []*apiv1.Node) error
- func (n *NodeGroup) Exist() bool
- func (n *NodeGroup) ForceDeleteNodes(nodes []*apiv1.Node) error
- func (n *NodeGroup) GetOptions(defaults config.NodeGroupAutoscalingOptions) (*config.NodeGroupAutoscalingOptions, error)
- func (n *NodeGroup) Id() string
- func (n *NodeGroup) IncreaseSize(delta int) error
- func (n *NodeGroup) MaxSize() int
- func (n *NodeGroup) MinSize() int
- func (n *NodeGroup) Nodes() ([]cloudprovider.Instance, error)
- func (n *NodeGroup) TargetSize() (int, error)
- func (n *NodeGroup) TemplateNodeInfo() (*framework.NodeInfo, error)
- type ProviderConfig
- type Server
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildKamatera ¶
func BuildKamatera( opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, rl *cloudprovider.ResourceLimiter, ) cloudprovider.CloudProvider
BuildKamatera builds the Kamatera cloud provider.
Types ¶
type GcfgGlobalConfig ¶
type GcfgGlobalConfig struct { KamateraApiClientId string `gcfg:"kamatera-api-client-id"` KamateraApiSecret string `gcfg:"kamatera-api-secret"` KamateraApiUrl string `gcfg:"kamatera-api-url"` ClusterName string `gcfg:"cluster-name"` DefaultMinSize string `gcfg:"default-min-size"` DefaultMaxSize string `gcfg:"default-max-size"` DefaultNamePrefix string `gcfg:"default-name-prefix"` DefaultPassword string `gcfg:"default-password"` DefaultSshKey string `gcfg:"default-ssh-key"` DefaultDatacenter string `gcfg:"default-datacenter"` DefaultImage string `gcfg:"default-image"` DefaultCpu string `gcfg:"default-cpu"` DefaultRam string `gcfg:"default-ram"` DefaultDisks []string `gcfg:"default-disk"` DefaultDailybackup bool `gcfg:"default-dailybackup"` DefaultManaged bool `gcfg:"default-managed"` DefaultNetworks []string `gcfg:"default-network"` DefaultBillingCycle string `gcfg:"default-billingcycle"` DefaultMonthlyPackage string `gcfg:"default-monthlypackage"` DefaultScriptBase64 string `gcfg:"default-script-base64"` }
GcfgGlobalConfig is the gcfg representation of the global section in the cloud config file for Kamatera.
type GcfgNodeGroupConfig ¶
type GcfgNodeGroupConfig struct { MinSize string `gcfg:"min-size"` MaxSize string `gcfg:"max-size"` NamePrefix string `gcfg:"name-prefix"` Password string `gcfg:"password"` SshKey string `gcfg:"ssh-key"` Datacenter string `gcfg:"datacenter"` Image string `gcfg:"image"` Cpu string `gcfg:"cpu"` Ram string `gcfg:"ram"` Disks []string `gcfg:"disk"` Dailybackup bool `gcfg:"dailybackup"` Managed bool `gcfg:"managed"` Networks []string `gcfg:"network"` BillingCycle string `gcfg:"billingcycle"` MonthlyPackage string `gcfg:"monthlypackage"` ScriptBase64 string `gcfg:"script-base64"` }
GcfgNodeGroupConfig is the gcfg representation of the section in the cloud config file to change defaults for a node group.
type Instance ¶
type Instance struct { // Id is the Kamatera server Name. Id string // Status represents status of the node. (Optional) Status *cloudprovider.InstanceStatus // Kamatera specific fields PowerOn bool Tags []string }
Instance implements cloudprovider.Instance interface. Instance contains configuration info and functions to control a single Kamatera server instance.
type KamateraApiClientRest ¶
type KamateraApiClientRest struct {
// contains filtered or unexported fields
}
KamateraApiClientRest is the struct to perform API calls
func NewKamateraApiClientRest ¶
func NewKamateraApiClientRest(clientId string, secret string, url string) (client KamateraApiClientRest)
NewKamateraApiClientRest factory to create new Rest API Client struct
func (*KamateraApiClientRest) CreateServers ¶
func (c *KamateraApiClientRest) CreateServers(ctx context.Context, count int, config ServerConfig) ([]Server, error)
CreateServers creates new servers according to the given configuration
func (*KamateraApiClientRest) DeleteServer ¶
func (c *KamateraApiClientRest) DeleteServer(ctx context.Context, name string) error
DeleteServer deletes a server according to the given name
func (*KamateraApiClientRest) ListServers ¶
func (c *KamateraApiClientRest) ListServers(ctx context.Context, instances map[string]*Instance) ([]Server, error)
ListServers returns a list of all servers in the relevant account and fetches their tags
type KamateraServerCreatePostRequest ¶
type KamateraServerCreatePostRequest struct { Name string `json:"name"` Password string `json:"password"` PasswordValidate string `json:"passwordValidate"` SshKey string `json:"ssh-key"` Datacenter string `json:"datacenter"` Image string `json:"image"` Cpu string `json:"cpu"` Ram string `json:"ram"` Disk string `json:"disk"` Dailybackup string `json:"dailybackup"` Managed string `json:"managed"` Network string `json:"network"` Quantity int `json:"quantity"` BillingCycle string `json:"billingCycle"` MonthlyPackage string `json:"monthlypackage"` Poweronaftercreate string `json:"poweronaftercreate"` ScriptFile string `json:"script-file"` UserdataFile string `json:"userdata-file"` Tag string `json:"tag"` }
KamateraServerCreatePostRequest struct for Kamatera server create post request
type KamateraServerPostRequest ¶
type KamateraServerPostRequest struct {
ServerName string `json:"name"`
}
KamateraServerPostRequest struct for Kamatera server post request
type KamateraServerTerminatePostRequest ¶
type KamateraServerTerminatePostRequest struct { ServerName string `json:"name"` Force bool `json:"force"` }
KamateraServerTerminatePostRequest struct for Kamatera server terminate post request
type NodeGroup ¶
type NodeGroup struct {
// contains filtered or unexported fields
}
NodeGroup implements cloudprovider.NodeGroup interface. NodeGroup contains configuration info and functions to control a set of nodes that have the same capacity and set of labels.
func (*NodeGroup) AtomicIncreaseSize ¶
AtomicIncreaseSize is not implemented.
func (*NodeGroup) Autoprovisioned ¶
Autoprovisioned returns true if the node group is autoprovisioned. An autoprovisioned group was created by CA and can be deleted when scaled to 0.
func (*NodeGroup) Create ¶
func (n *NodeGroup) Create() (cloudprovider.NodeGroup, error)
Create creates the node group on the cloud provider side. Implementation optional.
func (*NodeGroup) Debug ¶
Debug returns a string containing all information regarding this node group.
func (*NodeGroup) DecreaseTargetSize ¶
DecreaseTargetSize decreases the target size of the node group. This function doesn't permit to delete any existing node and can be used only to reduce the request for new nodes that have not been yet fulfilled. Delta should be negative. It is assumed that cloud provider will not delete the existing nodes when there is an option to just decrease the target. Implementation required.
func (*NodeGroup) Delete ¶
Delete deletes the node group on the cloud provider side. This will be executed only for autoprovisioned node groups, once their size drops to 0. Implementation optional.
func (*NodeGroup) DeleteNodes ¶
DeleteNodes deletes nodes from this node group. Error is returned either on failure or if the given node doesn't belong to this node group. This function should wait until node group size is updated. Implementation required.
func (*NodeGroup) Exist ¶
Exist checks if the node group really exists on the cloud provider side. Allows to tell the theoretical node group from the real one. Implementation required.
func (*NodeGroup) ForceDeleteNodes ¶
ForceDeleteNodes deletes nodes from the group regardless of constraints.
func (*NodeGroup) GetOptions ¶
func (n *NodeGroup) GetOptions(defaults config.NodeGroupAutoscalingOptions) (*config.NodeGroupAutoscalingOptions, error)
GetOptions returns NodeGroupAutoscalingOptions that should be used for this particular NodeGroup. Returning a nil will result in using default options. Implementation optional.
func (*NodeGroup) IncreaseSize ¶
IncreaseSize increases the size of the node group. To delete a node you need to explicitly name it and use DeleteNode. This function should wait until node group size is updated. Implementation required.
func (*NodeGroup) Nodes ¶
func (n *NodeGroup) Nodes() ([]cloudprovider.Instance, error)
Nodes returns a list of all nodes that belong to this node group. It is required that Instance objects returned by this method have Id field set. Other fields are optional. This list should include also instances that might have not become a kubernetes node yet.
func (*NodeGroup) TargetSize ¶
TargetSize returns the current target size of the node group. It is possible that the number of nodes in Kubernetes is different at the moment but should be equal to Size() once everything stabilizes (new nodes finish startup and registration or removed nodes are deleted completely). Implementation required.
func (*NodeGroup) TemplateNodeInfo ¶
TemplateNodeInfo returns a framework.NodeInfo structure of an empty (as if just started) node. This will be used in scale-up simulations to predict what would a new node look like if a node group was expanded. The returned NodeInfo is expected to have a fully populated Node object, with all of the labels, capacity and allocatable information as well as all pods that are started on the node by default, using manifest (most likely only kube-proxy). Implementation optional.
type ProviderConfig ¶
ProviderConfig is the configuration for the Kamatera cloud provider
type Server ¶
Server contains information about a Kamatera server, as fetched from the API It is used by the manager to keep track of the servers in the cluster.
type ServerConfig ¶
type ServerConfig struct { NamePrefix string Password string SshKey string Datacenter string Image string Cpu string Ram string Disks []string Dailybackup bool Managed bool Networks []string BillingCycle string MonthlyPackage string ScriptFile string UserdataFile string Tags []string }
ServerConfig struct for Kamatera server config