controller

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2015 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package controller contains all the controllers which taken together implement the deployment system's behavior.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeStrategy added in v0.2.1

type ChangeStrategy interface {
	GenerateDeploymentConfig(namespace, name string) (*deployapi.DeploymentConfig, error)
	UpdateDeploymentConfig(namespace string, config *deployapi.DeploymentConfig) (*deployapi.DeploymentConfig, error)
}

ChangeStrategy knows how to generate and update DeploymentConfigs.

type DeploymentConfigChangeController

type DeploymentConfigChangeController struct {
	ChangeStrategy       ChangeStrategy
	NextDeploymentConfig func() *deployapi.DeploymentConfig
	DeploymentStore      cache.Store
	Codec                runtime.Codec
	// Stop is an optional channel that controls when the controller exits
	Stop <-chan struct{}
}

DeploymentConfigChangeController watches for changes to DeploymentConfigs and regenerates them only when detecting a change to the PodTemplate of a DeploymentConfig containing a ConfigChange trigger.

func (*DeploymentConfigChangeController) HandleDeploymentConfig

func (dc *DeploymentConfigChangeController) HandleDeploymentConfig()

HandleDeploymentConfig handles the next DeploymentConfig change that happens.

func (*DeploymentConfigChangeController) Run

Run watches for config change events.

type DeploymentConfigController

type DeploymentConfigController struct {
	// DeploymentInterface provides access to Deployments.
	DeploymentInterface dccDeploymentInterface
	// NextDeploymentConfig blocks until the next DeploymentConfig is available.
	NextDeploymentConfig func() *deployapi.DeploymentConfig
	// Codec is used to encode DeploymentConfigs which are stored on deployments.
	Codec runtime.Codec
	// Stop is an optional channel that controls when the controller exits.
	Stop <-chan struct{}
}

DeploymentConfigController is responsible for creating a deployment when a DeploymentConfig is updated with a new LatestVersion. Any deployment created is correlated to a DeploymentConfig by setting the DeploymentConfigLabel on the deployment.

Deployments are represented by ReplicationControllers. The DeploymentConfig used to create the ReplicationController is encoded and stored in an annotation on the ReplicationController.

func (*DeploymentConfigController) HandleDeploymentConfig

func (c *DeploymentConfigController) HandleDeploymentConfig()

Process a single DeploymentConfig event.

func (*DeploymentConfigController) Run

func (c *DeploymentConfigController) Run()

Process DeploymentConfig events one at a time.

type DeploymentContainerCreator added in v0.2.1

type DeploymentContainerCreator interface {
	CreateContainer(*deployapi.DeploymentStrategy) *kapi.Container
}

DeploymentContainerCreator knows how to create a deployment pod's container based on the deployment's strategy.

type DeploymentController added in v0.2.1

type DeploymentController struct {
	// ContainerCreator makes the container for the deployment pod based on the strategy.
	ContainerCreator DeploymentContainerCreator
	// DeploymentInterface provides access to deployments.
	DeploymentInterface dcDeploymentInterface
	// PodInterface provides access to pods.
	PodInterface dcPodInterface
	// NextDeployment blocks until the next deployment is available.
	NextDeployment func() *kapi.ReplicationController
	// NextPod blocks until the next pod is available.
	NextPod func() *kapi.Pod
	// DeploymentStore is a cache of deployments.
	DeploymentStore cache.Store
	// Environment is a set of environment which should be injected into all deployment pod
	// containers, in addition to whatever environment is specified by the ContainerCreator.
	Environment []