Documentation ¶
Index ¶
- Constants
- func GetCloudClusterFullName(provider string, clusterName string) string
- type AliyunCloudProvider
- func (provider *AliyunCloudProvider) CreateCloudCluster(ctx context.Context, clusterName string, zone string, worker int, cpu int64, ...) (string, error)
- func (provider *AliyunCloudProvider) GetClusterInfo(clusterID string) (*CloudCluster, error)
- func (provider *AliyunCloudProvider) GetClusterKubeConfig(clusterID string) (string, error)
- func (provider *AliyunCloudProvider) IsInvalidKey(err error) bool
- func (provider *AliyunCloudProvider) ListCloudClusters(pageNumber int, pageSize int) ([]*CloudCluster, int, error)
- type CloudCluster
- type CloudClusterProvider
Constants ¶
const (
// CloudClusterCreatorLabelKey labels the creator of cloud cluster
CloudClusterCreatorLabelKey = "api.core.oam.dev/cloud-cluster-creator"
)
const (
// ProviderAliyun cloud provider aliyun
ProviderAliyun = "aliyun"
)
Variables ¶
This section is empty.
Functions ¶
func GetCloudClusterFullName ¶
GetCloudClusterFullName construct the full name of cloud cluster which will be used as the name of terraform configuration
Types ¶
type AliyunCloudProvider ¶
type AliyunCloudProvider struct { *cs20151215.Client // contains filtered or unexported fields }
AliyunCloudProvider describes the cloud provider in aliyun
func NewAliyunCloudProvider ¶
func NewAliyunCloudProvider(accessKeyID string, accessKeySecret string, k8sClient client.Client) (*AliyunCloudProvider, error)
NewAliyunCloudProvider create aliyun cloud provider
func (*AliyunCloudProvider) CreateCloudCluster ¶
func (provider *AliyunCloudProvider) CreateCloudCluster(ctx context.Context, clusterName string, zone string, worker int, cpu int64, mem int64) (string, error)
CreateCloudCluster create cloud cluster
func (*AliyunCloudProvider) GetClusterInfo ¶
func (provider *AliyunCloudProvider) GetClusterInfo(clusterID string) (*CloudCluster, error)
GetClusterInfo retrieves cluster info by clusterID
func (*AliyunCloudProvider) GetClusterKubeConfig ¶
func (provider *AliyunCloudProvider) GetClusterKubeConfig(clusterID string) (string, error)
GetClusterKubeConfig get cluster kubeconfig by clusterID
func (*AliyunCloudProvider) IsInvalidKey ¶
func (provider *AliyunCloudProvider) IsInvalidKey(err error) bool
IsInvalidKey check if error is InvalidAccessKey or InvalidSecretKey
func (*AliyunCloudProvider) ListCloudClusters ¶
func (provider *AliyunCloudProvider) ListCloudClusters(pageNumber int, pageSize int) ([]*CloudCluster, int, error)
ListCloudClusters list clusters with page info, return clusters, total count and error
type CloudCluster ¶
type CloudCluster struct { Provider string `json:"provider"` ID string `json:"id"` Name string `json:"name"` Type string `json:"type"` Zone string `json:"zone"` ZoneID string `json:"zoneID"` RegionID string `json:"regionID"` VpcID string `json:"vpcID"` Labels map[string]string `json:"labels"` Status string `json:"status"` APIServerURL string `json:"apiServerURL"` DashBoardURL string `json:"dashboardURL"` }
CloudCluster describes the interface that cloud provider should return
type CloudClusterProvider ¶
type CloudClusterProvider interface { IsInvalidKey(err error) bool ListCloudClusters(pageNumber int, pageSize int) ([]*CloudCluster, int, error) GetClusterKubeConfig(clusterID string) (string, error) GetClusterInfo(clusterID string) (*CloudCluster, error) CreateCloudCluster(ctx context.Context, clusterName string, zone string, worker int, cpu int64, mem int64) (string, error) }
CloudClusterProvider abstracts the cloud provider to provide cluster access
func GetClusterProvider ¶
func GetClusterProvider(provider string, accessKeyID string, accessKeySecret string, k8sClient client.Client) (CloudClusterProvider, error)
GetClusterProvider creates interface for getting cloud cluster provider