Documentation
¶
Index ¶
- type DOAllowance
- type DOAttribute
- 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 DOPrice
- type DOProduct
- type DOResponse
- type PricingCache
- type SlugBase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DOAllowance ¶
type DOAttribute ¶
type DOKS ¶
type DOKS struct {
PricingURL string
Cache *PricingCache
Products map[string][]DOProduct
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 DOProduct ¶
type DOProduct struct {
SKU string `json:"sku"`
ItemType string `json:"itemType"`
DisplayName string `json:"displayName"`
Category string `json:"category"`
Prices []DOPrice `json:"prices"`
Allowances []DOAllowance `json:"allowances,omitempty"`
Attributes []DOAttribute `json:"attributes,omitempty"`
EffectiveAt string `json:"effectiveAt"`
}
type DOResponse ¶
type DOResponse struct {
Products []DOProduct `json:"products"`
}
type PricingCache ¶
type PricingCache struct {
// contains filtered or unexported fields
}
func NewPricingCache ¶
func NewPricingCache() *PricingCache