cluster

package
v0.2.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2021 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package cluster is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kubernetes

type Kubernetes struct {
	KubeConfig string
	Clientset  kubernetes.Interface
}

Kubernetes implements KubernetesInterface

func (*Kubernetes) ClusterCidrs added in v0.1.0

func (k *Kubernetes) ClusterCidrs(ctx context.Context, namespace string, connectOptions *options.ConnectOptions) (cidrs []string, err error)

ClusterCidrs get cluster Cidrs

func (*Kubernetes) CreateService added in v0.1.0

func (k *Kubernetes) CreateService(ctx context.Context, name, namespace string, external bool, port int, labels map[string]string) (*v1.Service, error)

CreateService create kubernetes service

func (*Kubernetes) DecreaseRef added in v0.1.0

func (k *Kubernetes) DecreaseRef(ctx context.Context, namespace string, app string) (cleanup bool, err error)

DecreaseRef ...

func (*Kubernetes) Deployment

func (k *Kubernetes) Deployment(ctx context.Context, name, namespace string) (*appv1.Deployment, error)

Deployment get deployment

func (*Kubernetes) GetAllExistingShadowDeployments added in v0.1.0

func (k *Kubernetes) GetAllExistingShadowDeployments(ctx context.Context, namespace string) ([]appv1.Deployment, error)

GetAllExistingShadowDeployments fetch all shadow deployments

func (*Kubernetes) GetDeployment added in v0.1.0

func (k *Kubernetes) GetDeployment(ctx context.Context, name string, namespace string) (*appv1.Deployment, error)

GetDeployment ...

func (*Kubernetes) GetOrCreateShadow added in v0.1.0

func (k *Kubernetes) GetOrCreateShadow(ctx context.Context, name string, options *options.DaemonOptions, labels, annotations, envs map[string]string) (
	podIP, podName, sshcm string, credential *util.SSHCredential, err error)

GetOrCreateShadow create shadow

func (*Kubernetes) RemoveConfigMap added in v0.1.0

func (k *Kubernetes) RemoveConfigMap(ctx context.Context, name, namespace string) (err error)

RemoveConfigMap remove ConfigMap instance

func (*Kubernetes) RemoveDeployment added in v0.1.0

func (k *Kubernetes) RemoveDeployment(ctx context.Context, name, namespace string) (err error)

RemoveDeployment remove deployment instances

func (*Kubernetes) RemoveService added in v0.1.0

func (k *Kubernetes) RemoveService(ctx context.Context, name, namespace string) (err error)

RemoveService remove service

func (*Kubernetes) Scale

func (k *Kubernetes) Scale(ctx context.Context, deployment *appv1.Deployment, replicas *int32) (err error)

Scale scale deployment to

func (*Kubernetes) ScaleTo added in v0.1.0

func (k *Kubernetes) ScaleTo(ctx context.Context, deployment, namespace string, replicas *int32) (err error)

ScaleTo scale deployment to

func (*Kubernetes) ServiceHosts

func (k *Kubernetes) ServiceHosts(ctx context.Context, namespace string) (hosts map[string]string)

ServiceHosts get service dns map

func (*Kubernetes) UpdateDeployment added in v0.1.0

func (k *Kubernetes) UpdateDeployment(ctx context.Context, namespace string, deployment *appv1.Deployment) (*appv1.Deployment, error)

UpdateDeployment ...

type KubernetesInterface

type KubernetesInterface interface {
	RemoveDeployment(ctx context.Context, name, namespace string) (err error)
	RemoveConfigMap(ctx context.Context, name, namespace string) (err error)
	RemoveService(ctx context.Context, name, namespace string) (err error)
	Deployment(ctx context.Context, name, namespace string) (deployment *appV1.Deployment, err error)
	Scale(ctx context.Context, deployment *appV1.Deployment, replicas *int32) (err error)
	ScaleTo(ctx context.Context, deployment, namespace string, replicas *int32) (err error)
	ServiceHosts(ctx context.Context, namespace string) (hosts map[string]string)
	ClusterCidrs(ctx context.Context, namespace string, connectOptions *options.ConnectOptions) (cidrs []string, err error)
	GetOrCreateShadow(ctx context.Context, name string, options *options.DaemonOptions, labels, annotations, envs map[string]string) (podIP, podName, sshcm string, credential *util.SSHCredential, err error)
	GetAllExistingShadowDeployments(ctx context.Context, namespace string) (list []appV1.Deployment, err error)
	CreateService(ctx context.Context, name, namespace string, external bool, port int, labels map[string]string) (*coreV1.Service, error)
	GetDeployment(ctx context.Context, name string, namespace string) (*appV1.Deployment, error)
	UpdateDeployment(ctx context.Context, namespace string, deployment *appV1.Deployment) (*appV1.Deployment, error)
	DecreaseRef(ctx context.Context, namespace string, deployment string) (cleanup bool, err error)
}

KubernetesInterface kubernetes interface

func CreateFromClientSet added in v0.1.0

func CreateFromClientSet(clientSet kubernetes.Interface) (kubernetes KubernetesInterface, err error)

CreateFromClientSet kubernetes instance

type MockKubernetesInterface added in v0.1.0

type MockKubernetesInterface struct {
	// contains filtered or unexported fields
}

MockKubernetesInterface is a mock of KubernetesInterface interface.

func NewMockKubernetesInterface added in v0.1.0

func NewMockKubernetesInterface(ctrl *gomock.Controller) *MockKubernetesInterface

NewMockKubernetesInterface creates a new mock instance.

func (*MockKubernetesInterface) ClusterCidrs added in v0.1.0

func (m *MockKubernetesInterface) ClusterCidrs(ctx context.Context, namespace string, connectOptions *options.ConnectOptions) ([]string, error)

ClusterCidrs mocks base method.

func (*MockKubernetesInterface) CreateService added in v0.1.0

func (m *MockKubernetesInterface) CreateService(ctx context.Context, name, namespace string, external bool, port int, labels map[string]string) (*v10.Service, error)

CreateService mocks base method.

func (*MockKubernetesInterface) DecreaseRef added in v0.1.0

func (m *MockKubernetesInterface) DecreaseRef(ctx context.Context, namespace, deployment string) (bool, error)

DecreaseRef mocks base method.

func (*MockKubernetesInterface) Deployment added in v0.1.0

func (m *MockKubernetesInterface) Deployment(ctx context.Context, name, namespace string) (*v1.Deployment, error)

Deployment mocks base method.

func (*MockKubernetesInterface) EXPECT added in v0.1.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockKubernetesInterface) GetAllExistingShadowDeployments added in v0.1.0

func (m *MockKubernetesInterface) GetAllExistingShadowDeployments(ctx context.Context, namespace string) ([]v1.Deployment, error)

GetAllExistingShadowDeployments mocks base method.

func (*MockKubernetesInterface) GetDeployment added in v0.1.0

func (m *MockKubernetesInterface) GetDeployment(ctx context.Context, name, namespace string) (*v1.Deployment, error)

GetDeployment mocks base method.

func (*MockKubernetesInterface) GetOrCreateShadow added in v0.1.0

func (m *MockKubernetesInterface) GetOrCreateShadow(ctx context.Context, name string, options *options.DaemonOptions, labels, annotations, envs map[string]string) (string, string, string, *util.SSHCredential, error)

GetOrCreateShadow mocks base method.

func (*MockKubernetesInterface) RemoveConfigMap added in v0.1.0

func (m *MockKubernetesInterface) RemoveConfigMap(ctx context.Context, name, namespace string) error

RemoveConfigMap mocks base method.

func (*MockKubernetesInterface) RemoveDeployment added in v0.1.0

func (m *MockKubernetesInterface) RemoveDeployment(ctx context.Context, name, namespace string) error

RemoveDeployment mocks base method.

func (*MockKubernetesInterface) RemoveService added in v0.1.0

func (m *MockKubernetesInterface) RemoveService(ctx context.Context, name, namespace string) error

RemoveService mocks base method.

func (*MockKubernetesInterface) Scale added in v0.1.0

func (m *MockKubernetesInterface) Scale(ctx context.Context, deployment *v1.Deployment, replicas *int32) error

Scale mocks base method.

func (*MockKubernetesInterface) ScaleTo added in v0.1.0

func (m *MockKubernetesInterface) ScaleTo(ctx context.Context, deployment, namespace string, replicas *int32) error

ScaleTo mocks base method.

func (*MockKubernetesInterface) ServiceHosts added in v0.1.0

func (m *MockKubernetesInterface) ServiceHosts(ctx context.Context, namespace string) map[string]string

ServiceHosts mocks base method.

func (*MockKubernetesInterface) UpdateDeployment added in v0.1.0

func (m *MockKubernetesInterface) UpdateDeployment(ctx context.Context, namespace string, deployment *v1.Deployment) (*v1.Deployment, error)

UpdateDeployment mocks base method.

type MockKubernetesInterfaceMockRecorder added in v0.1.0

type MockKubernetesInterfaceMockRecorder struct {
	// contains filtered or unexported fields
}

MockKubernetesInterfaceMockRecorder is the mock recorder for MockKubernetesInterface.

func (*MockKubernetesInterfaceMockRecorder) ClusterCidrs added in v0.1.0

func (mr *MockKubernetesInterfaceMockRecorder) ClusterCidrs(ctx, namespace, connectOptions interface{}) *gomock.Call

ClusterCidrs indicates an expected call of ClusterCidrs.

func (*MockKubernetesInterfaceMockRecorder) CreateService added in v0.1.0

func (mr *MockKubernetesInterfaceMockRecorder) CreateService(ctx, name, namespace, external, port, labels interface{}) *gomock.Call

CreateService indicates an expected call of CreateService.

func (*MockKubernetesInterfaceMockRecorder) DecreaseRef added in v0.1.0

func (mr *MockKubernetesInterfaceMockRecorder) DecreaseRef(ctx, namespace, deployment interface{}) *gomock.Call

DecreaseRef indicates an expected call of DecreaseRef.

func (*MockKubernetesInterfaceMockRecorder) Deployment added in v0.1.0

func (mr *MockKubernetesInterfaceMockRecorder) Deployment(ctx, name, namespace interface{}) *gomock.Call

Deployment indicates an expected call of Deployment.

func (*MockKubernetesInterfaceMockRecorder) GetAllExistingShadowDeployments added in v0.1.0

func (mr *MockKubernetesInterfaceMockRecorder) GetAllExistingShadowDeployments(ctx, namespace interface{}) *gomock.Call

GetAllExistingShadowDeployments indicates an expected call of GetAllExistingShadowDeployments.

func (*MockKubernetesInterfaceMockRecorder) GetDeployment added in v0.1.0

func (mr *MockKubernetesInterfaceMockRecorder) GetDeployment(ctx, name, namespace interface{}) *gomock.Call

GetDeployment indicates an expected call of GetDeployment.

func (*MockKubernetesInterfaceMockRecorder) GetOrCreateShadow added in v0.1.0

func (mr *MockKubernetesInterfaceMockRecorder) GetOrCreateShadow(ctx, name, options, labels, annotations, envs interface{}) *gomock.Call

GetOrCreateShadow indicates an expected call of GetOrCreateShadow.

func (*MockKubernetesInterfaceMockRecorder) RemoveConfigMap added in v0.1.0

func (mr *MockKubernetesInterfaceMockRecorder) RemoveConfigMap(ctx, name, namespace interface{}) *gomock.Call

RemoveConfigMap indicates an expected call of RemoveConfigMap.

func (*MockKubernetesInterfaceMockRecorder) RemoveDeployment added in v0.1.0

func (mr *MockKubernetesInterfaceMockRecorder) RemoveDeployment(ctx, name, namespace interface{}) *gomock.Call

RemoveDeployment indicates an expected call of RemoveDeployment.

func (*MockKubernetesInterfaceMockRecorder) RemoveService added in v0.1.0

func (mr *MockKubernetesInterfaceMockRecorder) RemoveService(ctx, name, namespace interface{}) *gomock.Call

RemoveService indicates an expected call of RemoveService.

func (*MockKubernetesInterfaceMockRecorder) Scale added in v0.1.0

func (mr *MockKubernetesInterfaceMockRecorder) Scale(ctx, deployment, replicas interface{}) *gomock.Call

Scale indicates an expected call of Scale.

func (*MockKubernetesInterfaceMockRecorder) ScaleTo added in v0.1.0

func (mr *MockKubernetesInterfaceMockRecorder) ScaleTo(ctx, deployment, namespace, replicas interface{}) *gomock.Call

ScaleTo indicates an expected call of ScaleTo.

func (*MockKubernetesInterfaceMockRecorder) ServiceHosts added in v0.1.0

func (mr *MockKubernetesInterfaceMockRecorder) ServiceHosts(ctx, namespace interface{}) *gomock.Call

ServiceHosts indicates an expected call of ServiceHosts.

func (*MockKubernetesInterfaceMockRecorder) UpdateDeployment added in v0.1.0

func (mr *MockKubernetesInterfaceMockRecorder) UpdateDeployment(ctx, namespace, deployment interface{}) *gomock.Call

UpdateDeployment indicates an expected call of UpdateDeployment.

type PodMetaAndSpec added in v0.1.0

type PodMetaAndSpec struct {
	Meta  *ResourceMeta
	Image string
	Envs  map[string]string
}

PodMetaAndSpec ...

type ResourceMeta added in v0.1.0

type ResourceMeta struct {
	Name        string
	Namespace   string
	Labels      map[string]string
	Annotations map[string]string
}

ResourceMeta ...

type SSHkeyMeta added in v0.1.0

type SSHkeyMeta struct {
	Sshcm          string
	PrivateKeyPath string
}

SSHkeyMeta ...

Jump to

Keyboard shortcuts

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