Versions in this module Expand all Collapse all v0 v0.3.0 May 6, 2022 Changes in this version + func DetectRegion(node *v1.Node) string + func RegisterCloudProvider(name ProviderKind, cloud Factory) + func SetCustomPricing(obj *CustomPricing, name string, value string) error + type BaseInstancePrice struct + Cost string + Cpu string + CpuHourlyCost string + DefaultCpuPrice string + DefaultRamPrice string + DiscountedCost string + InstanceType string + ProviderID string + Ram string + RamBytes string + RamGBHourlyCost string + Region string + UsageType string + UsesDefaultPrice bool + type ChargeType string + type Cloud interface + func GetCloudProvider(name ProviderKind, cloudConfig io.Reader, priceConfig *PriceConfig, ...) (Cloud, error) + func InitCloudProvider(CloudOpts CloudConfig, priceConfig *PriceConfig, cache *cache.Cache) (Cloud, error) + type CloudCacher interface + Refresh func() + WarmUp func() error + type CloudConfig struct + CloudConfigFile string + Provider string + type CloudPrice interface + GetConfig func() (*CustomPricing, error) + GetNodesCost func() (map[string]*Node, error) + GetNodesPricing func() (map[string]*Price, error) + GetPodsCost func() (map[string]*Pod, error) + IsVirtualNode func(node *v1.Node) bool + OnNodeAdd func(node *v1.Node) error + OnNodeDelete func(node *v1.Node) error + OnNodeUpdate func(old, new *v1.Node) error + Refresh func() + UpdateConfigFromConfigMap func(map[string]string) (*CustomPricing, error) + WarmUp func() error + type CustomPricing struct + CpuHourlyPrice float64 + Description string + Provider string + RamGBHourlyPrice float64 + Region string + type Factory func(cloudConfig io.Reader, priceConfig *PriceConfig, cache *cache.Cache) (Cloud, error) + type Node struct + type NodePricer interface + NodePrice func(spec spec.CloudNodeSpec) (*Node, error) + type NodeSpecConverter interface + Node2Spec func(node *v1.Node) spec.CloudNodeSpec + type PlatformKind string + const ServerfulKind + const ServerlessKind + type PlatformParameter struct + ClusterLevel *string + Nodes *int32 + Platform PlatformKind + type PlatformPricer interface + PlatformPrice func(cp PlatformParameter) *Prices + type Pod struct + type PodPricer interface + PodPrice func(spec spec.CloudPodSpec) (*Pod, error) + ServerlessPodPrice func(spec spec.CloudPodSpec) (*Pod, error) + type PodSpecConverter interface + Pod2ServerlessSpec func(pod *v1.Pod) spec.CloudPodSpec + Pod2Spec func(pod *v1.Pod) spec.CloudPodSpec + type Price struct + ChargeType string + CvmPrice *PriceItem + InstanceType string + Memory string + VCpu string + type PriceConfig struct + func NewProviderConfig(customPricing *CustomPricing) *PriceConfig + func (pc *PriceConfig) GetConfig() (*CustomPricing, error) + func (pc *PriceConfig) UpdateConfigFromConfigMap(priceConf map[string]string) (*CustomPricing, error) + type PriceItem struct + ChargeUnit *string + Discount *float64 + DiscountFiveYear *float64 + DiscountOneYear *float64 + DiscountPrice *float64 + DiscountPriceFiveYear *float64 + DiscountPriceOneYear *float64 + DiscountPriceThreeYear *float64 + DiscountThreeYear *float64 + OriginalPrice *float64 + OriginalPriceFiveYear *float64 + OriginalPriceOneYear *float64 + OriginalPriceThreeYear *float64 + UnitPrice *float64 + UnitPriceDiscount *float64 + UnitPriceDiscountSecondStep *float64 + UnitPriceDiscountThirdStep *float64 + UnitPriceSecondStep *float64 + UnitPriceThirdStep *float64 + type Pricer interface + type Prices struct + DiscountPrice *float64 + TotalPrice float64 + type ProviderKind string + const DefaultCloud + const TencentCloud + func DetectProvider(node *v1.Node) ProviderKind