kubernetes

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type K8S

type K8S struct {
	*kubernetes.Clientset
}

K8S client

func Create

func Create() (*K8S, error)

Create a k8s cluster client

func (*K8S) CreatePod

func (k *K8S) CreatePod(
	namespace string,
	name string,
	image string,
	labels map[string]string,
) (*v1.Pod, error)

CreatePod create a pod

func (*K8S) CreateService

func (k *K8S) CreateService(
	namespace string,
	name string,
	typ string,
	ports []int32,
	podsLabels map[string]string,
) (*v1.Service, error)

CreateService create a service

func (*K8S) DeletePod

func (k *K8S) DeletePod(namespace string, name string) error

DeletePod delete a pod

func (*K8S) DeleteService

func (k *K8S) DeleteService(namespace string, name string) error

DeleteService a service

func (*K8S) Deploy

func (k *K8S) Deploy(
	ctx context.Context,
	workdir string,
	name string,
	ports []int32,
) error

Deploy a image to be a service

func (*K8S) Destroy

func (k *K8S) Destroy(ctx context.Context, name string) error

Destroy a service

func (*K8S) GetPod

func (k *K8S) GetPod(namespace string, name string) (*v1.Pod, error)

GetPod get a pod

func (*K8S) GetStatus

func (k *K8S) GetStatus(ctx context.Context, name string) error

GetStatus get status of a service

func (*K8S) ListPods

func (k *K8S) ListPods() (*v1.PodList, error)

ListPods list pods

func (*K8S) Update

func (k *K8S) Update(ctx context.Context, name string) error

Update a service

Jump to

Keyboard shortcuts

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