aliyun

package
v0.0.0-...-44dad58 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultVcManagerNs = "vc-manager"

	// consts used to get aliyun accesskey ID/Secret from secret
	AliyunAkSrt        = "aliyun-accesskey"
	AliyunAKIDName     = "accessKeyID"
	AliyunAKSecretName = "accessKeySecret"

	// consts used to get ask configuration from ConfigMap
	AliyunASKConfigMap       = "aliyun-ask-config"
	AliyunASKCfgMpRegionID   = "askRegionID"
	AliyunASKCfgMpZoneID     = "askZoneID"
	AliyunASKCfgMpVPCID      = "askVpcID"
	AliyunASKCfgMpVSID       = "askVswitchID"
	AliyunASKCfgMpPrivateCfg = "askPrivateKbCfg"

	// AnnotationClusterID is the cluster id of the remote virtualcluster master on the cloud
	AnnotationClusterID = "tenancy.x-k8s.io/ask.clusterID"
	// AnnotationSlbID is the loadbalancer id of the remote virtualcluster master on the cloud
	AnnotationSlbID = "tenancy.x-k8s.io/ask.slbID"
	// AnnotationKubeconfig is the admin-kubeconfig to access the remote virtualcluster master on the cloud
	AnnotationKubeconfig = "tenancy.x-k8s.io/admin-kubeconfig"
)
View Source
const (
	// full list of potential API errors can be found at
	// https://error-center.alibabacloud.com/status/product/Cos?spm=a2c69.11428812.home.7.2247bb9adTOFxm
	OprationNotSupported    = "ErrorCheckAcl"
	ClusterNotFound         = "ErrorClusterNotFound"
	ClusterNameAlreadyExist = "ClusterNameAlreadyExist"
	QueryClusterError       = "ErrorQueryCluster"
)

Variables

This section is empty.

Functions

func GetASKKubeConfig

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

GetASKPrivateKubeConfig 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
}

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