Documentation
¶
Index ¶
- Constants
- Variables
- func AllocateIdleByDefault(p Provider) bool
- func ClusterName(p Provider) string
- func ConfigWatcherFor(p Provider) *watcher.ConfigMapWatcher
- func CreateClusterMeta(cluster_id, cluster_name string) error
- func CustomPricesEnabled(p Provider) bool
- func GetClusterMeta(cluster_id string) (string, string, error)
- func GetCsv(location string) (io.Reader, error)
- func GetOrCreateClusterMeta(cluster_id, cluster_name string) (string, string, error)
- func NewClientCredentialsConfig(clientID string, clientSecret string, tenantID string, env azure.Environment) auth.ClientCredentialsConfig
- func NodeValueFromMapField(m string, n *v1.Node, useRegion bool) string
- func PVValueFromMapField(m string, n *v1.PersistentVolume) string
- func ParseID(id string) string
- func ParseLBID(id string) string
- func ParsePVID(id string) string
- func SetCustomPricingField(obj *CustomPricing, name string, value string) error
- func ShareTenancyCosts(p Provider) bool
- func SharedLabels(p Provider) ([]string, []string)
- func SharedNamespaces(p Provider) []string
- func UpdateClusterMeta(cluster_id, cluster_name string) error
- type AWS
- func (aws *AWS) AllNodePricing() (interface{}, error)
- func (aws *AWS) ApplyReservedInstancePricing(nodes map[string]*Node)
- func (awsProvider *AWS) ClusterInfo() (map[string]string, error)
- func (aws *AWS) ClusterManagementPricing() (string, float64, error)
- func (aws *AWS) CombinedDiscountForNode(instanceType string, isPreemptible bool, ...) float64
- func (aws *AWS) ConfigureAuth() error
- func (aws *AWS) ConfigureAuthWith(config *CustomPricing) error
- func (aws *AWS) DownloadPricingData() error
- func (aws *AWS) GetAWSAccessKey() (*AWSAccessKey, error)
- func (aws *AWS) GetAWSAthenaInfo() (*AwsAthenaInfo, error)
- func (aws *AWS) GetAddresses() ([]byte, error)
- func (aws *AWS) GetConfig() (*CustomPricing, error)
- func (aws *AWS) GetDisks() ([]byte, error)
- func (aws *AWS) GetKey(labels map[string]string, n *v1.Node) Key
- func (aws *AWS) GetLocalStorageQuery(window, offset time.Duration, rate bool, used bool) string
- func (aws *AWS) GetManagementPlatform() (string, error)
- func (aws *AWS) GetOrphanedResources() ([]OrphanedResource, error)
- func (aws *AWS) GetPVKey(pv *v1.PersistentVolume, parameters map[string]string, defaultRegion string) PVKey
- func (aws *AWS) GetReservationDataFromAthena() error
- func (aws *AWS) GetSavingsPlanDataFromAthena() error
- func (aws *AWS) KubeAttrConversion(location, instanceType, operatingSystem string) string
- func (aws *AWS) LoadBalancerPricing() (*LoadBalancer, error)
- func (aws *AWS) NetworkPricing() (*Network, error)
- func (aws *AWS) NodePricing(k Key) (*Node, error)
- func (aws *AWS) PVPricing(pvk PVKey) (*PV, error)
- func (aws *AWS) PricingSourceStatus() map[string]*PricingSource
- func (aws *AWS) PricingSourceSummary() interface{}
- func (aws *AWS) QueryAthenaPaginated(ctx context.Context, query string, fn func(*athena.GetQueryResultsOutput) bool) error
- func (aws *AWS) Regions() []string
- func (aws *AWS) ServiceAccountStatus() *ServiceAccountStatus
- func (aws *AWS) SpotRefreshEnabled() bool
- func (aws *AWS) UpdateConfig(r io.Reader, updateType string) (*CustomPricing, error)
- func (aws *AWS) UpdateConfigFromConfigMap(cm map[string]string) (*CustomPricing, error)
- type AWSAccessKey
- type AWSCurrencyCode
- type AWSOfferTerm
- type AWSPricing
- type AWSPricingTerms
- type AWSProduct
- type AWSProductAttributes
- type AWSProductTerms
- type AWSRateCode
- type Alibaba
- func (alibaba *Alibaba) AllNodePricing() (interface{}, error)
- func (alibaba *Alibaba) ApplyReservedInstancePricing(nodes map[string]*Node)
- func (alibaba *Alibaba) ClusterInfo() (map[string]string, error)
- func (alibaba *Alibaba) ClusterManagementPricing() (string, float64, error)
- func (alibaba *Alibaba) CombinedDiscountForNode(string, bool, float64, float64) float64
- func (alibaba *Alibaba) DownloadPricingData() error
- func (alibaba *Alibaba) GetAddresses() ([]byte, error)
- func (alibaba *Alibaba) GetAlibabaAccessKey() (*credentials.AccessKeyCredential, error)
- func (alibaba *Alibaba) GetAlibabaCloudInfo() (*AlibabaInfo, error)
- func (alibaba *Alibaba) GetConfig() (*CustomPricing, error)
- func (alibaba *Alibaba) GetDisks() ([]byte, error)
- func (alibaba *Alibaba) GetKey(mapValue map[string]string, node *v1.Node) Key
- func (alibaba *Alibaba) GetLocalStorageQuery(window, offset time.Duration, rate bool, used bool) string
- func (alibaba *Alibaba) GetManagementPlatform() (string, error)
- func (alibaba *Alibaba) GetOrphanedResources() ([]OrphanedResource, error)
- func (alibaba *Alibaba) GetPVKey(pv *v1.PersistentVolume, parameters map[string]string, defaultRegion string) PVKey
- func (alibaba *Alibaba) LoadBalancerPricing() (*LoadBalancer, error)
- func (alibaba *Alibaba) NetworkPricing() (*Network, error)
- func (alibaba *Alibaba) NodePricing(key Key) (*Node, error)
- func (alibaba *Alibaba) PVPricing(pvk PVKey) (*PV, error)
- func (alibaba *Alibaba) PricingSourceStatus() map[string]*PricingSource
- func (a *Alibaba) PricingSourceSummary() interface{}
- func (alibaba *Alibaba) Regions() []string
- func (alibaba *Alibaba) ServiceAccountStatus() *ServiceAccountStatus
- func (alibaba *Alibaba) UpdateConfig(r io.Reader, updateType string) (*CustomPricing, error)
- func (alibaba *Alibaba) UpdateConfigFromConfigMap(cm map[string]string) (*CustomPricing, error)
- type AlibabaAccessKey
- type AlibabaInfo
- type AlibabaNodeAttributes
- type AlibabaNodeKey
- type AlibabaPVAttributes
- type AlibabaPVKey
- type AlibabaPricing
- type AlibabaPricingDetails
- type AlibabaPricingTerms
- type AwsAthenaInfo
- type AwsSpotFeedInfo
- type Azure
- func (az *Azure) AllNodePricing() (interface{}, error)
- func (az *Azure) ApplyReservedInstancePricing(nodes map[string]*Node)
- func (az *Azure) ClusterInfo() (map[string]string, error)
- func (*Azure) ClusterManagementPricing() (string, float64, error)
- func (az *Azure) CombinedDiscountForNode(instanceType string, isPreemptible bool, ...) float64
- func (az *Azure) DownloadPricingData() error
- func (*Azure) GetAddresses() ([]byte, error)
- func (az *Azure) GetAzureStorageConfig(forceReload bool, cp *CustomPricing) (*AzureStorageConfig, error)
- func (az *Azure) GetConfig() (*CustomPricing, error)
- func (az *Azure) GetDisks() ([]byte, error)
- func (az *Azure) GetKey(labels map[string]string, n *v1.Node) Key
- func (az *Azure) GetLocalStorageQuery(window, offset time.Duration, rate bool, used bool) string
- func (az *Azure) GetManagementPlatform() (string, error)
- func (az *Azure) GetOrphanedResources() ([]OrphanedResource, error)
- func (az *Azure) GetPVKey(pv *v1.PersistentVolume, parameters map[string]string, defaultRegion string) PVKey
- func (azr *Azure) LoadBalancerPricing() (*LoadBalancer, error)
- func (az *Azure) NetworkPricing() (*Network, error)
- func (az *Azure) NodePricing(key Key) (*Node, error)
- func (az *Azure) PVPricing(pvk PVKey) (*PV, error)
- func (az *Azure) PricingSourceStatus() map[string]*PricingSource
- func (az *Azure) PricingSourceSummary() interface{}
- func (az *Azure) Regions() []string
- func (az *Azure) ServiceAccountStatus() *ServiceAccountStatus
- func (az *Azure) UpdateConfig(r io.Reader, updateType string) (*CustomPricing, error)
- func (az *Azure) UpdateConfigFromConfigMap(a map[string]string) (*CustomPricing, error)
- type AzureAppKey
- type AzurePricing
- type AzureRetailPricing
- type AzureRetailPricingAttributes
- type AzureServiceKey
- type AzureStorageConfig
- type BigQueryConfig
- type CSVProvider
- func (*CSVProvider) ClusterManagementPricing() (string, float64, error)
- func (c *CSVProvider) CombinedDiscountForNode(instanceType string, isPreemptible bool, ...) float64
- func (c *CSVProvider) DownloadPricingData() error
- func (c *CSVProvider) GetKey(l map[string]string, n *v1.Node) Key
- func (c *CSVProvider) GetPVKey(pv *v1.PersistentVolume, parameters map[string]string, defaultRegion string) PVKey
- func (c *CSVProvider) NodePricing(key Key) (*Node, error)
- func (c *CSVProvider) PVPricing(pvk PVKey) (*PV, error)
- func (c *CSVProvider) PricingSourceSummary() interface{}
- func (c *CSVProvider) Regions() []string
- func (c *CSVProvider) ServiceAccountStatus() *ServiceAccountStatus
- type CustomPricing
- type CustomProvider
- func (cp *CustomProvider) AllNodePricing() (interface{}, error)
- func (*CustomProvider) ApplyReservedInstancePricing(nodes map[string]*Node)
- func (cp *CustomProvider) ClusterInfo() (map[string]string, error)
- func (*CustomProvider) ClusterManagementPricing() (string, float64, error)
- func (cp *CustomProvider) CombinedDiscountForNode(instanceType string, isPreemptible bool, ...) float64
- func (cp *CustomProvider) DownloadPricingData() error
- func (*CustomProvider) ExternalAllocations(start string, end string, aggregator []string, filterType string, ...) ([]*OutOfClusterAllocation, error)
- func (*CustomProvider) GetAddresses() ([]byte, error)
- func (cp *CustomProvider) GetConfig() (*CustomPricing, error)
- func (*CustomProvider) GetDisks() ([]byte, error)
- func (cp *CustomProvider) GetKey(labels map[string]string, n *v1.Node) Key
- func (*CustomProvider) GetLocalStorageQuery(window, offset time.Duration, rate bool, used bool) string
- func (*CustomProvider) GetManagementPlatform() (string, error)
- func (*CustomProvider) GetOrphanedResources() ([]OrphanedResource, error)
- func (*CustomProvider) GetPVKey(pv *v1.PersistentVolume, parameters map[string]string, defaultRegion string) PVKey
- func (cp *CustomProvider) LoadBalancerPricing() (*LoadBalancer, error)
- func (cp *CustomProvider) NetworkPricing() (*Network, error)
- func (cp *CustomProvider) NodePricing(key Key) (*Node, error)
- func (cp *CustomProvider) PVPricing(pvk PVKey) (*PV, error)
- func (cp *CustomProvider) PricingSourceStatus() map[string]*PricingSource
- func (cp *CustomProvider) PricingSourceSummary() interface{}
- func (*CustomProvider) QuerySQL(query string) ([]byte, error)
- func (cp *CustomProvider) Regions() []string
- func (cp *CustomProvider) ServiceAccountStatus() *ServiceAccountStatus
- func (cp *CustomProvider) UpdateConfig(r io.Reader, updateType string) (*CustomPricing, error)
- func (cp *CustomProvider) UpdateConfigFromConfigMap(a map[string]string) (*CustomPricing, error)
- type DescribeDiskResponse
- type DescribePriceResponse
- type Disk
- type Disks
- type GCP
- func (gcp *GCP) AllNodePricing() (interface{}, error)
- func (gcp *GCP) ApplyReservedInstancePricing(nodes map[string]*Node)
- func (gcp *GCP) ClusterInfo() (map[string]string, error)
- func (gcp *GCP) ClusterManagementPricing() (string, float64, error)
- func (gcp *GCP) CombinedDiscountForNode(instanceType string, isPreemptible bool, ...) float64
- func (gcp *GCP) DownloadPricingData() error
- func (gcp *GCP) GetAddresses() ([]byte, error)
- func (gcp *GCP) GetConfig() (*CustomPricing, error)
- func (gcp *GCP) GetDisks() ([]byte, error)
- func (gcp *GCP) GetKey(labels map[string]string, n *v1.Node) Key
- func (gcp *GCP) GetLocalStorageQuery(window, offset time.Duration, rate bool, used bool) string
- func (gcp *GCP) GetManagementPlatform() (string, error)
- func (gcp *GCP) GetOrphanedResources() ([]OrphanedResource, error)
- func (gcp *GCP) GetPVKey(pv *v1.PersistentVolume, parameters map[string]string, defaultRegion string) PVKey
- func (gcp *GCP) LoadBalancerPricing() (*LoadBalancer, error)
- func (gcp *GCP) NetworkPricing() (*Network, error)
- func (gcp *GCP) NodePricing(key Key) (*Node, error)
- func (gcp *GCP) PVPricing(pvk PVKey) (*PV, error)
- func (gcp *GCP) PricingSourceStatus() map[string]*PricingSource
- func (gcp *GCP) PricingSourceSummary() interface{}
- func (gcp *GCP) Regions() []string
- func (gcp *GCP) ServiceAccountStatus() *ServiceAccountStatus
- func (gcp *GCP) UpdateConfig(r io.Reader, updateType string) (*CustomPricing, error)
- func (gcp *GCP) UpdateConfigFromConfigMap(a map[string]string) (*CustomPricing, error)
- type GCPPricing
- type GCPReservedCounter
- type GCPReservedInstance
- type GCPReservedInstancePlan
- type GCPResourceInfo
- type Key
- type LoadBalancer
- type Network
- type Node
- type NodePrice
- type OrphanedResource
- type OutOfClusterAllocation
- type PV
- type PVKey
- type Price
- type PriceInfo
- type PricingExpression
- type PricingInfo
- type PricingMatchMetadata
- type PricingSource
- type PricingSources
- type PricingType
- type Provider
- type ProviderConfig
- func (pc *ProviderConfig) ConfigFileManager() *config.ConfigFileManager
- func (pc *ProviderConfig) GetCustomPricingData() (*CustomPricing, error)
- func (pc *ProviderConfig) Update(updateFunc func(*CustomPricing) error) (*CustomPricing, error)
- func (pc *ProviderConfig) UpdateFromMap(a map[string]string) (*CustomPricing, error)
- type RIData
- type ReservedInstanceData
- type SavingsPlanData
- type Scaleway
- func (c *Scaleway) AllNodePricing() (interface{}, error)
- func (*Scaleway) ApplyReservedInstancePricing(map[string]*Node)
- func (scw *Scaleway) ClusterInfo() (map[string]string, error)
- func (*Scaleway) ClusterManagementPricing() (string, float64, error)
- func (c *Scaleway) CombinedDiscountForNode(instanceType string, isPreemptible bool, ...) float64
- func (c *Scaleway) DownloadPricingData() error
- func (*Scaleway) GetAddresses() ([]byte, error)
- func (scw *Scaleway) GetConfig() (*CustomPricing, error)
- func (*Scaleway) GetDisks() ([]byte, error)
- func (c *Scaleway) GetKey(l map[string]string, n *v1.Node) Key
- func (*Scaleway) GetLocalStorageQuery(window, offset time.Duration, rate bool, used bool) string
- func (scw *Scaleway) GetManagementPlatform() (string, error)
- func (*Scaleway) GetOrphanedResources() ([]OrphanedResource, error)
- func (c *Scaleway) GetPVKey(pv *v1.PersistentVolume, parameters map[string]string, defaultRegion string) PVKey
- func (c *Scaleway) LoadBalancerPricing() (*LoadBalancer, error)
- func (c *Scaleway) NetworkPricing() (*Network, error)
- func (c *Scaleway) NodePricing(key Key) (*Node, error)
- func (c *Scaleway) PVPricing(pvk PVKey) (*PV, error)
- func (c *Scaleway) PricingSourceStatus() map[string]*PricingSource
- func (c *Scaleway) PricingSourceSummary() interface{}
- func (c *Scaleway) Regions() []string
- func (c *Scaleway) ServiceAccountStatus() *ServiceAccountStatus
- func (c *Scaleway) UpdateConfig(r io.Reader, updateType string) (*CustomPricing, error)
- func (c *Scaleway) UpdateConfigFromConfigMap(a map[string]string) (*CustomPricing, error)
- type ScalewayPricing
- type ServiceAccountCheck
- type ServiceAccountChecks
- type ServiceAccountStatus
- type SlimK8sDisk
- type SlimK8sNode
- type TieredRates
- type UnitPriceInfo
Constants ¶
const ( ALIBABA_ECS_PRODUCT_CODE = "ecs" ALIBABA_ECS_VERSION = "2014-05-26" ALIBABA_ECS_DOMAIN = "ecs.aliyuncs.com" ALIBABA_DESCRIBE_PRICE_API_ACTION = "DescribePrice" ALIBABA_DESCRIBE_DISK_API_ACTION = "DescribeDisks" ALIBABA_INSTANCE_RESOURCE_TYPE = "instance" ALIBABA_DISK_RESOURCE_TYPE = "disk" ALIBABA_PAY_AS_YOU_GO_BILLING = "Pay-As-You-Go" ALIBABA_SUBSCRIPTION_BILLING = "Subscription" ALIBABA_PREEMPTIBLE_BILLING = "Preemptible" ALIBABA_OPTIMIZE_KEYWORD = "optimize" ALIBABA_NON_OPTIMIZE_KEYWORD = "nonoptimize" ALIBABA_HOUR_PRICE_UNIT = "Hour" ALIBABA_MONTH_PRICE_UNIT = "Month" ALIBABA_YEAR_PRICE_UNIT = "Year" ALIBABA_UNKNOWN_INSTANCE_FAMILY_TYPE = "unknown" ALIBABA_NOT_SUPPORTED_INSTANCE_FAMILY_TYPE = "unsupported" ALIBABA_DISK_CLOUD_ESSD_CATEGORY = "cloud_essd" ALIBABA_DISK_CLOUD_CATEGORY = "cloud" ALIBABA_DATA_DISK_CATEGORY = "data" ALIBABA_SYSTEM_DISK_CATEGORY = "system" ALIBABA_DATA_DISK_PREFIX = "DataDisk" ALIBABA_PV_CLOUD_DISK_TYPE = "CloudDisk" ALIBABA_PV_NAS_TYPE = "NAS" ALIBABA_PV_OSS_TYPE = "OSS" ALIBABA_DEFAULT_DATADISK_SIZE = "2000" ALIBABA_DISK_TOPOLOGY_REGION_LABEL = "topology.diskplugin.csi.alibabacloud.com/region" ALIBABA_DISK_TOPOLOGY_ZONE_LABEL = "topology.diskplugin.csi.alibabacloud.com/zone" )
const ( SpotInfoUpdateType = "spotinfo" AthenaInfoUpdateType = "athenainfo" PreemptibleType = "preemptible" APIPricingSource = "Public API" SpotPricingSource = "Spot Data Feed" ReservedInstancePricingSource = "Savings Plan, Reserved Instance, and Out-Of-Cluster" InUseState = "in-use" AttachedState = "attached" AWSHourlyPublicIPCost = 0.005 EKSCapacityTypeLabel = "eks.amazonaws.com/capacityType" EKSCapacitySpotTypeValue = "SPOT" )
const ( AzureFilePremiumStorageClass = "premium_smb" AzureFileStandardStorageClass = "standard_smb" AzureDiskPremiumSSDStorageClass = "premium_ssd" AzureDiskStandardSSDStorageClass = "standard_ssd" AzureDiskStandardStorageClass = "standard_hdd" AzureStorageUpdateType = "AzureStorage" )
const ( GCPHourlyPublicIPCost = 0.01 GCPMonthlyBasicDiskCost = 0.04 GCPMonthlySSDDiskCost = 0.17 GCPMonthlyGP2DiskCost = 0.1 GKEPreemptibleLabel = "cloud.google.com/gke-preemptible" GKESpotLabel = "cloud.google.com/gke-spot" )
const ( GCPReservedInstanceResourceTypeRAM string = "MEMORY" GCPReservedInstanceResourceTypeCPU string = "VCPU" GCPReservedInstanceStatusActive string = "ACTIVE" GCPReservedInstancePlanOneYear string = "TWELVE_MONTH" GCPReservedInstancePlanThreeYear string = "THIRTY_SIX_MONTH" )
const BigqueryUpdateType = "bigqueryupdate"
const ClusterIdEnvVar = "AWS_CLUSTER_ID"
ClusterIdEnvVar is the environment variable in which one can manually set the ClusterId
const GKE_GPU_TAG = "cloud.google.com/gke-accelerator"
const HourlyRateCode = "6YS6EN2CT7"
HourlyRateCode is appended to a node sku
const HourlyRateCodeCn = "Q7UJUT2CE6"
const (
InstanceAPIPricing = "Instance API Pricing"
)
const KarpenterCapacitySpotTypeValue = "spot"
const KarpenterCapacityTypeLabel = "karpenter.sh/capacity-type"
const SpotRefreshDuration = 15 * time.Minute
SpotRefreshDuration represents how much time must pass before we refresh
Variables ¶
var OnDemandRateCodes = map[string]struct{}{
"JRTCKXETXF": {},
}
OnDemandRateCodes is are sets of identifiers for offerTermCodes matching 'On Demand' rates
var OnDemandRateCodesCn = map[string]struct{}{
"99YE2YK9UR": {},
"5Y9WH78GDR": {},
"KW44MY7SZN": {},
}
Functions ¶
func AllocateIdleByDefault ¶
AllocateIdleByDefault returns true if the application settings specify to allocate idle by default
func ClusterName ¶
ClusterName returns the name defined in cluster info, defaulting to the CLUSTER_ID environment variable
func ConfigWatcherFor ¶
func ConfigWatcherFor(p Provider) *watcher.ConfigMapWatcher
ConfigWatcherFor returns a new ConfigWatcher instance which watches changes to the "pricing-configs" configmap
func CreateClusterMeta ¶
func CustomPricesEnabled ¶
CustomPricesEnabled returns the boolean equivalent of the cloup provider's custom prices flag, indicating whether or not the cluster is using custom pricing.
func GetOrCreateClusterMeta ¶
func NewClientCredentialsConfig ¶
func NewClientCredentialsConfig(clientID string, clientSecret string, tenantID string, env azure.Environment) auth.ClientCredentialsConfig
NewClientCredentialsConfig creates an AuthorizerConfig object configured to obtain an Authorizer through Client Credentials.
func NodeValueFromMapField ¶
func PVValueFromMapField ¶
func PVValueFromMapField(m string, n *v1.PersistentVolume) string
func ParseID ¶
ParseID attempts to parse a ProviderId from a string based on formats from the various providers and returns the string as is if it cannot find a match
func ParseLBID ¶
ParseLBID attempts to parse a LB ProviderId from a string based on formats from the various providers and returns the string as is if it cannot find a match
func ParsePVID ¶
ParsePVID attempts to parse a PV ProviderId from a string based on formats from the various providers and returns the string as is if it cannot find a match
func SetCustomPricingField ¶
func SetCustomPricingField(obj *CustomPricing, name string, value string) error
func ShareTenancyCosts ¶
ShareTenancyCosts returns true if the application settings specify to share tenancy costs by default.
func SharedLabels ¶
SharedLabel returns the configured set of shared labels as a parallel tuple of keys to values; e.g. for app:kubecost,type:staging this returns (["app", "type"], ["kubecost", "staging"]) in order to match the signature of the NewSharedResourceInfo
func SharedNamespaces ¶
SharedNamespace returns a list of names of shared namespaces, as defined in the application settings
func UpdateClusterMeta ¶
Types ¶
type AWS ¶
type AWS struct { Pricing map[string]*AWSProductTerms SpotPricingByInstanceID map[string]*spotInfo SpotPricingUpdatedAt *time.Time SpotRefreshRunning bool SpotPricingLock sync.RWMutex SpotPricingError error RIPricingByInstanceID map[string]*RIData RIPricingError error RIDataRunning bool RIDataLock sync.RWMutex SavingsPlanDataByInstanceID map[string]*SavingsPlanData SavingsPlanDataRunning bool SavingsPlanDataLock sync.RWMutex ValidPricingKeys map[string]bool Clientset clustercache.ClusterCache BaseCPUPrice string BaseRAMPrice string BaseGPUPrice string BaseSpotCPUPrice string BaseSpotRAMPrice string BaseSpotGPUPrice string SpotLabelName string SpotLabelValue string SpotDataRegion string SpotDataBucket string SpotDataPrefix string ProjectID string DownloadPricingDataLock sync.RWMutex Config *ProviderConfig *CustomProvider // contains filtered or unexported fields }
AWS represents an Amazon Provider
func (*AWS) AllNodePricing ¶
AllNodePricing returns all the billing data fetched.
func (*AWS) ApplyReservedInstancePricing ¶
ApplyReservedInstancePricing TODO
func (*AWS) ClusterInfo ¶
ClusterInfo returns an object that represents the cluster. TODO: actually return the name of the cluster. Blocked on cluster federation.
func (*AWS) ClusterManagementPricing ¶
func (*AWS) CombinedDiscountForNode ¶
func (*AWS) ConfigureAuth ¶
updates the authentication to the latest values (via config or secret)
func (*AWS) ConfigureAuthWith ¶
func (aws *AWS) ConfigureAuthWith(config *CustomPricing) error
updates the authentication to the latest values (via config or secret)
func (*AWS) DownloadPricingData ¶
DownloadPricingData fetches data from the AWS Pricing API
func (*AWS) GetAWSAccessKey ¶
func (aws *AWS) GetAWSAccessKey() (*AWSAccessKey, error)
GetAWSAccessKey generate an AWSAccessKey object from the config
func (*AWS) GetAWSAthenaInfo ¶
func (aws *AWS) GetAWSAthenaInfo() (*AwsAthenaInfo, error)
GetAWSAthenaInfo generate an AWSAthenaInfo object from the config
func (*AWS) GetAddresses ¶
GetAddresses retrieves EC2 addresses
func (*AWS) GetConfig ¶
func (aws *AWS) GetConfig() (*CustomPricing, error)
func (*AWS) GetDisks ¶
GetDisks returns the AWS disks backing PVs. Useful because sometimes k8s will not clean up PVs correctly. Requires a json config in /var/configs with key region.
func (*AWS) GetLocalStorageQuery ¶
func (*AWS) GetManagementPlatform ¶
func (*AWS) GetOrphanedResources ¶ added in v1.99.0
func (aws *AWS) GetOrphanedResources() ([]OrphanedResource, error)
func (*AWS) GetReservationDataFromAthena ¶
func (*AWS) GetSavingsPlanDataFromAthena ¶
func (*AWS) KubeAttrConversion ¶
KubeAttrConversion maps the k8s labels for region to an aws region
func (*AWS) LoadBalancerPricing ¶
func (aws *AWS) LoadBalancerPricing() (*LoadBalancer, error)
func (*AWS) NetworkPricing ¶
Stubbed NetworkPricing for AWS. Pull directly from aws.json for now
func (*AWS) NodePricing ¶
NodePricing takes in a key from GetKey and returns a Node object for use in building the cost model.
func (*AWS) PricingSourceStatus ¶
func (aws *AWS) PricingSourceStatus() map[string]*PricingSource
func (*AWS) PricingSourceSummary ¶ added in v1.102.0
func (aws *AWS) PricingSourceSummary() interface{}
PricingSourceSummary returns the pricing source summary for the provider. The summary represents what was _parsed_ from the pricing source, not everything that was _available_ in the pricing source.
func (*AWS) QueryAthenaPaginated ¶
func (aws *AWS) QueryAthenaPaginated(ctx context.Context, query string, fn func(*athena.GetQueryResultsOutput) bool) error
QueryAthenaPaginated executes athena query and processes results.
func (*AWS) ServiceAccountStatus ¶
func (aws *AWS) ServiceAccountStatus() *ServiceAccountStatus
func (*AWS) SpotRefreshEnabled ¶
SpotRefreshEnabled determines whether the required configs to run the spot feed query have been set up
func (*AWS) UpdateConfig ¶
func (*AWS) UpdateConfigFromConfigMap ¶
func (aws *AWS) UpdateConfigFromConfigMap(cm map[string]string) (*CustomPricing, error)
type AWSAccessKey ¶
type AWSAccessKey struct { AccessKeyID string `json:"aws_access_key_id"` SecretAccessKey string `json:"aws_secret_access_key"` }
AWSAccessKey holds AWS credentials and fulfils the awsV2.CredentialsProvider interface
func (AWSAccessKey) CreateConfig ¶
func (accessKey AWSAccessKey) CreateConfig(region string) (awsSDK.Config, error)
CreateConfig creates an AWS SDK V2 Config for the credentials that it contains for the provided region
func (AWSAccessKey) Retrieve ¶
func (accessKey AWSAccessKey) Retrieve(ctx context.Context) (awsSDK.Credentials, error)
Retrieve returns a set of awsV2 credentials using the AWSAccessKey's key and secret. This fulfils the awsV2.CredentialsProvider interface contract.
type AWSCurrencyCode ¶
AWSCurrencyCode is the localized currency. (TODO: support non-USD)
type AWSOfferTerm ¶
type AWSOfferTerm struct { Sku string `json:"sku"` OfferTermCode string `json:"offerTermCode"` PriceDimensions map[string]*AWSRateCode `json:"priceDimensions"` }
AWSOfferTerm is a sku extension used to pay for the node.
func (*AWSOfferTerm) String ¶
func (ot *AWSOfferTerm) String() string
type AWSPricing ¶
type AWSPricing struct { Products map[string]*AWSProduct `json:"products"` Terms AWSPricingTerms `json:"terms"` }
AWSPricing maps a k8s node to an AWS Pricing "product"
type AWSPricingTerms ¶
type AWSPricingTerms struct { OnDemand map[string]map[string]*AWSOfferTerm `json:"OnDemand"` Reserved map[string]map[string]*AWSOfferTerm `json:"Reserved"` }
AWSPricingTerms are how you pay for the node: OnDemand, Reserved, or (TODO) Spot
type AWSProduct ¶
type AWSProduct struct { Sku string `json:"sku"` Attributes AWSProductAttributes `json:"attributes"` }
AWSProduct represents a purchased SKU
type AWSProductAttributes ¶
type AWSProductAttributes struct { Location string `json:"location"` InstanceType string `json:"instanceType"` Memory string `json:"memory"` Storage string `json:"storage"` VCpu string `json:"vcpu"` UsageType string `json:"usagetype"` OperatingSystem string `json:"operatingSystem"` PreInstalledSw string `json:"preInstalledSw"` InstanceFamily string `json:"instanceFamily"` CapacityStatus string `json:"capacitystatus"` GPU string `json:"gpu"` // GPU represents the number of GPU on the instance }
AWSProductAttributes represents metadata about the product used to map to a node.
type AWSProductTerms ¶
type AWSProductTerms struct { Sku string `json:"sku"` OnDemand *AWSOfferTerm `json:"OnDemand"` Reserved *AWSOfferTerm `json:"Reserved"` Memory string `json:"memory"` Storage string `json:"storage"` VCpu string `json:"vcpu"` GPU string `json:"gpu"` // GPU represents the number of GPU on the instance PV *PV `json:"pv"` }
AWSProductTerms represents the full terms of the product
type AWSRateCode ¶
type AWSRateCode struct { Unit string `json:"unit"` PricePerUnit AWSCurrencyCode `json:"pricePerUnit"` }
AWSRateCode encodes data about the price of a product
func (*AWSRateCode) String ¶
func (rc *AWSRateCode) String() string
type Alibaba ¶ added in v1.99.0
type Alibaba struct { // Data to store Alibaba cloud's pricing struct, key in the map represents exact match to // node.features() or pv.features for easy lookup Pricing map[string]*AlibabaPricing // Lock Needed to provide thread safe DownloadPricingDataLock sync.RWMutex Clientset clustercache.ClusterCache Config *ProviderConfig *CustomProvider // contains filtered or unexported fields }
Alibaba cloud's Provider struct
func (*Alibaba) AllNodePricing ¶ added in v1.99.0
AllNodePricing returns all the pricing data for all nodes and pvs
func (*Alibaba) ApplyReservedInstancePricing ¶ added in v1.99.0
Will look at this in Next PR if needed
func (*Alibaba) ClusterInfo ¶ added in v1.99.0
ClusterInfo returns information about Alibaba Cloud cluster, as provided by metadata.
func (*Alibaba) ClusterManagementPricing ¶ added in v1.99.0
Will look at this in Next PR if needed
func (*Alibaba) CombinedDiscountForNode ¶ added in v1.99.0
Will look at this in Next PR if needed
func (*Alibaba) DownloadPricingData ¶ added in v1.99.0
DownloadPricingData satisfies the provider interface and downloads the prices for Node instances and PVs.
func (*Alibaba) GetAddresses ¶ added in v1.99.0
Will look at this in Next PR if needed
func (*Alibaba) GetAlibabaAccessKey ¶ added in v1.99.0
func (alibaba *Alibaba) GetAlibabaAccessKey() (*credentials.AccessKeyCredential, error)
GetAlibabaAccessKey return the Access Key used to interact with the Alibaba cloud, if not set it set it first by looking at env variables else load it from secret files.
func (*Alibaba) GetAlibabaCloudInfo ¶ added in v1.100.0
func (alibaba *Alibaba) GetAlibabaCloudInfo() (*AlibabaInfo, error)
func (*Alibaba) GetConfig ¶ added in v1.99.0
func (alibaba *Alibaba) GetConfig() (*CustomPricing, error)
func (*Alibaba) GetLocalStorageQuery ¶ added in v1.99.0
func (alibaba *Alibaba) GetLocalStorageQuery(window, offset time.Duration, rate bool, used bool) string
Will look at this in Next PR if needed
func (*Alibaba) GetManagementPlatform ¶ added in v1.99.0
Will look at this in Next PR if needed
func (*Alibaba) GetOrphanedResources ¶ added in v1.99.0
func (alibaba *Alibaba) GetOrphanedResources() ([]OrphanedResource, error)
func (*Alibaba) LoadBalancerPricing ¶ added in v1.99.0
func (alibaba *Alibaba) LoadBalancerPricing() (*LoadBalancer, error)
Alibaba loadbalancer has three different types https://www.alibabacloud.com/product/server-load-balancer, defaulted price to classic load balancer https://www.alibabacloud.com/help/en/server-load-balancer/latest/pay-as-you-go.
func (*Alibaba) NetworkPricing ¶ added in v1.99.0
Inter zone and Inter region network cost are defaulted based on https://www.alibabacloud.com/help/en/cloud-data-transmission/latest/cross-region-data-transfers Internet cost is default based on https://www.alibabacloud.com/help/en/elastic-compute-service/latest/public-bandwidth to $0.123
func (*Alibaba) NodePricing ¶ added in v1.99.0
NodePricing gives pricing information of a specific node given by the key
func (*Alibaba) PVPricing ¶ added in v1.99.0
PVPricing gives a pricing information of a specific PV given by PVkey
func (*Alibaba) PricingSourceStatus ¶ added in v1.99.0
func (alibaba *Alibaba) PricingSourceStatus() map[string]*PricingSource
Will look at this in Next PR if needed
func (*Alibaba) PricingSourceSummary ¶ added in v1.102.0
func (a *Alibaba) PricingSourceSummary() interface{}
PricingSourceSummary returns the pricing source summary for the provider. The summary represents what was _parsed_ from the pricing source, not everything that was _available_ in the pricing source.
func (*Alibaba) Regions ¶ added in v1.99.0
Regions returns a current supported list of Alibaba regions
func (*Alibaba) ServiceAccountStatus ¶ added in v1.99.0
func (alibaba *Alibaba) ServiceAccountStatus() *ServiceAccountStatus
Will look at this in Next PR if needed
func (*Alibaba) UpdateConfig ¶ added in v1.99.0
func (*Alibaba) UpdateConfigFromConfigMap ¶ added in v1.99.0
func (alibaba *Alibaba) UpdateConfigFromConfigMap(cm map[string]string) (*CustomPricing, error)
type AlibabaAccessKey ¶ added in v1.99.0
type AlibabaAccessKey struct { AccessKeyID string `json:"alibaba_access_key_id"` SecretAccessKey string `json:"alibaba_secret_access_key"` }
AlibabaAccessKey holds Alibaba credentials parsing from the service-key.json file.
type AlibabaInfo ¶ added in v1.100.0
type AlibabaInfo struct { AlibabaClusterRegion string `json:"clusterRegion"` AlibabaServiceKeyName string `json:"serviceKeyName"` AlibabaServiceKeySecret string `json:"serviceKeySecret"` AlibabaAccountID string `json:"accountID"` }
AlibabaInfo contains configuration for Alibaba's CUR integration
func (*AlibabaInfo) IsEmpty ¶ added in v1.100.0
func (ai *AlibabaInfo) IsEmpty() bool
IsEmpty returns true if all fields in config are empty, false if not.
type AlibabaNodeAttributes ¶ added in v1.99.0
type AlibabaNodeAttributes struct { // InstanceType represents the type of instance. InstanceType string `json:"instanceType"` // MemorySizeInKiB represents the size of memory of instance. MemorySizeInKiB string `json:"memorySizeInKiB"` // IsIoOptimized represents the if instance is I/O optimized. IsIoOptimized bool `json:"isIoOptimized"` // OSType represents the OS installed in the Instance. OSType string `json:"osType"` // SystemDiskCategory represents the exact category of the system disk attached to the node. SystemDiskCategory string `json:"systemDiskCategory"` // SystemDiskSizeInGiB represents the size of the system disk attached to the node. SystemDiskSizeInGiB string `json:"systemDiskSizeInGiB"` // SystemDiskPerformanceLevel represents the performance level of the system disk attached to the node. SystemDiskPerformanceLevel string `json:"systemPerformanceLevel"` }
AlibabaNodeAttributes represents metadata about the Node in its pricing information. Basic Attributes needed atleast to get the key, Some attributes from k8s Node response be populated directly into *Node object.
func NewAlibabaNodeAttributes ¶ added in v1.99.0
func NewAlibabaNodeAttributes(node *SlimK8sNode) *AlibabaNodeAttributes
type AlibabaNodeKey ¶ added in v1.99.0
type AlibabaNodeKey struct { ProviderID string RegionID string InstanceType string OSType string OptimizedKeyword string //If IsIoOptimized is true use the word optimize in the Node key and if its not optimized use the word nonoptimize SystemDiskCategory string SystemDiskSizeInGiB string SystemDiskPerformanceLevel string }
func NewAlibabaNodeKey ¶ added in v1.99.0
func NewAlibabaNodeKey(node *SlimK8sNode, optimizedKeyword, systemDiskCategory, systemDiskSizeInGiB, systemDiskPerfromanceLevel string) *AlibabaNodeKey
func (*AlibabaNodeKey) Features ¶ added in v1.99.0
func (alibabaNodeKey *AlibabaNodeKey) Features() string
func (*AlibabaNodeKey) GPUCount ¶ added in v1.99.0
func (alibabaNodeKey *AlibabaNodeKey) GPUCount() int
func (*AlibabaNodeKey) GPUType ¶ added in v1.99.0
func (alibabaNodeKey *AlibabaNodeKey) GPUType() string
func (*AlibabaNodeKey) ID ¶ added in v1.99.0
func (alibabaNodeKey *AlibabaNodeKey) ID() string
type AlibabaPVAttributes ¶ added in v1.99.0
type AlibabaPVAttributes struct { // PVType can be Cloud Disk, NetWork Attached Storage(NAS) or Object Storage Service (OSS). // Represents the way the PV was attached PVType string `json:"pvType"` // PVSubType represent the sub category of PVType. This is Data in case of Cloud Disk. PVSubType string `json:"pvSubType"` // Example for PVCategory with cloudDisk PVType are cloud, cloud_efficiency, cloud_ssd, // ephemeral_ssd and cloud_essd. If not present returns empty. PVCategory string `json:"pvCategory"` // Example for PerformanceLevel with cloudDisk PVType are PL0,PL1,PL2 &PL3. If not present returns empty. PVPerformanceLevel string `json:"performanceLevel"` // The Size of the PV in terms of GiB SizeInGiB string `json:"sizeInGiB"` }
AlibabaPVAttributes represents metadata the PV in its pricing information. Basic Attributes needed atleast to get the keys. Some attributes from k8s PV response be populated directly into *PV object.
func NewAlibabaPVAttributes ¶ added in v1.99.0
func NewAlibabaPVAttributes(disk *SlimK8sDisk) *AlibabaPVAttributes
TO-Do: next iteration of Alibaba provider support NetWork Attached Storage(NAS) and Object Storage Service (OSS type PVs). Currently defaulting to cloudDisk with provision to add work in future.
type AlibabaPVKey ¶ added in v1.99.0
type AlibabaPVKey struct { ProviderID string RegionID string PVType string PVSubType string PVCategory string PVPerformaceLevel string StorageClassName string SizeInGiB string }
func (*AlibabaPVKey) Features ¶ added in v1.99.0
func (alibabaPVKey *AlibabaPVKey) Features() string
func (*AlibabaPVKey) GetStorageClass ¶ added in v1.99.0
func (alibabaPVKey *AlibabaPVKey) GetStorageClass() string
Get storage class information for PV.
func (*AlibabaPVKey) ID ¶ added in v1.99.0
func (alibabaPVKey *AlibabaPVKey) ID() string
type AlibabaPricing ¶ added in v1.99.0
type AlibabaPricing struct { NodeAttributes *AlibabaNodeAttributes PVAttributes *AlibabaPVAttributes PricingTerms *AlibabaPricingTerms Node *Node PV *PV }
Alibaba Pricing struct carry the Attributes and pricing information for Node or PV
type AlibabaPricingDetails ¶ added in v1.99.0
type AlibabaPricingDetails struct { // Represents hourly price for the given Alibaba cloud Product. HourlyPrice float32 `json:"hourlyPrice"` // Represents the unit in which Alibaba Product is billed can be Hour, Month or Year based on the billingMethod. PriceUnit string `json:"priceUnit"` // Original Price paid to acquire the Alibaba Product. TradePrice float32 `json:"tradePrice"` // Represents the currency unit of the price for billing Alibaba Product. CurrencyCode string `json:"currencyCode"` }
Stage 1 support will be Pay-As-You-Go with HourlyPrice equal to TradePrice with PriceUnit as Hour TO-DO: Subscription and Premptible support, Information can be gathered from describing instance for subscription type and spotprice can be gather from DescribeSpotPriceHistory API. TO-DO: how would you calculate hourly price for subscription type, is it PRICE_YEARLY/HOURS_IN_THE_YEAR|MONTH?
func NewAlibabaPricingDetails ¶ added in v1.99.0
func NewAlibabaPricingDetails(hourlyPrice float32, priceUnit string, tradePrice float32, currencyCode string) *AlibabaPricingDetails
type AlibabaPricingTerms ¶ added in v1.99.0
type AlibabaPricingTerms struct { BillingMethod string `json:"billingMethod"` PricingDetails *AlibabaPricingDetails `json:"pricingDetails"` }
AlibabaPricingTerms can have three types of supported billing method Pay-As-You-Go, Subscription and Premptible
func NewAlibabaPricingTerms ¶ added in v1.99.0
func NewAlibabaPricingTerms(billingMethod string, pricingDetails *AlibabaPricingDetails) *AlibabaPricingTerms
type AwsAthenaInfo ¶
type AwsAthenaInfo struct { AthenaBucketName string `json:"athenaBucketName"` AthenaRegion string `json:"athenaRegion"` AthenaDatabase string `json:"athenaDatabase"` AthenaTable string `json:"athenaTable"` AthenaWorkgroup string `json:"athenaWorkgroup"` ServiceKeyName string `json:"serviceKeyName"` ServiceKeySecret string `json:"serviceKeySecret"` AccountID string `json:"projectID"` MasterPayerARN string `json:"masterPayerARN"` }
AwsAthenaInfo contains configuration for CUR integration
func (*AwsAthenaInfo) CreateConfig ¶
func (aai *AwsAthenaInfo) CreateConfig() (awsSDK.Config, error)
CreateConfig creates an AWS SDK V2 Config for the credentials that it contains
func (*AwsAthenaInfo) IsEmpty ¶
func (aai *AwsAthenaInfo) IsEmpty() bool
IsEmpty returns true if all fields in config are empty, false if not.
type AwsSpotFeedInfo ¶
type AwsSpotFeedInfo struct { BucketName string `json:"bucketName"` Prefix string `json:"prefix"` Region string `json:"region"` AccountID string `json:"projectID"` ServiceKeyName string `json:"serviceKeyName"` ServiceKeySecret string `json:"serviceKeySecret"` SpotLabel string `json:"spotLabel"` SpotLabelValue string `json:"spotLabelValue"` }
AwsSpotFeedInfo contains configuration for spot feed integration
type Azure ¶
type Azure struct { Pricing map[string]*AzurePricing DownloadPricingDataLock sync.RWMutex Clientset clustercache.ClusterCache Config *ProviderConfig // contains filtered or unexported fields }
func (*Azure) AllNodePricing ¶
AllNodePricing returns the Azure pricing objects stored
func (*Azure) ApplyReservedInstancePricing ¶
func (*Azure) ClusterManagementPricing ¶
func (*Azure) CombinedDiscountForNode ¶
func (*Azure) DownloadPricingData ¶
DownloadPricingData uses provided azure "best guesses" for pricing
func (*Azure) GetAddresses ¶
func (*Azure) GetAzureStorageConfig ¶
func (az *Azure) GetAzureStorageConfig(forceReload bool, cp *CustomPricing) (*AzureStorageConfig, error)
GetAzureStorageConfig retrieves storage config from secret and sets default values
func (*Azure) GetConfig ¶
func (az *Azure) GetConfig() (*CustomPricing, error)
func (*Azure) GetLocalStorageQuery ¶
func (*Azure) GetManagementPlatform ¶
func (*Azure) GetOrphanedResources ¶ added in v1.99.0
func (az *Azure) GetOrphanedResources() ([]OrphanedResource, error)
func (*Azure) LoadBalancerPricing ¶
func (azr *Azure) LoadBalancerPricing() (*LoadBalancer, error)
LoadBalancerPricing on Azure, LoadBalancer services correspond to public IPs. For now the pricing of LoadBalancer services will be that of a standard static public IP https://azure.microsoft.com/en-us/pricing/details/ip-addresses/. Azure still has load balancers which follow the standard pricing scheme based on rules https://azure.microsoft.com/en-us/pricing/details/load-balancer/, they are created on a per-cluster basis.
func (*Azure) NetworkPricing ¶
Stubbed NetworkPricing for Azure. Pull directly from azure.json for now
func (*Azure) NodePricing ¶
NodePricing returns Azure pricing data for a single node
func (*Azure) PricingSourceStatus ¶
func (az *Azure) PricingSourceStatus() map[string]*PricingSource
PricingSourceStatus returns the status of the rate card api
func (*Azure) PricingSourceSummary ¶ added in v1.102.0
func (az *Azure) PricingSourceSummary() interface{}
PricingSourceSummary returns the pricing source summary for the provider. The summary represents what was _parsed_ from the pricing source, not everything that was _available_ in the pricing source.
func (*Azure) ServiceAccountStatus ¶
func (az *Azure) ServiceAccountStatus() *ServiceAccountStatus
func (*Azure) UpdateConfig ¶
func (*Azure) UpdateConfigFromConfigMap ¶
func (az *Azure) UpdateConfigFromConfigMap(a map[string]string) (*CustomPricing, error)
type AzureAppKey ¶
type AzureAppKey struct { AppID string `json:"appId"` DisplayName string `json:"displayName"` Name string `json:"name"` Password string `json:"password"` Tenant string `json:"tenant"` }
Represents an azure app key
type AzurePricing ¶
AzurePricing either contains a Node or PV
type AzureRetailPricing ¶
type AzureRetailPricing struct { BillingCurrency string `json:"BillingCurrency"` CustomerEntityId string `json:"CustomerEntityId"` CustomerEntityType string `json:"CustomerEntityType"` Items []AzureRetailPricingAttributes `json:"Items"` NextPageLink string `json:"NextPageLink"` Count int `json:"Count"` }
AzureRetailPricing struct for unmarshalling Azure Retail pricing api JSON response
type AzureRetailPricingAttributes ¶
type AzureRetailPricingAttributes struct { CurrencyCode string `json:"currencyCode"` TierMinimumUnits float32 `json:"tierMinimumUnits"` RetailPrice float32 `json:"retailPrice"` UnitPrice float32 `json:"unitPrice"` ArmRegionName string `json:"armRegionName"` Location string `json:"location"` EffectiveStartDate *time.Time `json:"effectiveStartDate"` EffectiveEndDate *time.Time `json:"effectiveEndDate"` MeterId string `json:"meterId"` MeterName string `json:"meterName"` ProductId string `json:"productId"` SkuId string `json:"skuId"` ProductName string `json:"productName"` SkuName string `json:"skuName"` ServiceName string `json:"serviceName"` ServiceId string `json:"serviceId"` ServiceFamily string `json:"serviceFamily"` UnitOfMeasure string `json:"unitOfMeasure"` Type string `json:"type"` IsPrimaryMeterRegion bool `json:"isPrimaryMeterRegion"` ArmSkuName string `json:"armSkuName"` }
AzureRetailPricingAttributes struct for unmarshalling Azure Retail pricing api JSON response
type AzureServiceKey ¶
type AzureServiceKey struct { SubscriptionID string `json:"subscriptionId"` ServiceKey *AzureAppKey `json:"serviceKey"` }
Azure service key for a specific subscription
func (*AzureServiceKey) IsValid ¶
func (ask *AzureServiceKey) IsValid() bool
Validity check on service key
type AzureStorageConfig ¶
type AzureStorageConfig struct { SubscriptionId string `json:"azureSubscriptionID"` AccountName string `json:"azureStorageAccount"` AccessKey string `json:"azureStorageAccessKey"` ContainerName string `json:"azureStorageContainer"` ContainerPath string `json:"azureContainerPath"` AzureCloud string `json:"azureCloud"` }
AzureStorageConfig Represents an azure storage config
func (*AzureStorageConfig) IsEmpty ¶
func (asc *AzureStorageConfig) IsEmpty() bool
IsEmpty returns true if all fields in config are empty, false if not.
type BigQueryConfig ¶
type BigQueryConfig struct { ProjectID string `json:"projectID"` BillingDataDataset string `json:"billingDataDataset"` Key map[string]string `json:"key"` }
BigQueryConfig contain the required config and credentials to access OOC resources for GCP
func (*BigQueryConfig) IsEmpty ¶
func (bqc *BigQueryConfig) IsEmpty() bool
IsEmpty returns true if all fields in config are empty, false if not.
type CSVProvider ¶
type CSVProvider struct { *CustomProvider CSVLocation string Pricing map[string]*price NodeClassPricing map[string]float64 NodeClassCount map[string]float64 NodeMapField string PricingPV map[string]*price PVMapField string GPUClassPricing map[string]*price GPUMapFields []string // Fields in a node's labels that represent the GPU class. UsesRegion bool DownloadPricingDataLock sync.RWMutex }
func (*CSVProvider) ClusterManagementPricing ¶
func (*CSVProvider) ClusterManagementPricing() (string, float64, error)
func (*CSVProvider) CombinedDiscountForNode ¶
func (c *CSVProvider) CombinedDiscountForNode(instanceType string, isPreemptible bool, defaultDiscount, negotiatedDiscount float64) float64
func (*CSVProvider) DownloadPricingData ¶
func (c *CSVProvider) DownloadPricingData() error
func (*CSVProvider) GetPVKey ¶
func (c *CSVProvider) GetPVKey(pv *v1.PersistentVolume, parameters map[string]string, defaultRegion string) PVKey
func (*CSVProvider) NodePricing ¶
func (c *CSVProvider) NodePricing(key Key) (*Node, error)
func (*CSVProvider) PricingSourceSummary ¶ added in v1.102.0
func (c *CSVProvider) PricingSourceSummary() interface{}
func (*CSVProvider) Regions ¶
func (c *CSVProvider) Regions() []string
func (*CSVProvider) ServiceAccountStatus ¶
func (c *CSVProvider) ServiceAccountStatus() *ServiceAccountStatus
type CustomPricing ¶
type CustomPricing struct { Provider string `json:"provider"` Description string `json:"description"` // CPU a string-encoded float describing cost per core-hour of CPU. CPU string `json:"CPU"` // CPU a string-encoded float describing cost per core-hour of CPU for spot // nodes. SpotCPU string `json:"spotCPU"` // RAM a string-encoded float describing cost per GiB-hour of RAM/memory. RAM string `json:"RAM"` // SpotRAM a string-encoded float describing cost per GiB-hour of RAM/memory // for spot nodes. SpotRAM string `json:"spotRAM"` GPU string `json:"GPU"` SpotGPU string `json:"spotGPU"` // Storage is a string-encoded float describing cost per GB-hour of storage // (e.g. PV, disk) resources. Storage string `json:"storage"` ZoneNetworkEgress string `json:"zoneNetworkEgress"` RegionNetworkEgress string `json:"regionNetworkEgress"` InternetNetworkEgress string `json:"internetNetworkEgress"` FirstFiveForwardingRulesCost string `json:"firstFiveForwardingRulesCost"` AdditionalForwardingRuleCost string `json:"additionalForwardingRuleCost"` LBIngressDataCost string `json:"LBIngressDataCost"` SpotLabel string `json:"spotLabel,omitempty"` SpotLabelValue string `json:"spotLabelValue,omitempty"` GpuLabel string `json:"gpuLabel,omitempty"` GpuLabelValue string `json:"gpuLabelValue,omitempty"` ServiceKeyName string `json:"awsServiceKeyName,omitempty"` ServiceKeySecret string `json:"awsServiceKeySecret,omitempty"` AlibabaServiceKeyName string `json:"alibabaServiceKeyName,omitempty"` AlibabaServiceKeySecret string `json:"alibabaServiceKeySecret,omitempty"` AlibabaClusterRegion string `json:"alibabaClusterRegion,omitempty"` SpotDataRegion string `json:"awsSpotDataRegion,omitempty"` SpotDataBucket string `json:"awsSpotDataBucket,omitempty"` SpotDataPrefix string `json:"awsSpotDataPrefix,omitempty"` ProjectID string `json:"projectID,omitempty"` AthenaProjectID string `json:"athenaProjectID,omitempty"` AthenaBucketName string `json:"athenaBucketName"` AthenaRegion string `json:"athenaRegion"` AthenaDatabase string `json:"athenaDatabase"` AthenaTable string `json:"athenaTable"` AthenaWorkgroup string `json:"athenaWorkgroup"` MasterPayerARN string `json:"masterPayerARN"` BillingDataDataset string `json:"billingDataDataset,omitempty"` CustomPricesEnabled string `json:"customPricesEnabled"` DefaultIdle string `json:"defaultIdle"` AzureSubscriptionID string `json:"azureSubscriptionID"` AzureClientID string `json:"azureClientID"` AzureClientSecret string `json:"azureClientSecret"` AzureTenantID string `json:"azureTenantID"` AzureBillingRegion string `json:"azureBillingRegion"` AzureBillingAccount string `json:"azureBillingAccount"` AzureOfferDurableID string `json:"azureOfferDurableID"` AzureStorageSubscriptionID string `json:"azureStorageSubscriptionID"` AzureStorageAccount string `json:"azureStorageAccount"` AzureStorageAccessKey string `json:"azureStorageAccessKey"` AzureStorageContainer string `json:"azureStorageContainer"` AzureContainerPath string `json:"azureContainerPath"` AzureCloud string `json:"azureCloud"` CurrencyCode string `json:"currencyCode"` Discount string `json:"discount"` NegotiatedDiscount string `json:"negotiatedDiscount"` ClusterName string `json:"clusterName"` ClusterAccountID string `json:"clusterAccount,omitempty"` ReadOnly string `json:"readOnly"` EditorAccess string `json:"editorAccess"` KubecostToken string `json:"kubecostToken"` GoogleAnalyticsTag string `json:"googleAnalyticsTag"` ExcludeProviderID string `json:"excludeProviderID"` DefaultLBPrice string `json:"defaultLBPrice"` }
func DefaultPricing ¶
func DefaultPricing() *CustomPricing
DefaultPricing should be returned so we can do computation even if no file is supplied.
func ReturnPricingFromConfigs ¶ added in v1.103.0
func ReturnPricingFromConfigs(filename string) (*CustomPricing, error)
ReturnPricingFromConfigs is a safe function to return pricing from configs of opensource to the closed source before defaulting it with the above function DefaultPricing
func (*CustomPricing) GetSharedOverheadCostPerMonth ¶
func (cp *CustomPricing) GetSharedOverheadCostPerMonth() float64
GetSharedOverheadCostPerMonth parses and returns a float64 representation of the configured monthly shared overhead cost. If the string version cannot be parsed into a float, an error is logged and 0.0 is returned.
type CustomProvider ¶
type CustomProvider struct { Clientset clustercache.ClusterCache Pricing map[string]*NodePrice SpotLabel string SpotLabelValue string GPULabel string GPULabelValue string DownloadPricingDataLock sync.RWMutex Config *ProviderConfig // contains filtered or unexported fields }
func (*CustomProvider) AllNodePricing ¶
func (cp *CustomProvider) AllNodePricing() (interface{}, error)
func (*CustomProvider) ApplyReservedInstancePricing ¶
func (*CustomProvider) ApplyReservedInstancePricing(nodes map[string]*Node)
func (*CustomProvider) ClusterInfo ¶
func (cp *CustomProvider) ClusterInfo() (map[string]string, error)
func (*CustomProvider) ClusterManagementPricing ¶
func (*CustomProvider) ClusterManagementPricing() (string, float64, error)
func (*CustomProvider) CombinedDiscountForNode ¶
func (cp *CustomProvider) CombinedDiscountForNode(instanceType string, isPreemptible bool, defaultDiscount, negotiatedDiscount float64) float64
func (*CustomProvider) DownloadPricingData ¶
func (cp *CustomProvider) DownloadPricingData() error
func (*CustomProvider) ExternalAllocations ¶
func (*CustomProvider) ExternalAllocations(start string, end string, aggregator []string, filterType string, filterValue string, crossCluster bool) ([]*OutOfClusterAllocation, error)
ExternalAllocations represents tagged assets outside the scope of kubernetes. "start" and "end" are dates of the format YYYY-MM-DD "aggregator" is the tag used to determine how to allocate those assets, ie namespace, pod, etc.
func (*CustomProvider) GetAddresses ¶
func (*CustomProvider) GetAddresses() ([]byte, error)
func (*CustomProvider) GetConfig ¶
func (cp *CustomProvider) GetConfig() (*CustomPricing, error)
func (*CustomProvider) GetDisks ¶
func (*CustomProvider) GetDisks() ([]byte, error)
func (*CustomProvider) GetLocalStorageQuery ¶
func (*CustomProvider) GetManagementPlatform ¶
func (*CustomProvider) GetManagementPlatform() (string, error)
func (*CustomProvider) GetOrphanedResources ¶ added in v1.99.0
func (*CustomProvider) GetOrphanedResources() ([]OrphanedResource, error)
func (*CustomProvider) GetPVKey ¶
func (*CustomProvider) GetPVKey(pv *v1.PersistentVolume, parameters map[string]string, defaultRegion string) PVKey
func (*CustomProvider) LoadBalancerPricing ¶
func (cp *CustomProvider) LoadBalancerPricing() (*LoadBalancer, error)
func (*CustomProvider) NetworkPricing ¶
func (cp *CustomProvider) NetworkPricing() (*Network, error)
func (*CustomProvider) NodePricing ¶
func (cp *CustomProvider) NodePricing(key Key) (*Node, error)
func (*CustomProvider) PricingSourceStatus ¶
func (cp *CustomProvider) PricingSourceStatus() map[string]*PricingSource
func (*CustomProvider) PricingSourceSummary ¶ added in v1.102.0
func (cp *CustomProvider) PricingSourceSummary() interface{}
PricingSourceSummary returns the pricing source summary for the provider. The summary represents what was _parsed_ from the pricing source, not what was returned from the relevant API.
func (*CustomProvider) Regions ¶
func (cp *CustomProvider) Regions() []string
func (*CustomProvider) ServiceAccountStatus ¶
func (cp *CustomProvider) ServiceAccountStatus() *ServiceAccountStatus
func (*CustomProvider) UpdateConfig ¶
func (cp *CustomProvider) UpdateConfig(r io.Reader, updateType string) (*CustomPricing, error)
func (*CustomProvider) UpdateConfigFromConfigMap ¶
func (cp *CustomProvider) UpdateConfigFromConfigMap(a map[string]string) (*CustomPricing, error)
type DescribeDiskResponse ¶ added in v1.99.0
type DescribePriceResponse ¶ added in v1.99.0
type GCP ¶
type GCP struct { Pricing map[string]*GCPPricing Clientset clustercache.ClusterCache APIKey string BaseCPUPrice string ProjectID string BillingDataDataset string DownloadPricingDataLock sync.RWMutex ReservedInstances []*GCPReservedInstance Config *ProviderConfig ServiceKeyProvided bool ValidPricingKeys map[string]bool *CustomProvider // contains filtered or unexported fields }
GCP implements a provider interface for GCP
func (*GCP) AllNodePricing ¶
AllNodePricing returns the GCP pricing objects stored
func (*GCP) ApplyReservedInstancePricing ¶
func (*GCP) ClusterInfo ¶
ClusterInfo returns information on the GKE cluster, as provided by metadata.
func (*GCP) ClusterManagementPricing ¶
func (*GCP) CombinedDiscountForNode ¶
func (*GCP) DownloadPricingData ¶
DownloadPricingData fetches data from the GCP Pricing API. Requires a key-- a kubecost key is provided for quickstart, but should be replaced by a users.
func (*GCP) GetAddresses ¶
func (*GCP) GetConfig ¶
func (gcp *GCP) GetConfig() (*CustomPricing, error)
func (*GCP) GetDisks ¶
GetDisks returns the GCP disks backing PVs. Useful because sometimes k8s will not clean up PVs correctly. Requires a json config in /var/configs with key region.
func (*GCP) GetLocalStorageQuery ¶
GetLocalStorageQuery returns the cost of local storage for the given window. Setting rate=true returns hourly spend. Setting used=true only tracks used storage, not total.
func (*GCP) GetManagementPlatform ¶
func (*GCP) GetOrphanedResources ¶ added in v1.99.0
func (gcp *GCP) GetOrphanedResources() ([]OrphanedResource, error)
func (*GCP) LoadBalancerPricing ¶
func (gcp *GCP) LoadBalancerPricing() (*LoadBalancer, error)
func (*GCP) NetworkPricing ¶
Stubbed NetworkPricing for GCP. Pull directly from gcp.json for now
func (*GCP) NodePricing ¶
NodePricing returns GCP pricing data for a single node
func (*GCP) PricingSourceStatus ¶
func (gcp *GCP) PricingSourceStatus() map[string]*PricingSource
func (*GCP) PricingSourceSummary ¶ added in v1.102.0
func (gcp *GCP) PricingSourceSummary() interface{}
PricingSourceSummary returns the pricing source summary for the provider. The summary represents what was _parsed_ from the pricing source, not everything that was _available_ in the pricing source.
func (*GCP) ServiceAccountStatus ¶
func (gcp *GCP) ServiceAccountStatus() *ServiceAccountStatus
func (*GCP) UpdateConfig ¶
func (*GCP) UpdateConfigFromConfigMap ¶
func (gcp *GCP) UpdateConfigFromConfigMap(a map[string]string) (*CustomPricing, error)
type GCPPricing ¶
type GCPPricing struct { Name string `json:"name"` SKUID string `json:"skuId"` Description string `json:"description"` Category *GCPResourceInfo `json:"category"` ServiceRegions []string `json:"serviceRegions"` PricingInfo []*PricingInfo `json:"pricingInfo"` ServiceProviderName string `json:"serviceProviderName"` Node *Node `json:"node"` PV *PV `json:"pv"` }
GCPPricing represents GCP pricing data for a SKU
type GCPReservedCounter ¶
type GCPReservedCounter struct { RemainingCPU int64 RemainingRAM int64 Instance *GCPReservedInstance }
type GCPReservedInstance ¶
type GCPReservedInstance struct { ReservedRAM int64 ReservedCPU int64 Plan *GCPReservedInstancePlan StartDate time.Time EndDate time.Time Region string }
func (*GCPReservedInstance) String ¶
func (r *GCPReservedInstance) String() string
type GCPReservedInstancePlan ¶
type GCPResourceInfo ¶
type GCPResourceInfo struct { ServiceDisplayName string `json:"serviceDisplayName"` ResourceFamily string `json:"resourceFamily"` ResourceGroup string `json:"resourceGroup"` UsageType string `json:"usageType"` }
GCPResourceInfo contains metadata about the node.
type Key ¶
type Key interface { ID() string // ID represents an exact match Features() string // Features are a comma separated string of node metadata that could match pricing GPUType() string // GPUType returns "" if no GPU exists or GPUs, but the name of the GPU otherwise GPUCount() int // GPUCount returns 0 if no GPU exists or GPUs, but the number of attached GPUs otherwise }
Key represents a way for nodes to match between the k8s API and a pricing API
type LoadBalancer ¶
type LoadBalancer struct { IngressIPAddresses []string `json:"IngressIPAddresses"` Cost float64 `json:"hourlyCost"` }
LoadBalancer is the interface by which the provider and cost model communicate LoadBalancer prices. The provider will best-effort try to fill out this struct.
type Network ¶
type Network struct { ZoneNetworkEgressCost float64 RegionNetworkEgressCost float64 InternetNetworkEgressCost float64 }
Network is the interface by which the provider and cost model communicate network egress prices. The provider will best-effort try to fill out this struct.
type Node ¶
type Node struct { Cost string `json:"hourlyCost"` VCPU string `json:"CPU"` VCPUCost string `json:"CPUHourlyCost"` RAM string `json:"RAM"` RAMBytes string `json:"RAMBytes"` RAMCost string `json:"RAMGBHourlyCost"` Storage string `json:"storage"` StorageCost string `json:"storageHourlyCost"` UsesBaseCPUPrice bool `json:"usesDefaultPrice"` BaseCPUPrice string `json:"baseCPUPrice"` // Used to compute an implicit RAM GB/Hr price when RAM pricing is not provided. BaseRAMPrice string `json:"baseRAMPrice"` // Used to compute an implicit RAM GB/Hr price when RAM pricing is not provided. BaseGPUPrice string `json:"baseGPUPrice"` UsageType string `json:"usageType"` GPU string `json:"gpu"` // GPU represents the number of GPU on the instance GPUName string `json:"gpuName"` GPUCost string `json:"gpuCost"` InstanceType string `json:"instanceType,omitempty"` Region string `json:"region,omitempty"` Reserved *ReservedInstanceData `json:"reserved,omitempty"` ProviderID string `json:"providerID,omitempty"` PricingType PricingType `json:"pricingType,omitempty"` }
Node is the interface by which the provider and cost model communicate Node prices. The provider will best-effort try to fill out this struct.
type OrphanedResource ¶ added in v1.99.0
type OrphanedResource struct { Kind string `json:"resourceKind"` Region string `json:"region"` Description map[string]string `json:"description"` Size *int64 `json:"diskSizeInGB,omitempty"` DiskName string `json:"diskName,omitempty"` Url string `json:"url"` Address string `json:"ipAddress,omitempty"` MonthlyCost *float64 `json:"monthlyCost"` }
type OutOfClusterAllocation ¶
type OutOfClusterAllocation struct { Aggregator string `json:"aggregator"` Environment string `json:"environment"` Service string `json:"service"` Cost float64 `json:"cost"` Cluster string `json:"cluster"` }
OutOfClusterAllocation represents a cloud provider cost not associated with kubernetes
type PV ¶
type PV struct { Cost string `json:"hourlyCost"` CostPerIO string `json:"costPerIOOperation"` Class string `json:"storageClass"` Size string `json:"size"` Region string `json:"region"` ProviderID string `json:"providerID,omitempty"` Parameters map[string]string `json:"parameters"` }
PV is the interface by which the provider and cost model communicate PV prices. The provider will best-effort try to fill out this struct.
type Price ¶ added in v1.99.0
type Price struct { OriginalPrice float32 `json:"OriginalPrice"` ReservedInstanceHourPrice float32 `json:"ReservedInstanceHourPrice"` DiscountPrice float32 `json:"DiscountPrice"` Currency string `json:"Currency"` TradePrice float32 `json:"TradePrice"` }
Below structs are used to unmarshal json response of Alibaba cloud's API DescribePrice
type PricingExpression ¶
type PricingExpression struct { UsageUnit string `json:"usageUnit"` UsageUnitDescription string `json:"usageUnitDescription"` BaseUnit string `json:"baseUnit"` BaseUnitConversionFactor int64 `json:"-"` DisplayQuantity int `json:"displayQuantity"` TieredRates []*TieredRates `json:"tieredRates"` }
PricingExpression contains metadata about a cost.
type PricingInfo ¶
type PricingInfo struct { Summary string `json:"summary"` PricingExpression *PricingExpression `json:"pricingExpression"` CurrencyConversionRate float64 `json:"currencyConversionRate"` EffectiveTime string `json:""` }
PricingInfo contains metadata about a cost.
type PricingMatchMetadata ¶
type PricingMatchMetadata struct { TotalNodes int `json:"TotalNodes"` PricingTypeCounts map[PricingType]int `json:"PricingType"` }
type PricingSource ¶
type PricingSources ¶
type PricingSources struct {
PricingSources map[string]*PricingSource
}
type PricingType ¶
type PricingType string
const ( Api PricingType = "api" Spot PricingType = "spot" Reserved PricingType = "reserved" SavingsPlan PricingType = "savingsPlan" CsvExact PricingType = "csvExact" CsvClass PricingType = "csvClass" DefaultPrices PricingType = "defaultPrices" )
type Provider ¶
type Provider interface { ClusterInfo() (map[string]string, error) GetAddresses() ([]byte, error) GetDisks() ([]byte, error) GetOrphanedResources() ([]OrphanedResource, error) NodePricing(Key) (*Node, error) PVPricing(PVKey) (*PV, error) NetworkPricing() (*Network, error) // TODO: add key interface arg for dynamic price fetching LoadBalancerPricing() (*LoadBalancer, error) // TODO: add key interface arg for dynamic price fetching AllNodePricing() (interface{}, error) DownloadPricingData() error GetKey(map[string]string, *v1.Node) Key GetPVKey(*v1.PersistentVolume, map[string]string, string) PVKey UpdateConfig(r io.Reader, updateType string) (*CustomPricing, error) UpdateConfigFromConfigMap(map[string]string) (*CustomPricing, error) GetConfig() (*CustomPricing, error) GetManagementPlatform() (string, error) GetLocalStorageQuery(time.Duration, time.Duration, bool, bool) string ApplyReservedInstancePricing(map[string]*Node) ServiceAccountStatus() *ServiceAccountStatus PricingSourceStatus() map[string]*PricingSource ClusterManagementPricing() (string, float64, error) CombinedDiscountForNode(string, bool, float64, float64) float64 Regions() []string PricingSourceSummary() interface{} }
Provider represents a k8s provider.
func NewProvider ¶
func NewProvider(cache clustercache.ClusterCache, apiKey string, config *config.ConfigFileManager) (Provider, error)
NewProvider looks at the nodespec or provider metadata server to decide which provider to instantiate.
type ProviderConfig ¶
type ProviderConfig struct {
// contains filtered or unexported fields
}
ProviderConfig is a utility class that provides a thread-safe configuration storage/cache for all Provider implementations
func NewProviderConfig ¶
func NewProviderConfig(configManager *config.ConfigFileManager, fileName string) *ProviderConfig
NewProviderConfig creates a new ConfigFile and returns the ProviderConfig
func (*ProviderConfig) ConfigFileManager ¶
func (pc *ProviderConfig) ConfigFileManager() *config.ConfigFileManager
ConfigFileManager returns the ConfigFileManager instance used to manage the CustomPricing configuration. In the event of a multi-provider setup, this instance should be used to configure any other configuration providers.
func (*ProviderConfig) GetCustomPricingData ¶
func (pc *ProviderConfig) GetCustomPricingData() (*CustomPricing, error)
ThreadSafe method for retrieving the custom pricing config.
func (*ProviderConfig) Update ¶
func (pc *ProviderConfig) Update(updateFunc func(*CustomPricing) error) (*CustomPricing, error)
Allows a call to manually update the configuration while maintaining proper thread-safety for read/write methods.
func (*ProviderConfig) UpdateFromMap ¶
func (pc *ProviderConfig) UpdateFromMap(a map[string]string) (*CustomPricing, error)
ThreadSafe update of the config using a string map
type ReservedInstanceData ¶
type ReservedInstanceData struct { ReservedCPU int64 `json:"reservedCPU"` ReservedRAM int64 `json:"reservedRAM"` CPUCost float64 `json:"CPUHourlyCost"` RAMCost float64 `json:"RAMHourlyCost"` }
ReservedInstanceData keeps record of resources on a node should be priced at reserved rates
type SavingsPlanData ¶
type Scaleway ¶ added in v1.97.0
type Scaleway struct { Clientset clustercache.ClusterCache Config *ProviderConfig Pricing map[string]*ScalewayPricing DownloadPricingDataLock sync.RWMutex // contains filtered or unexported fields }
func (*Scaleway) AllNodePricing ¶ added in v1.97.0
func (*Scaleway) ApplyReservedInstancePricing ¶ added in v1.97.0
func (*Scaleway) ClusterInfo ¶ added in v1.97.0
func (*Scaleway) ClusterManagementPricing ¶ added in v1.97.0
func (*Scaleway) CombinedDiscountForNode ¶ added in v1.97.0
func (*Scaleway) DownloadPricingData ¶ added in v1.97.0
func (*Scaleway) GetAddresses ¶ added in v1.97.0
func (*Scaleway) GetConfig ¶ added in v1.97.0
func (scw *Scaleway) GetConfig() (*CustomPricing, error)
func (*Scaleway) GetLocalStorageQuery ¶ added in v1.97.0
func (*Scaleway) GetManagementPlatform ¶ added in v1.97.0
func (*Scaleway) GetOrphanedResources ¶ added in v1.99.0
func (*Scaleway) GetOrphanedResources() ([]OrphanedResource, error)
func (*Scaleway) LoadBalancerPricing ¶ added in v1.97.0
func (c *Scaleway) LoadBalancerPricing() (*LoadBalancer, error)
func (*Scaleway) NetworkPricing ¶ added in v1.97.0
func (*Scaleway) NodePricing ¶ added in v1.97.0
func (*Scaleway) PricingSourceStatus ¶ added in v1.97.0
func (c *Scaleway) PricingSourceStatus() map[string]*PricingSource
func (*Scaleway) PricingSourceSummary ¶ added in v1.102.0
func (c *Scaleway) PricingSourceSummary() interface{}
PricingSourceSummary returns the pricing source summary for the provider. The summary represents what was _parsed_ from the pricing source, not everything that was _available_ in the pricing source.
func (*Scaleway) ServiceAccountStatus ¶ added in v1.97.0
func (c *Scaleway) ServiceAccountStatus() *ServiceAccountStatus
func (*Scaleway) UpdateConfig ¶ added in v1.97.0
func (*Scaleway) UpdateConfigFromConfigMap ¶ added in v1.97.0
func (c *Scaleway) UpdateConfigFromConfigMap(a map[string]string) (*CustomPricing, error)
type ScalewayPricing ¶ added in v1.97.0
type ServiceAccountCheck ¶
type ServiceAccountChecks ¶
ServiceAccountChecks is a thread safe map for holding ServiceAccountCheck objects
func NewServiceAccountChecks ¶
func NewServiceAccountChecks() *ServiceAccountChecks
NewServiceAccountChecks initialize ServiceAccountChecks
type ServiceAccountStatus ¶
type ServiceAccountStatus struct {
Checks []*ServiceAccountCheck `json:"checks"`
}
type SlimK8sDisk ¶ added in v1.99.0
type SlimK8sDisk struct { DiskType string RegionID string PriceUnit string SizeInGiB string DiskCategory string PerformanceLevel string ProviderID string StorageClass string }
Slim Version of k8s disk assigned to a node or PV.
func NewSlimK8sDisk ¶ added in v1.99.0
func NewSlimK8sDisk(diskType, regionID, priceUnit, diskCategory, performanceLevel, providerID, storageClass, sizeInGiB string) *SlimK8sDisk
type SlimK8sNode ¶ added in v1.99.0
type SlimK8sNode struct { InstanceType string RegionID string PriceUnit string MemorySizeInKiB string // TO-DO : Possible to convert to float? IsIoOptimized bool OSType string ProviderID string SystemDisk *SlimK8sDisk InstanceTypeFamily string // Bug in DescribePrice, doesn't default to enhanced type correctly and you get an error in DescribePrice to get around need the family of the InstanceType. }
Slim version of a k8s v1.node just to pass along the object of this struct instead of constant getting the labels from within v1.Node & unit testing.
func NewSlimK8sNode ¶ added in v1.99.0
func NewSlimK8sNode(instanceType, regionID, priceUnit, memorySizeInKiB, osType, providerID, instanceTypeFamily string, isIOOptimized bool, systemDiskInfo *SlimK8sDisk) *SlimK8sNode
type TieredRates ¶
type TieredRates struct { StartUsageAmount int `json:"startUsageAmount"` UnitPrice *UnitPriceInfo `json:"unitPrice"` }
TieredRates contain data about variable pricing.
type UnitPriceInfo ¶
type UnitPriceInfo struct { CurrencyCode string `json:"currencyCode"` Units string `json:"units"` Nanos float64 `json:"nanos"` }
UnitPriceInfo contains data about the actual price being charged.