aliyun

package
v0.0.0-...-4d19ac6 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultVcManagerNs = "vc-manager"

	// AliyunAkSrt for key name
	AliyunAkSrt = "aliyun-accesskey"
	// AliyunAKIDName for keyID
	AliyunAKIDName = "accessKeyID"
	// AliyunAKSecretName for key secret
	AliyunAKSecretName = "accessKeySecret"

	// AliyunASKConfigMap for ask config
	AliyunASKConfigMap = "aliyun-ask-config"
	// AliyunASKCfgMpRegionID for regionID
	AliyunASKCfgMpRegionID = "askRegionID"
	// AliyunASKCfgMpZoneID for zoneID
	AliyunASKCfgMpZoneID = "askZoneID"
	// AliyunASKCfgMpVPCID for VpcID
	AliyunASKCfgMpVPCID = "askVpcID"
	// AliyunASKCfgMpVSID for VswitchID
	AliyunASKCfgMpVSID = "askVswitchID"
	// AliyunASKCfgMpPrivateCfg for PrivateCfg
	AliyunASKCfgMpPrivateCfg = "askPrivateKbCfg"

	// AliyunDomain is the domain name for aliyun requests
	AliyunDomain = "cs.aliyuncs.com"
	// AliyunVersion is the version for aliyun requests
	AliyunVersion = "2015-12-15"

	// AnnotationClusterID is the cluster id of the remote virtualcluster control plane on the cloud
	AnnotationClusterID = "tenancy.x-k8s.io/ask.clusterID"
	// AnnotationSlbID is the loadbalancer id of the remote virtualcluster control plane on the cloud
	AnnotationSlbID = "tenancy.x-k8s.io/ask.slbID"
	// AnnotationKubeconfig is the admin-kubeconfig to access the remote virtualcluster control plane on the cloud
	AnnotationKubeconfig = "tenancy.x-k8s.io/admin-kubeconfig"
)
View Source
const (

	// ClusterNotFound error for not found cluster
	ClusterNotFound = "ErrorClusterNotFound"
	// ClusterNameAlreadyExist error for the cluster conflict
	ClusterNameAlreadyExist = "ClusterNameAlreadyExist"
)

Variables

This section is empty.

Functions

func GetASKKubeConfig

func GetASKKubeConfig(cli *sdk.Client, clusterID, regionID, privateKbCfg string) (string, error)

GetASKKubeConfig retrieves the kubeconfig of the ASK with the given clusterID.

func GetASKStateAndSlbID

func GetASKStateAndSlbID(cli *sdk.Client, clusterID, regionID string) (slbID, state string, err error)

GetASKStateAndSlbID gets the slb ID (external_loadbalncer id) and the latest state of the ASK with the given clusterID

func GetAliyunAKPair

func GetAliyunAKPair(cli client.Client, log logr.Logger) (keyID string, keySecret string, err error)

GetAliyunAKPair gets the current aliyun AccessKeyID/AccessKeySecret from secret NOTE AccessKeyID/AccessKeySecret may be changed if user update the secret `aliyun-accesskey`

func GetClusterIDByName

func GetClusterIDByName(cli *sdk.Client, clusterName, regionID string) (string, error)

GetClusterIDByName returns the clusterID of the cluster with clusterName

func GetSDKErrCode

func GetSDKErrCode(err error) string

func IsSDKErr

func IsSDKErr(err error) bool

func SendCreationRequest

func SendCreationRequest(cli *sdk.Client, clusterName string, askCfg ASKConfig) (string, error)

SendCreationRequest sends ASK creation request to Aliyun. If there exists an ASK with the same clusterName, retrieve and return the clusterID of the ASK instead of creating a new one

func SendDeletionRequest

func SendDeletionRequest(cli *sdk.Client, clusterID, regionID string) error

SendDeletionRequest sends a request for deleting the ASK with the given clusterID

Types

type ASKConfig

type ASKConfig struct {
	VPCID        string
	VSwitchID    string
	RegionID     string
	ZoneID       string
	PrivateKbCfg string
}

ASKConfig config for ASK

func GetASKConfigs

func GetASKConfigs(cli client.Client, log logr.Logger) (cfg ASKConfig, err error)

GetASKConfigs gets the ASK configuration information from ConfigMap

Jump to

Keyboard shortcuts

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