cluster

package
v0.0.0-...-bd520fb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2021 License: MIT Imports: 26 Imported by: 0

Documentation

Index

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 IsArchValid(arch string) bool

func UUIDToString

func UUIDToString(id uuid.UUID) string

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 GetCluster(clusterId int64) (*Cluster, error)

func (*Cluster) CloseDockerClient

func (c *Cluster) CloseDockerClient(cli *client.Client) error

func (*Cluster) DeleteNode

func (c *Cluster) DeleteNode(node *v1.Node) error

func (*Cluster) DescribeNode

func (c *Cluster) DescribeNode(name string) (result *v1.Node, err error)

func (*Cluster) DockerImageLoad

func (c *Cluster) DockerImageLoad(ctx context.Context, cli *client.Client, srcFile string) (string, error)

func (*Cluster) DockerImagePush

func (c *Cluster) DockerImagePush(ctx context.Context, cli *client.Client, image string) error

func (*Cluster) DockerImageTag

func (c *Cluster) DockerImageTag(ctx context.Context, cli *client.Client, src string, target string) error

func (*Cluster) GetDeploymentClient

func (c *Cluster) GetDeploymentClient(namespace string) (appsv1.DeploymentInterface, error)

func (*Cluster) GetHarborAddress

func (c *Cluster) GetHarborAddress() string

func (*Cluster) GetHarborProject

func (c *Cluster) GetHarborProject() string

func (*Cluster) GetImageNameAndVersion

func (c *Cluster) GetImageNameAndVersion(imageTag string) (string, string, error)

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 (c *Cluster) GetUniqueName(resourceName string) string

func (*Cluster) InitDockerCli

func (c *Cluster) InitDockerCli(harborAddress string, harborProject string, harborUser string, harborPasswd string)

init docker cli

func (*Cluster) InitKube

func (c *Cluster) InitKube(kubeMaster string, kubeConfig string)

init kubeclient

func (*Cluster) KubeConfig

func (c *Cluster) KubeConfig() (conf *rest.Config, err error)

KubeConfig from flags

func (*Cluster) LabelNode

func (c *Cluster) LabelNode(node *v1.Node, clusterId, groupId, userId int64, nodeName string) error

func (*Cluster) ListNodes

func (c *Cluster) ListNodes() (result *v1.NodeList, err error)

func (*Cluster) NewDockerClient

func (c *Cluster) NewDockerClient() (*client.Client, error)

type ImageLoadResult

type ImageLoadResult struct {
	Stream string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL