k8s

package
v0.0.0-...-acbd0ad Latest Latest
Warning

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

Go to latest
Published: May 8, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ERRDeploymentConflict = fmt.Errorf("deployment already exists")
	ERRDeploymentNotFound = fmt.Errorf("deployment not found")
)
View Source
var (
	ERRNamespaceConflict = fmt.Errorf("namespace already exists")
	ERRNamespaceNotExist = fmt.Errorf("namespace not exist")
)
View Source
var (
	ERRServiceNotFound = fmt.Errorf("service not found")
	ERRServiceConflict = fmt.Errorf("service already exists")
)

Functions

This section is empty.

Types

type DeploymentManager

type DeploymentManager struct {
	ClientSet *kubernetes.Clientset
}

DeploymentManager impl deployment operations.

func (*DeploymentManager) DeleteDeployment

func (m *DeploymentManager) DeleteDeployment(ctx context.Context, namespace, name string) error

DeleteDeployment delete deployment.

func (*DeploymentManager) SetDeployment

func (m *DeploymentManager) SetDeployment(
	ctx context.Context,
	namespace string,
	service *models.ServiceInfo,
	versionInfo *models.ServiceVersion,
) error

SetDeployment create deployment if not exist, update if exist.

type K8SManager

func New

func New(clientSet *kubernetes.Clientset) *K8SManager

type NamespaceManager

type NamespaceManager struct {
	ClientSet *kubernetes.Clientset
}

func (*NamespaceManager) CreateNamespace

func (m *NamespaceManager) CreateNamespace(ctx context.Context, name string) error

func (*NamespaceManager) GetNamespace

func (m *NamespaceManager) GetNamespace(ctx context.Context, name string) (*corev1.Namespace, error)

type PodsManager

type PodsManager struct {
	ClientSet *kubernetes.Clientset
}

func (*PodsManager) ListPods

func (m *PodsManager) ListPods(ctx context.Context, namespace, service string) ([]*models.PodInfo, error)

type ServiceManager

type ServiceManager struct {
	ClientSet *kubernetes.Clientset
}

ServiceManager impl service operations.

func (*ServiceManager) DeleteService

func (m *ServiceManager) DeleteService(
	ctx context.Context,
	namespace string,
	service string,
) error

func (*ServiceManager) SetService

func (m *ServiceManager) SetService(
	ctx context.Context,
	namespace string,
	service *models.ServiceInfo,
	versionInfo *models.ServiceVersion,
) error

SetService create service if not exist, update if exist.

Jump to

Keyboard shortcuts

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