qcloud

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2022 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// https://cloud.tencent.com/document/product/457/53030
	ValueNodeTypeEKLet = "eklet"

	EKSAnnoCpuType     = "eks.tke.cloud.tencent.com/cpu-type"
	EKSAnnoCpuQuantity = "eks.tke.cloud.tencent.com/cpu"
	EKSAnnoMemQuantity = "eks.tke.cloud.tencent.com/mem"
	EKSAnnoGpuType     = "eks.tke.cloud.tencent.com/gpu-type"
	EKSAnnoGpuCount    = "eks.tke.cloud.tencent.com/gpu-count"

	EKSCpuTypeValue_Intel = "intel"
)

Variables

View Source
var QCloudProviderIdRegex = regexp.MustCompile("qcloud:///([^/]+)/([^/]+)") // It's of the form qcloud:///800005/ins-2jv4wpmr and we want ins-2jv4wpmr, if it exists

Functions

func CloudPodSpec2EKSPriceRequest

func CloudPodSpec2EKSPriceRequest(spec spec.CloudPodSpec) *tke.GetPriceRequest

func EKSPodCpuType

func EKSPodCpuType(pod *v1.Pod) string

func EKSPodCpuValue

func EKSPodCpuValue(pod *v1.Pod) (bool, string)

func EKSPodGpuCount

func EKSPodGpuCount(pod *v1.Pod) (bool, string)

func EKSPodGpuType

func EKSPodGpuType(pod *v1.Pod) (bool, string)

func EKSPodMemValue

func EKSPodMemValue(pod *v1.Pod) (bool, string)

func NewTencentCloud

func NewTencentCloud(qcloudConf *qcloudsdk.QCloudClientConfig, config *cloud.PriceConfig, cache cache.Cache) cloud.Cloud

func ParseID

func ParseID(id string) string

providerID: qcloud:///800005/ins-2jv4wpmr

Types

type ClientProfile

type ClientProfile struct {
	Debug                 bool
	DefaultLimit          int64
	DefaultLanguage       string
	DefaultTimeoutSeconds int
	Region                string
	DomainSuffix          string
	Scheme                string
}

type CloudConfig

type CloudConfig struct {
	Credentials   `name:"credentials" value:"optional"`
	ClientProfile `name:"clientProfile" value:"optional"`
}

type Credentials

type Credentials struct {
	ClusterId string
	AppId     string
	SecretId  string
	SecretKey string
}

Credentials use user defined SecretId and SecretKey

type EKSPlatform

type EKSPlatform struct {
}

func (*EKSPlatform) PlatformCost

func (ep *EKSPlatform) PlatformCost(cp cloud.PlatformParameter) *cloud.Prices

no platform cost now for eks

type Pod2EKSSpecConverter

type Pod2EKSSpecConverter interface {
	Pod2EKSSpecConverter(pod *v1.Pod) (v1.ResourceList, error)
}

type PriceStageFeeUnit

type PriceStageFeeUnit struct {
	Nodes       int32
	PriceHourly float64
}

type TKEPlatform

type TKEPlatform struct {
}

func (*TKEPlatform) PlatformCost

func (tp *TKEPlatform) PlatformCost(cp cloud.PlatformParameter) *cloud.Prices

type TencentCloud

type TencentCloud struct {
	// contains filtered or unexported fields
}

func (*TencentCloud) GetConfig

func (tc *TencentCloud) GetConfig() (*cloud.CustomPricing, error)

GetConfig return CustomPricing

func (*TencentCloud) GetInstancePrice

func (pc *TencentCloud) GetInstancePrice(instanceid string) *sdkcvm.QCloudInstancePrice

func (*TencentCloud) GetKey

func (tc *TencentCloud) GetKey(node *v1.Node) *qcloudKey

func (*TencentCloud) GetNodesCost

func (tc *TencentCloud) GetNodesCost() (map[string]*cloud.Node, error)

func (*TencentCloud) GetNodesPricing

func (tc *TencentCloud) GetNodesPricing() (map[string]*cloud.Price, error)

func (*TencentCloud) GetPodsCost

func (tc *TencentCloud) GetPodsCost() (map[string]*cloud.Pod, error)

func (*TencentCloud) IsServerlessPod

func (tc *TencentCloud) IsServerlessPod(pod *v1.Pod) bool

func (*TencentCloud) IsVirtualNode

func (tc *TencentCloud) IsVirtualNode(node *v1.Node) bool

func (*TencentCloud) Node2Spec

func (tc *TencentCloud) Node2Spec(node *v1.Node) spec.CloudNodeSpec

func (*TencentCloud) NodePrice

func (tc *TencentCloud) NodePrice(spec spec.CloudNodeSpec) (*cloud.Node, error)

func (*TencentCloud) OnNodeAdd

func (pc *TencentCloud) OnNodeAdd(node *v1.Node) error

func (*TencentCloud) OnNodeDelete

func (pc *TencentCloud) OnNodeDelete(node *v1.Node) error

func (*TencentCloud) OnNodeUpdate

func (pc *TencentCloud) OnNodeUpdate(old, new *v1.Node) error

func (*TencentCloud) PlatformPrice

func (q *TencentCloud) PlatformPrice(cp cloud.PlatformParameter) *cloud.Prices

func (*TencentCloud) Pod2ServerlessSpec

func (tc *TencentCloud) Pod2ServerlessSpec(pod *v1.Pod) spec.CloudPodSpec

convert pod to serverless pod spec, no matter the pod is in real node or virtual node.

func (*TencentCloud) Pod2Spec

func (tc *TencentCloud) Pod2Spec(pod *v1.Pod) spec.CloudPodSpec

func (*TencentCloud) PodPrice

func (tc *TencentCloud) PodPrice(spec spec.CloudPodSpec) (*cloud.Pod, error)

func (*TencentCloud) Refresh

func (pc *TencentCloud) Refresh()

func (*TencentCloud) ServerlessPodPrice

func (tc *TencentCloud) ServerlessPodPrice(spec spec.CloudPodSpec) (*cloud.Pod, error)

func (*TencentCloud) UpdateConfigFromConfigMap

func (tc *TencentCloud) UpdateConfigFromConfigMap(conf map[string]string) (*cloud.CustomPricing, error)

UpdateConfigFromConfigMap update CustomPricing from configmap

func (*TencentCloud) WarmUp

func (tc *TencentCloud) WarmUp() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL