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" // 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 ¶
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 ¶
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.