cluster

package
v0.0.13-rc10 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

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) ClusterCrids

func (k *Kubernetes) ClusterCrids(podCIDR string) (cidrs []string, err error)

ClusterCrids get cluster cirds

func (*Kubernetes) CreateService added in v0.1.0

func (k *Kubernetes) CreateService(name, namespace string, 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(namespace string, app string) (cleanup bool, err error)

DecreaseRef ...

func (*Kubernetes) Deployment

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

Deployment get deployment

func (*Kubernetes) GetDeployment added in v0.1.0

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

GetDeployment ...

func (*Kubernetes) GetOrCreateShadow added in v0.1.0

func (k *Kubernetes) GetOrCreateShadow(name, namespace, image string, labels map[string]string, debug, reuseShadow bool) (podIP, podName, sshcm string, credential *util.SSHCredential, err error)

GetOrCreateShadow create shadow

func (*Kubernetes) RemoveConfigMap added in v0.1.0

func (k *Kubernetes) RemoveConfigMap(name, namespace string) (err error)

RemoveConfigMap remove ConfigMap instance

func (*Kubernetes) RemoveDeployment added in v0.1.0

func (k *Kubernetes) RemoveDeployment(name, namespace string) (err error)

RemoveDeployment remove deployment instances

func (*Kubernetes) RemoveService added in v0.1.0

func (k *Kubernetes) RemoveService(name, namespace string) (err error)

RemoveService remove sevice

func (*Kubernetes) Scale

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

Scale scale deployment to

func (*Kubernetes) ScaleTo added in v0.1.0

func (k *Kubernetes) ScaleTo(deployment, namespace string, replicas *int32) (err error)

ScaleTo scale deployment to

func (*Kubernetes) ServiceHosts

func (k *Kubernetes) ServiceHosts(namespace string) (hosts map[string]string)

ServiceHosts get service dns map

func (*Kubernetes) UpdateDeployment added in v0.1.0

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

UpdateDeployment ...

type KubernetesInterface

type KubernetesInterface interface {
	RemoveDeployment(name, namespace string) (err error)
	RemoveConfigMap(name, namespace string) (err error)
	RemoveService(name, namespace string) (err error)
	Deployment(name, namespace string) (deployment *appV1.Deployment, err error)
	Scale(deployment *appV1.Deployment, replicas *int32) (err error)
	ScaleTo(deployment, namespace string, replicas *int32) (err error)
	ServiceHosts(namespace string) (hosts map[string]string)
	ClusterCrids(podCIDR string) (cidrs []string, err error)
	GetOrCreateShadow(name, namespace, image string, labels map[string]string, debug, reuseShadow bool) (podIP, podName, sshcm string, credential *util.SSHCredential, err error)
	CreateService(name, namespace string, port int, labels map[string]string) (*coreV1.Service, error)
	GetDeployment(name string, namespace string) (*appV1.Deployment, error)
	UpdateDeployment(namespace string, deployment *appV1.Deployment) (*appV1.Deployment, error)
	DecreaseRef(namespace string, deployment string) (cleanup bool, err error)
}

KubernetesInterface kubernetes interface

func Create

func Create(kubeConfig string) (kubernetes KubernetesInterface, err error)

Create kubernetes instance

func CreateFromClientSet added in v0.1.0

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

CreateFromClientSet kubernetes instance

type ResourceMeta added in v0.1.0

type ResourceMeta struct {
	Name      string
	Namespace string
	Labels    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