deployment

package
v0.0.0-...-7c3836c Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2019 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDeploymentK8sGet                      = errors.New("Kubernetes获取错误,请查询是否存在")
	ErrDeploymentK8sUpdate                   = errors.New("Kubernetes更新错误,请联系管理员")
	ErrDeploymentK8sScale                    = errors.New("Kubernetes伸缩错误,请联系管理员")
	ErrDeploymentK8sUnBindPvc                = errors.New("取消挂载持久化存储失败,请联系管理员")
	ErrDeploymentPvcBindNotVary              = errors.New("挂载持久化存储失败,没有修改")
	ErrDeploymentPvcGet                      = errors.New("存储卷声明获取错,可能没有创建")
	ErrDeploymentPortNum                     = errors.New("至少需要留一个端口")
	ErrDeploymentConfigMapCreate             = errors.New("配置字典创建错误")
	ErrDeploymentConfigMapUpdate             = errors.New("配置字典更新错误")
	ErrDeploymentFilebeatTplGet              = errors.New("Filebeat 模版获取错误,可能不存在")
	ErrDeploymentFilebeatTplEncode           = errors.New("Filebeat 模版解析错误,请联系管理员")
	ErrDeploymentProjectTemplateGet          = errors.New("项目Deplooyment获取错误")
	ErrDeploymentInitContainerTemplateGet    = errors.New("初始化容器模版获取错误")
	ErrDeploymentInitContainerTemplateParse  = errors.New("初始化容器模版解析错误")
	ErrDeploymentProxyContainerTemplateGet   = errors.New("代理容器模版获取错误")
	ErrDeploymentProxyContainerTemplateParse = errors.New("代理容器模版解析错误")
	ErrDeploymentServiceMesh                 = errors.New("您没有启用服务网格,请配置ServiceMesh启用状态")
)

Functions

func MakeHandler

func MakeHandler(svc Service, logger log.Logger, cf *config.Config, repository repository.Repository) http.Handler

Types

type Probe

type Probe string
const (
	ProbeReadiness Probe = "Readiness"
	ProbeLiveness  Probe = "Liveness"
)

func (Probe) String

func (c Probe) String() string

type Service

type Service interface {
	// 获取deployment的yaml信息
	GetYaml(ctx context.Context) (res interface{}, err error)

	// 调整command及args
	CommandArgs(ctx context.Context, commands []string, args []string) (err error)

	// 扩容服务,CPU和内存
	Expansion(ctx context.Context, requestCpu, limitCpu, requestMemory, limitMemory string) (err error)

	// 容器伸缩
	Stretch(ctx context.Context, num int) (err error)

	// 获取项目的存储卷
	GetPvc(ctx context.Context, ns, name string) (map[string]interface{}, error)

	// 持久化存储卷挂载到 deployment
	BindPvc(ctx context.Context, ns, name, path, claimName string) (err error)

	// 取消挂载持久化存储卷
	UnBindPvc(ctx context.Context, ns, name, claimName string) (err error)

	// 增加端口
	AddPort(ctx context.Context, ns, name string, req portRequest) (err error)

	// 删除端口
	DelPort(ctx context.Context, ns, name string, portName string, port int32) (err error)

	// 修改日志规则,调整日志采集
	Logging(ctx context.Context, ns, name, pattern, suffix string, paths []string) (err error)

	// 添加探针或调整探针
	Probe(ctx context.Context, ns, name string, req probeRequest) (err error)

	// 服务网络切换
	Mesh(ctx context.Context, ns, name, model string) (err error)

	// 挂载Hosts
	Hosts(ctx context.Context, hosts []string) error

	// 挂载配置文件
	VolumeConfig(ctx context.Context, mountPath, subPath string) error
}

func NewLoggingService

func NewLoggingService(logger log.Logger, s Service) Service

func NewService

func NewService(logger log.Logger,
	k8sClient kubernetes.K8sClient,
	store repository.Repository,
	hookQueueSvc hooks.ServiceHookQueue) Service

Jump to

Keyboard shortcuts

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