k8s

package
v0.0.0-...-3b732ea Latest Latest
Warning

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

Go to latest
Published: May 15, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Clientset *kubernetes.Clientset
}

Client defines a subset of a Kubernetes API server client providing functionality we need.

func NewClient

func NewClient(configFile string) (*Client, error)

NewClient deals with creating a new kubernetes client instance from provided configuration.

func NewInClusterClient

func NewInClusterClient() (*Client, error)

NewInClusterClient deals with creating a new instance of a Kubernetes client.

func (*Client) Deployments

func (c *Client) Deployments(
	namespace string,
	containerImage string,
	selector labels.Selector,
) (*v1beta1.DeploymentList, error)

Deployments retrieves the deployments matching the provided label selector and filtered down for those with container specs with the provided image. TODO: Implement a way to distinguish between containers in different registries with the same name for completely different projects. TODO: Add caching layer for deployments.

func (*Client) RedeployDeployment

func (c *Client) RedeployDeployment(namespace string, deployment *v1beta1.Deployment) error

RedeployDeployment deals with scaling down, deleting and then creating the provided deployment in the given namespace.

func (*Client) RedeployRC

func (c *Client) RedeployRC(namespace string, rc *v1.ReplicationController) error

RedeployRC deals with deleting and then creating the provided replication controller in the given namespace.

func (*Client) ReplicationControllers

func (c *Client) ReplicationControllers(
	namespace string,
	containerImage string,
	selector labels.Selector,
) (*v1.ReplicationControllerList, error)

ReplicationControllers retrieves the replication controllers matching the provided label selector and filters to rcs with containers which use the provided container image. TODO: Add caching layer for replication controllers.

Jump to

Keyboard shortcuts

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