Documentation ¶
Index ¶
- Constants
- Variables
- func BuildCloudProvider(opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, ...) cloudprovider.CloudProvider
- func BuildGenericLabels(nodegroup string, instanceType string) map[string]string
- func Contains(a []string, x string) bool
- func Find(a []string, x string) int
- type CloudInitTemplateData
- type ConfigFile
- type ConfigNodepool
- type Device
- type DeviceCreateRequest
- type Devices
- type ErrorResponse
- type HostnameTemplateData
- type IPAddressCreateRequest
- type NodeRef
- type Price
Constants ¶
const ( // GPULabel is the label added to nodes with GPU resource. GPULabel = "cloud.google.com/gke-accelerator" // 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. // Deprecated: This env var is deprecated in the favour packet's acquisition to equinix. // Please use 'ControllerNodeIdentifierMetalEnv' ControllerNodeIdentifierEnv = "PACKET_CONTROLLER_NODE_IDENTIFIER_LABEL" // ControllerNodeIdentifierMetalEnv is the string for the environment variable of controller node id labels for equinix metal. ControllerNodeIdentifierMetalEnv = "METAL_CONTROLLER_NODE_IDENTIFIER_LABEL" )
Variables ¶
var InstanceTypes = map[string]*instanceType{
"a3.large.x86": {
InstanceName: "a3.large.x86",
CPU: 64,
MemoryMb: 1048576,
GPU: 0,
},
"c2.medium.x86": {
InstanceName: "c2.medium.x86",
CPU: 24,
MemoryMb: 65536,
GPU: 0,
},
"c3.large.arm64": {
InstanceName: "c3.large.arm64",
CPU: 80,
MemoryMb: 262144,
GPU: 0,
},
"c3.medium.x86": {
InstanceName: "c3.medium.x86",
CPU: 24,
MemoryMb: 65536,
GPU: 0,
},
"c3.small.x86": {
InstanceName: "c3.small.x86",
CPU: 8,
MemoryMb: 32768,
GPU: 0,
},
"g2.large.x86": {
InstanceName: "g2.large.x86",
CPU: 24,
MemoryMb: 196608,
GPU: 1,
},
"m2.xlarge.x86": {
InstanceName: "m2.xlarge.x86",
CPU: 28,
MemoryMb: 393216,
GPU: 0,
},
"m3.large.x86": {
InstanceName: "m3.large.x86",
CPU: 32,
MemoryMb: 262144,
GPU: 0,
},
"m3.small.x86": {
InstanceName: "m3.small.x86",
CPU: 8,
MemoryMb: 65536,
GPU: 0,
},
"n2.xlarge.x86": {
InstanceName: "n2.xlarge.x86",
CPU: 28,
MemoryMb: 393216,
GPU: 0,
},
"n3.xlarge.x86": {
InstanceName: "n3.xlarge.x86",
CPU: 32,
MemoryMb: 524288,
GPU: 0,
},
"s3.xlarge.x86": {
InstanceName: "s3.xlarge.x86",
CPU: 24,
MemoryMb: 196608,
GPU: 0,
},
"t3.small.x86": {
InstanceName: "t3.small.x86",
CPU: 4,
MemoryMb: 16384,
GPU: 0,
},
"x2.xlarge.x86": {
InstanceName: "x2.xlarge.x86",
CPU: 28,
MemoryMb: 393216,
GPU: 1,
},
}
InstanceTypes is a map of equinix metal resources
Functions ¶
func BuildCloudProvider ¶
func BuildCloudProvider(opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, rl *cloudprovider.ResourceLimiter) cloudprovider.CloudProvider
BuildCloudProvider is called by the autoscaler to build an Equinix Metal cloud provider.
The equinixMetalManager 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 equinix metal nodes
Types ¶
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 string `gcfg:"project-id"` APIServerEndpoint string `gcfg:"api-server-endpoint"` Metro string `gcfg:"metro"` Plan string `gcfg:"plan"` OS string `gcfg:"os"` Billing string `gcfg:"billing"` CloudInit string `gcfg:"cloudinit"` Reservation string `gcfg:"reservation"` HostnamePattern string `gcfg:"hostname-pattern"` }
ConfigNodepool options only include the project-id for now
type Device ¶
type Device struct { ID string `json:"id"` ShortID string `json:"short_id"` Hostname string `json:"hostname"` Description string `json:"description"` State string `json:"state"` Tags []string `json:"tags"` }
Device represents an Equinix Metal device
type DeviceCreateRequest ¶
type DeviceCreateRequest struct { Hostname string `json:"hostname"` Plan string `json:"plan"` Metro string `json:"metro"` OS string `json:"operating_system"` BillingCycle string `json:"billing_cycle"` ProjectID string `json:"project_id"` UserData string `json:"userdata"` Storage string `json:"storage,omitempty"` Tags []string `json:"tags"` CustomData string `json:"customdata,omitempty"` IPAddresses []IPAddressCreateRequest `json:"ip_addresses,omitempty"` HardwareReservationID string `json:"hardware_reservation_id,omitempty"` }
DeviceCreateRequest represents a request to create a new Equinix Metal device. Used by createNodes
type Devices ¶
type Devices struct {
Devices []Device `json:"devices"`
}
Devices represents a list of an Equinix Metal devices
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 DeviceCreateRequest
type Price ¶
type Price struct { }
Price implements Price interface for Equinix Metal.