Documentation ¶
Index ¶
- Constants
- Variables
- func InitClusters(config *configs.EdgeCloudConfig)
- func IsArchValid(arch string) bool
- func UUIDToString(id uuid.UUID) string
- type Cluster
- func (c *Cluster) CloseDockerClient(cli *client.Client) error
- func (c *Cluster) DeleteNode(node *v1.Node) error
- func (c *Cluster) DescribeNode(name string) (result *v1.Node, err error)
- func (c *Cluster) DockerImageLoad(ctx context.Context, cli *client.Client, srcFile string) (string, error)
- func (c *Cluster) DockerImagePush(ctx context.Context, cli *client.Client, image string) error
- func (c *Cluster) DockerImageTag(ctx context.Context, cli *client.Client, src string, target string) error
- func (c *Cluster) GetDeploymentClient(namespace string) (appsv1.DeploymentInterface, error)
- func (c *Cluster) GetHarborAddress() string
- func (c *Cluster) GetHarborProject() string
- func (c *Cluster) GetImageNameAndVersion(imageTag string) (string, string, error)
- func (c *Cluster) GetNodeClient() (corev1.NodeInterface, error)
- func (c *Cluster) GetPodClient(namespace string) (corev1.PodInterface, error)
- func (c *Cluster) GetUniqueName(resourceName string) string
- func (c *Cluster) InitDockerCli(harborAddress string, harborProject string, harborUser string, ...)
- func (c *Cluster) InitKube(kubeMaster string, kubeConfig string)
- func (c *Cluster) KubeConfig() (conf *rest.Config, err error)
- func (c *Cluster) LabelNode(node *v1.Node, clusterId, groupId, userId int64, nodeName string) error
- func (c *Cluster) ListNodes() (result *v1.NodeList, err error)
- func (c *Cluster) NewDockerClient() (*client.Client, error)
- type ImageLoadResult
Constants ¶
View Source
const ( ResourceNode string = "node" ResourceDeploy string = "deploy" ResourceContainer string = "container" )
View Source
const ( ArchX86 string = "amd64" ArchArm string = "arm64" )
arch type
Variables ¶
View Source
var ( ErrCannotGetImageLoadResult = errors.New("Can`t get image load result") ErrImageTagFailed = errors.New("Image tag failed") )
View Source
var (
ErrArchTypeNotExist = errors.New("arch type not exist")
)
View Source
var (
ErrFindCluster = errors.New("cluster not exist")
)
Functions ¶
func InitClusters ¶
func InitClusters(config *configs.EdgeCloudConfig)
func IsArchValid ¶
func UUIDToString ¶
Types ¶
type Cluster ¶
type Cluster struct { Id int64 Domain string KubeMaster string KubeConfFile string KubeQPS float32 KubeBurst int KubeContentType string HarborAddress string HarborProject string HarborUser string HarborPasswd string DownloadAddress string }
func GetCluster ¶
func (*Cluster) DescribeNode ¶
func (*Cluster) DockerImageLoad ¶
func (*Cluster) DockerImagePush ¶
func (*Cluster) DockerImageTag ¶
func (*Cluster) GetDeploymentClient ¶
func (c *Cluster) GetDeploymentClient(namespace string) (appsv1.DeploymentInterface, error)
func (*Cluster) GetHarborAddress ¶
func (*Cluster) GetHarborProject ¶
func (*Cluster) GetImageNameAndVersion ¶
func (*Cluster) GetNodeClient ¶
func (c *Cluster) GetNodeClient() (corev1.NodeInterface, error)
func (*Cluster) GetPodClient ¶
func (c *Cluster) GetPodClient(namespace string) (corev1.PodInterface, error)
func (*Cluster) GetUniqueName ¶
func (*Cluster) InitDockerCli ¶
func (c *Cluster) InitDockerCli(harborAddress string, harborProject string, harborUser string, harborPasswd string)
init docker cli
func (*Cluster) KubeConfig ¶
KubeConfig from flags
type ImageLoadResult ¶
type ImageLoadResult struct {
Stream string
}
Click to show internal directories.
Click to hide internal directories.