kubernetes

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConfigFile

func DefaultConfigFile() string

DefaultConfigFile returns the default kubeconfig file path

func DefaultNamespace

func DefaultNamespace() string

DefaultNamespace returns the default namespace

func GetTargetImage added in v0.2.0

func GetTargetImage(containers map[string]*Container) (string, error)

GetTargetImage returns the unique image name of target containers

func GetTargetRepository added in v0.2.0

func GetTargetRepository(deployments []*Deployment, containers map[string]*Container) (string, error)

GetTargetRepository returns the unique GitHub repository of target containers

Types

type Client

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

Client represents the wrapper of Kubernetes API client

func NewClient

func NewClient(annotationPrefix string, kubeconfig, context string) (*Client, error)

NewClient creates Client object using local kubecfg

func NewClientInCluster

func NewClientInCluster(annotationPrefix string) (*Client, error)

NewClientInCluster creates Client object in Kubernetes cluster

func (*Client) CurrentContext added in v0.7.0

func (c *Client) CurrentContext() (string, error)

CurrentContext returns the current cluster name

func (*Client) DetectTargetContainer

func (c *Client) DetectTargetContainer(deployment *Deployment, name string) (*Container, error)

DetectTargetContainer returns the matched or the first container

func (*Client) DetectTargetDeployment

func (c *Client) DetectTargetDeployment(namespace, name string) (*Deployment, error)

DetectTargetDeployment returns the matched or the first deployment

func (*Client) GetDeployment

func (c *Client) GetDeployment(namespace, name string) (*Deployment, error)

GetDeployment returns a deployment

func (*Client) ListDeployments added in v0.2.0

func (c *Client) ListDeployments(namespace string) ([]*Deployment, error)

ListDeployments returns the list of deployment

func (*Client) ListReplicaSets added in v0.6.0

func (c *Client) ListReplicaSets(deployment *Deployment) ([]*ReplicaSet, error)

ListReplicaSets returns the list of ReplicaSets

func (*Client) ReloadPods added in v0.5.0

func (c *Client) ReloadPods(deployment *Deployment, user, signature string) (*Deployment, error)

ReloadPods reloads all Pods in the given deployment by setting new annotation

func (*Client) SetImage

func (c *Client) SetImage(deployment *Deployment, container, image, user, cause string) (*Deployment, error)

SetImage sets new image to the given deployments

type Container added in v0.2.0

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

Container represents the wrapper of Kubernetes Pod container

func NewContainer added in v0.2.0

func NewContainer(raw *v1.Container) *Container

NewContainer creates new Container object

func (*Container) Image added in v0.2.0

func (c *Container) Image() string

Name represents the image name of container

func (*Container) Name added in v0.2.0

func (c *Container) Name() string

Name represents the name of contaienr

type Deployment added in v0.2.0

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

Deployment represents the wrapper of Kubernetes Deployment

func NewDeployment added in v0.2.0

func NewDeployment(annotationPrefix string, raw *v1beta1.Deployment) *Deployment

NewDeployment creates new Deployment object

func (*Deployment) Annotations added in v0.2.0

func (d *Deployment) Annotations() map[string]string

Annotations returns the annotations of Deployment

func (*Deployment) ContainerImage added in v0.2.0

func (d *Deployment) ContainerImage(container string) string

ContainerImage returns image name of the given container

func (*Deployment) Containers added in v0.2.0

func (d *Deployment) Containers() []*Container

Containers returns the containers inside Deployment

func (*Deployment) DeployTargetContainer added in v0.2.0

func (d *Deployment) DeployTargetContainer() (*Container, error)

DeployTargetContainer returns - specified in `deploy-target-container` annotation

func (*Deployment) IsDeployTarget added in v0.2.0

func (d *Deployment) IsDeployTarget() bool

IsDeployTarget returns whether this deployment is deploy target or not - has `deploy-target: 1` or `deploy-target: true` annotation

func (*Deployment) Labels added in v0.2.0

func (d *Deployment) Labels() map[string]string

Labels returns the labels of Deployment

func (*Deployment) Name added in v0.2.0

func (d *Deployment) Name() string

Name returns the name of Deployment

func (*Deployment) Namespace added in v0.2.0

func (d *Deployment) Namespace() string

Namespace returns the namespace of Deployment

func (*Deployment) Repositories added in v0.2.0

func (d *Deployment) Repositories() (map[string]string, error)

Repositories returns the reportories attached by 'github' annotation

func (*Deployment) UID added in v0.6.0

func (d *Deployment) UID() string

UID returns the UID of Deployment

type ReplicaSet added in v0.6.0

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

ReplicaSet represents the wrapper of Kubernetes ReplicaSet

func NewReplicaSet added in v0.6.0

func NewReplicaSet(annotationPrefix string, raw *v1beta1.ReplicaSet) *ReplicaSet

NewReplicaSet creates ne ReplicaSet object

func (*ReplicaSet) CreatedAt added in v0.6.0

func (r *ReplicaSet) CreatedAt() time.Time

CreatedAt returns the creation timestamp

func (*ReplicaSet) DeployUser added in v0.6.0

func (r *ReplicaSet) DeployUser() string

DeployUser returns the deploy user

func (*ReplicaSet) Images added in v0.6.0

func (r *ReplicaSet) Images() map[string]string

Images returns the list of deployed images at the moment

func (*ReplicaSet) Name added in v0.6.0

func (r *ReplicaSet) Name() string

Name returns the name of ReplicaSet

func (*ReplicaSet) Namespace added in v0.6.0

func (r *ReplicaSet) Namespace() string

Namespace returns the namespace of ReplicaSet

func (*ReplicaSet) Revision added in v0.6.0

func (r *ReplicaSet) Revision() string

Revision returns the revision signature

Jump to

Keyboard shortcuts

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