Documentation ¶
Index ¶
- type Client
- func (c *Client) Deployments(namespace string, containerImage string, selector labels.Selector) (*v1beta1.DeploymentList, error)
- func (c *Client) RedeployDeployment(namespace string, deployment *v1beta1.Deployment) error
- func (c *Client) RedeployRC(namespace string, rc *v1.ReplicationController) error
- func (c *Client) ReplicationControllers(namespace string, containerImage string, selector labels.Selector) (*v1.ReplicationControllerList, error)
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 ¶
NewClient deals with creating a new kubernetes client instance from provided configuration.
func NewInClusterClient ¶
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.