Documentation ¶
Index ¶
- Constants
- Variables
- func ParseKubeconfig(kubeconfig []byte) (*clusterpb.ManageConfig, error)
- func ParseManageConfigFromCredential(credentialType string, credential apistructs.ICCredential) (*clusterpb.ManageConfig, error)
- func ParseSecretes(address string, secret []byte) (*clusterpb.ManageConfig, error)
- type Clusters
- func (c *Clusters) AddClusters(ctx context.Context, req apistructs.CloudClusterRequest, userid string) (uint64, error)
- func (c *Clusters) BatchOfflineEdgeCluster(ctx context.Context, req apistructs.BatchOfflineEdgeClusterRequest, ...) error
- func (c *Clusters) BatchUpgradeEdgeCluster(ctx context.Context, req apistructs.BatchUpgradeEdgeClusterRequest, ...)
- func (c *Clusters) CheckCluster(ctx context.Context, clusterName string) error
- func (c *Clusters) ClusterInfo(ctx context.Context, orgID uint64, clusterNames []string) ([]map[string]map[string]apistructs.NameValue, error)
- func (c *Clusters) ClusterInitRetry(orgID uint64, req *apistructs.ClusterInitRetry) error
- func (c *Clusters) ClusterPreview(req apistructs.CloudClusterRequest) ([]apistructs.CloudResource, error)
- func (c *Clusters) DeleteAccessKey(clusterName string) error
- func (c *Clusters) GetAccessKey(clusterName string) (*tokenpb.QueryTokensResponse, error)
- func (c *Clusters) GetOrCreateAccessKey(ctx context.Context, clusterName string) (*tokenpb.Token, error)
- func (c *Clusters) GetOrCreateAccessKeyWithRecord(ctx context.Context, clusterName, userID, orgID string) (*tokenpb.Token, error)
- func (c *Clusters) GetOrgClusterInfo(ctx context.Context, req apistructs.OrgClusterInfoRequest) (apistructs.OrgClusterInfoData, error)
- func (c *Clusters) GetOrgInfo(req *orgpb.ListOrgRequest) (map[uint64]*orgpb.Org, error)
- func (c *Clusters) ImportClusterWithRecord(ctx context.Context, userID string, req *apistructs.ImportCluster) error
- func (c *Clusters) ListClusters(ctx context.Context, req apistructs.OrgClusterInfoRequest) (result []apistructs.OrgClusterInfoBasicData, err error)
- func (c *Clusters) MonitorCloudCluster() (abort bool, err error)
- func (c *Clusters) OfflineEdgeCluster(ctx context.Context, req apistructs.OfflineEdgeClusterRequest, userid string, ...) (recordID uint64, preCheckHint string, err error)
- func (c *Clusters) RenderInitCmd(orgName, clusterName string) (string, error)
- func (c *Clusters) RenderInitContent(ctx context.Context, orgName, clusterName string, accessKey string) (string, error)
- func (c *Clusters) ResetAccessKey(ctx context.Context, clusterName string) (*tokenpb.Token, error)
- func (c *Clusters) ResetAccessKeyWithClientSet(ctx context.Context, clusterName string, cs kubernetes.Interface) (*tokenpb.Token, error)
- func (c *Clusters) ResetAccessKeyWithRecord(ctx context.Context, clusterName, userID, orgID string) (*tokenpb.Token, error)
- func (c *Clusters) UpdateCluster(ctx context.Context, req apistructs.CMPClusterUpdateRequest, ...) error
- func (c *Clusters) UpdateClusterVersion(req []apistructs.OrgClusterInfoBasicData) error
- func (c *Clusters) UpgradeEdgeCluster(ctx context.Context, req apistructs.UpgradeEdgeClusterRequest, userid string, ...) (recordID uint64, status int, precheckHint string, err error)
- type RenderDeploy
- type ResultType
Constants ¶
View Source
const ( KubeconfigType = "KUBECONFIG" SAType = "SERVICEACCOUNT" ProxyType = "PROXY" ModuleClusterOps = "cluster-ops" ClusterAgentSA = "cluster-agent" ClusterAgentCR = "cluster-agent-cr" ClusterAgentCRB = "cluster-agent-crb" ErdaOrgLabel = "dice/org-%s" )
Variables ¶
View Source
var ProxyDeployTemplate = `` /* 1399-byte string literal not displayed */
Functions ¶
func ParseKubeconfig ¶
func ParseKubeconfig(kubeconfig []byte) (*clusterpb.ManageConfig, error)
ParseKubeconfig parse kubeconfig to manage config
func ParseManageConfigFromCredential ¶
func ParseManageConfigFromCredential(credentialType string, credential apistructs.ICCredential) (*clusterpb.ManageConfig, error)
func ParseSecretes ¶
func ParseSecretes(address string, secret []byte) (*clusterpb.ManageConfig, error)
Types ¶
type Clusters ¶
type Clusters struct {
// contains filtered or unexported fields
}
func New ¶
func New(db *dbclient.DBClient, bdl *bundle.Bundle, c tokenpb.TokenServiceServer, clusterSvc clusterpb.ClusterServiceServer, org org.Interface, pipelineSvc pipelinepb.PipelineServiceServer) *Clusters
func (*Clusters) AddClusters ¶
func (c *Clusters) AddClusters(ctx context.Context, req apistructs.CloudClusterRequest, userid string) (uint64, error)
func (*Clusters) BatchOfflineEdgeCluster ¶
func (c *Clusters) BatchOfflineEdgeCluster(ctx context.Context, req apistructs.BatchOfflineEdgeClusterRequest, userid string) error
func (*Clusters) BatchUpgradeEdgeCluster ¶
func (c *Clusters) BatchUpgradeEdgeCluster(ctx context.Context, req apistructs.BatchUpgradeEdgeClusterRequest, userid string)
func (*Clusters) CheckCluster ¶
CheckCluster check cluster
func (*Clusters) ClusterInfo ¶
func (*Clusters) ClusterInitRetry ¶
func (c *Clusters) ClusterInitRetry(orgID uint64, req *apistructs.ClusterInitRetry) error
func (*Clusters) ClusterPreview ¶
func (c *Clusters) ClusterPreview(req apistructs.CloudClusterRequest) ([]apistructs.CloudResource, error)
func (*Clusters) DeleteAccessKey ¶
DeleteAccessKey Delete access key
func (*Clusters) GetAccessKey ¶
func (c *Clusters) GetAccessKey(clusterName string) (*tokenpb.QueryTokensResponse, error)
GetAccessKey get access key with cluster name.
func (*Clusters) GetOrCreateAccessKey ¶
func (c *Clusters) GetOrCreateAccessKey(ctx context.Context, clusterName string) (*tokenpb.Token, error)
GetOrCreateAccessKey get or create access key
func (*Clusters) GetOrCreateAccessKeyWithRecord ¶
func (c *Clusters) GetOrCreateAccessKeyWithRecord(ctx context.Context, clusterName, userID, orgID string) (*tokenpb.Token, error)
GetOrCreateAccessKeyWithRecord get or create access key with record
func (*Clusters) GetOrgClusterInfo ¶
func (c *Clusters) GetOrgClusterInfo(ctx context.Context, req apistructs.OrgClusterInfoRequest) (apistructs.OrgClusterInfoData, error)
func (*Clusters) GetOrgInfo ¶
func (*Clusters) ImportClusterWithRecord ¶
func (c *Clusters) ImportClusterWithRecord(ctx context.Context, userID string, req *apistructs.ImportCluster) error
ImportClusterWithRecord import cluster with record
func (*Clusters) ListClusters ¶
func (c *Clusters) ListClusters(ctx context.Context, req apistructs.OrgClusterInfoRequest) (result []apistructs.OrgClusterInfoBasicData, err error)
func (*Clusters) MonitorCloudCluster ¶
func (*Clusters) OfflineEdgeCluster ¶
func (c *Clusters) OfflineEdgeCluster(ctx context.Context, req apistructs.OfflineEdgeClusterRequest, userid string, orgid string) (recordID uint64, preCheckHint string, err error)
func (*Clusters) RenderInitCmd ¶
func (*Clusters) RenderInitContent ¶
func (*Clusters) ResetAccessKey ¶
ResetAccessKey reset access key
func (*Clusters) ResetAccessKeyWithClientSet ¶
func (c *Clusters) ResetAccessKeyWithClientSet(ctx context.Context, clusterName string, cs kubernetes.Interface) (*tokenpb.Token, error)
ResetAccessKeyWithClientSet reset access key with specified clientSet
func (*Clusters) ResetAccessKeyWithRecord ¶
func (c *Clusters) ResetAccessKeyWithRecord(ctx context.Context, clusterName, userID, orgID string) (*tokenpb.Token, error)
ResetAccessKeyWithRecord reset ak with record
func (*Clusters) UpdateCluster ¶
func (c *Clusters) UpdateCluster(ctx context.Context, req apistructs.CMPClusterUpdateRequest, header http.Header) error
func (*Clusters) UpdateClusterVersion ¶
func (c *Clusters) UpdateClusterVersion(req []apistructs.OrgClusterInfoBasicData) error
func (*Clusters) UpgradeEdgeCluster ¶
func (c *Clusters) UpgradeEdgeCluster(ctx context.Context, req apistructs.UpgradeEdgeClusterRequest, userid string, orgid string) (recordID uint64, status int, precheckHint string, err error)
status:
1 -- in processing, jump to check log 2 -- do precheck 3 -- invalid, do not support (non k8s cluster, central cluster, higher version ecluster)
type RenderDeploy ¶
type ResultType ¶
type ResultType = map[string]map[string]apistructs.NameValue
Click to show internal directories.
Click to hide internal directories.