kube

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CLIFlags

func CLIFlags() []cli.Flag

CLIFlags builds the config flags for kubernetes

Types

type APIInterface

type APIInterface interface {
	Health() error
	GetPods(string, v1.ListOptions) ([]v1.Pod, error)
	CreateDeployment(*v1beta1.Deployment) error
	CreateOrUpdateDeployment(*v1beta1.Deployment) error
	DeleteDeployment(*v1beta1.Deployment) error
	FindDeploymentByName(string, string) (*v1beta1.Deployment, error)
	CreateService(*v1.Service) error
	GetServices(string, v1.ListOptions) ([]v1.Service, error)
	GetService(string, string) (*v1.Service, error)
	UpdateService(*v1.Service) error
}

APIInterface an interface for interacting with k8s cluster API

type Client

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

Client client for interacting with Kubernetes cluster

func New

func New() (*Client, error)

New create new instance of kube client

func (*Client) CreateDeployment

func (c *Client) CreateDeployment(deployment *v1beta1.Deployment) error

CreateDeployment will create a new deployment in the k8s cluster using the provided deployment spec for configuration

func (*Client) CreateOrUpdateDeployment

func (c *Client) CreateOrUpdateDeployment(deployment *v1beta1.Deployment) error

CreateOrUpdateDeployment will gracefully apply updates to an existing deployment or create a fresh deployment

func (*Client) CreateService

func (c *Client) CreateService(service *v1.Service) error

CreateService will create a new service in the k8s cluster using the provided service spec

func (*Client) DeleteDeployment

func (c *Client) DeleteDeployment(deployment *v1beta1.Deployment) error

DeleteDeployment will delete the provided deployment from k8s

func (*Client) FindDeploymentByName

func (c *Client) FindDeploymentByName(name, namespace string) (*v1beta1.Deployment, error)

FindDeploymentByName will lookup a deployment in the k8s cluster using the provided name

func (*Client) GetPods

func (c *Client) GetPods(namespace string, options v1.ListOptions) ([]v1.Pod, error)

GetPods retrieves pods in the k8s cluster

func (*Client) GetPodsForDeployment

func (c *Client) GetPodsForDeployment(deployment *v1beta1.Deployment) ([]v1.Pod, error)

GetPodsForDeployment will retrieve the pods associated to the provided deployment

func (*Client) GetService

func (c *Client) GetService(namespace string, name string) (*v1.Service, error)

GetService retrieves specific service

func (*Client) GetServices

func (c *Client) GetServices(namespace string, options v1.ListOptions) ([]v1.Service, error)

GetServices retrieves services in the k8s cluster

func (*Client) Health

func (c *Client) Health() error

Health checks the health of the kube client

func (*Client) UpdateService

func (c *Client) UpdateService(service *v1.Service) error

UpdateService will update an existing service

Jump to

Keyboard shortcuts

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