Documentation ¶
Index ¶
- Constants
- func GetASKKubeConfig(cli *sdk.Client, clusterID, regionID, privateKbCfg string) (string, error)
- func GetASKStateAndSlbID(cli *sdk.Client, clusterID, regionID string) (slbId, state string, err error)
- func GetAliyunAKPair(cli client.Client, log logr.Logger) (keyID string, keySecret string, err error)
- func GetClusterIDByName(cli *sdk.Client, clusterName, regionID string) (string, error)
- func GetSDKErrCode(err error) string
- func IsSDKErr(err error) bool
- func SendCreationRequest(cli *sdk.Client, clusterName string, askCfg ASKConfig) (string, error)
- func SendDeletionRequest(cli *sdk.Client, clusterID, regionID string) error
- type ASKConfig
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 ¶
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 ¶
GetClusterIDByName returns the clusterID of the cluster with clusterName
func GetSDKErrCode ¶
func SendCreationRequest ¶
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
Types ¶
Click to show internal directories.
Click to hide internal directories.