Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainerAllocation ¶
type CostModel ¶
type CostModel interface {
// GetNodesCost get all the real nodes price of kubernetes cluster with name as the key.
GetNodesCost() (map[string]*cloud.Node, error)
// GetPodsCost get the eks or tke pod price.
// if the pod is in the real node of kubernetes cluster, then its price is computed from the instance backed the node by cost breakdown.
// if the pod is in virtual node of kubernetes cluster, then its price came from the pod billing directly or the virtual machine instance price backed the the pod.
// Note!!! In distributed cloud, the cluster master maybe in one cloud provider, but the nodes in the cluster maybe in multiple clouds from different cloud datasource-providers
// so the node and pod pricing is crossing clouds, currently do not support it.
// GetPodsCost, key is namespace/name
GetPodsCost() (map[string]*cloud.Pod, error)
// UpdateConfigFromConfigMap update CustomPricing from configmap
UpdateConfigFromConfigMap(map[string]string) (*cloud.CustomPricing, error)
// GetConfig return CustomPricing
GetConfig() (*cloud.CustomPricing, error)
// ContainerAllocation return the container resource allocation. resource allocation is max(request, usage)
ContainerAllocation() (map[string]*ContainerAllocation, error)
GetNodesPricing() (map[string]*cloud.Price, error)
}
CostModel define a model
func NewCloudCost ¶
func NewCloudCost(cache cache.Cache, provider cloud.CloudPrice) CostModel
Click to show internal directories.
Click to hide internal directories.