Documentation
¶
Index ¶
- type DODiskInfo
- type DODiskSize
- type DOGPUInfo
- type DOGPUVRAM
- type DOKS
- func (do *DOKS) AllNodePricing() (interface{}, error)
- func (do *DOKS) AllPVPricing() (map[models.PVKey]*models.PV, error)
- func (do *DOKS) ApplyReservedInstancePricing(map[string]*models.Node)
- func (do *DOKS) ClusterInfo() (map[string]string, error)
- func (do *DOKS) ClusterManagementPricing() (string, float64, error)
- func (do *DOKS) CombinedDiscountForNode(string, bool, float64, float64) float64
- func (do *DOKS) CustomPricingEnabled() bool
- func (do *DOKS) DownloadPricingData() error
- func (do *DOKS) GetAddresses() ([]byte, error)
- func (do *DOKS) GetClusterManagementPricing() float64
- func (do *DOKS) GetConfig() (*models.CustomPricing, error)
- func (do *DOKS) GetDisks() ([]byte, error)
- func (do *DOKS) GetKey(labels map[string]string, n *clustercache.Node) models.Key
- func (do *DOKS) GetManagementPlatform() (string, error)
- func (do *DOKS) GetOrphanedResources() ([]models.OrphanedResource, error)
- func (do *DOKS) GetPVKey(pv *clustercache.PersistentVolume, parameters map[string]string, ...) models.PVKey
- func (do *DOKS) GpuPricing(input map[string]string) (string, error)
- func (do *DOKS) LoadBalancerPricing() (*models.LoadBalancer, error)
- func (do *DOKS) NetworkPricing() (*models.Network, error)
- func (do *DOKS) NodePricing(key models.Key) (*models.Node, models.PricingMetadata, error)
- func (do *DOKS) PVPricing(key models.PVKey) (*models.PV, error)
- func (do *DOKS) PricingSourceStatus() map[string]*models.PricingSource
- func (do *DOKS) PricingSourceSummary() interface{}
- func (do *DOKS) Regions() []string
- func (do *DOKS) ServiceAccountStatus() *models.ServiceAccountStatus
- func (do *DOKS) UpdateConfig(r io.Reader, updateType string) (*models.CustomPricing, error)
- func (do *DOKS) UpdateConfigFromConfigMap(map[string]string) (*models.CustomPricing, error)
- type DOLinks
- type DOMeta
- type DOPages
- type DOResponse
- type DOSize
- type PricingCache
- type SlugBase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DODiskInfo ¶ added in v1.120.0
type DODiskInfo struct {
Type string `json:"type"`
Size DODiskSize `json:"size"`
}
DODiskInfo represents disk information for a DigitalOcean size
type DODiskSize ¶ added in v1.120.0
DODiskSize represents disk size details
type DOGPUInfo ¶ added in v1.120.0
type DOGPUInfo struct {
Count int `json:"count"`
VRAM DOGPUVRAM `json:"vram"`
Model string `json:"model"`
}
DOGPUInfo represents GPU information for a DigitalOcean size
type DOKS ¶
type DOKS struct {
PricingURL string
Cache *PricingCache
Sizes map[string]*DOSize
Config models.ProviderConfig
Clientset clustercache.ClusterCache
ClusterManagementCost float64
}
func NewDOKSProvider ¶
func (*DOKS) AllNodePricing ¶
func (*DOKS) ApplyReservedInstancePricing ¶
func (*DOKS) ClusterManagementPricing ¶
func (*DOKS) CombinedDiscountForNode ¶
func (*DOKS) CustomPricingEnabled ¶
func (*DOKS) DownloadPricingData ¶
func (*DOKS) GetAddresses ¶
func (*DOKS) GetClusterManagementPricing ¶
func (*DOKS) GetManagementPlatform ¶
func (*DOKS) GetOrphanedResources ¶
func (do *DOKS) GetOrphanedResources() ([]models.OrphanedResource, error)
func (*DOKS) GetPVKey ¶
func (do *DOKS) GetPVKey(pv *clustercache.PersistentVolume, parameters map[string]string, defaultRegion string) models.PVKey
func (*DOKS) LoadBalancerPricing ¶
func (do *DOKS) LoadBalancerPricing() (*models.LoadBalancer, error)
LoadBalancerPricing returns the hourly cost of a Load Balancer in DigitalOcean (DOKS).
DigitalOcean offers multiple Load Balancers with different prices:
- Public HTTP Load Balancer: ~$0.01786/hr - Private Network Load Balancer: ~$0.02232/hr - Public Network Load Balancer: ~$0.02232/hr - Statically sized Load Balancers: $0.01786–$0.10714/hr
However, the current OpenCost provider interface does not pass information about individual Load Balancer characteristics (like annotations or network mode).
As a result, this implementation uses a fixed average hourly rate of $0.02, which is representative of the most common DO LBs.
TODO Once the provider interface supports more granular Load Balancer metadata, this method should be updated to assign costs more precisely.
func (*DOKS) NodePricing ¶
func (*DOKS) PricingSourceStatus ¶
func (do *DOKS) PricingSourceStatus() map[string]*models.PricingSource
func (*DOKS) PricingSourceSummary ¶
func (do *DOKS) PricingSourceSummary() interface{}
func (*DOKS) ServiceAccountStatus ¶
func (do *DOKS) ServiceAccountStatus() *models.ServiceAccountStatus
func (*DOKS) UpdateConfig ¶
func (*DOKS) UpdateConfigFromConfigMap ¶
type DOLinks ¶ added in v1.120.0
type DOLinks struct {
Pages DOPages `json:"pages,omitempty"`
}
DOLinks represents pagination links
type DOMeta ¶ added in v1.120.0
type DOMeta struct {
Total int `json:"total"`
}
DOMeta represents metadata about the response
type DOPages ¶ added in v1.120.0
type DOPages struct {
First string `json:"first,omitempty"`
Prev string `json:"prev,omitempty"`
Next string `json:"next,omitempty"`
Last string `json:"last,omitempty"`
}
DOPages represents pagination page links
type DOResponse ¶
type DOResponse struct {
Sizes []DOSize `json:"sizes"`
Links DOLinks `json:"links,omitempty"`
Meta DOMeta `json:"meta,omitempty"`
}
DOResponse represents the response from DigitalOcean's /v2/sizes API
type DOSize ¶ added in v1.120.0
type DOSize struct {
Slug string `json:"slug"`
Memory int `json:"memory"` // Memory in MB
VCPUs int `json:"vcpus"`
Disk int `json:"disk"` // Disk in GB
Transfer float64 `json:"transfer"` // Transfer in TB
PriceMonthly float64 `json:"price_monthly"` // Monthly price in USD
PriceHourly float64 `json:"price_hourly"` // Hourly price in USD
Regions []string `json:"regions"`
Available bool `json:"available"`
Description string `json:"description"`
DiskInfo []DODiskInfo `json:"disk_info,omitempty"`
GPUInfo DOGPUInfo `json:"gpu_info,omitempty"`
}
DOSize represents a DigitalOcean Droplet size
type PricingCache ¶
type PricingCache struct {
// contains filtered or unexported fields
}
func NewPricingCache ¶
func NewPricingCache() *PricingCache