deploymentconfig

package
v3.8.0-0.1.0+incompatible Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeploymentConfigController

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

DeploymentConfigController is responsible for creating a new deployment when:

  1. The config version is > 0 and,
  2. No deployment for the version exists.

The controller reconciles deployments with the replica count specified on the config. The active deployment (that is, the latest successful deployment) will always be scaled to the config replica count. All other deployments will be scaled to zero.

If a new version is observed for which no deployment exists, any running deployments will be cancelled. The controller will not attempt to scale running deployments.

func NewDeploymentConfigController

func NewDeploymentConfigController(
	dcInformer appsinformer.DeploymentConfigInformer,
	rcInformer kcoreinformers.ReplicationControllerInformer,
	appsClientset appsclient.Interface,
	kubeClientset kclientset.Interface,
	codec runtime.Codec,
) *DeploymentConfigController

NewDeploymentConfigController creates a new DeploymentConfigController.

func (*DeploymentConfigController) Handle

Handle implements the loop that processes deployment configs. Since this controller started using caches, the provided config MUST be deep-copied beforehand (see work() in factory.go).

func (*DeploymentConfigController) Run

func (c *DeploymentConfigController) Run(workers int, stopCh <-chan struct{})

Run begins watching and syncing.

type RCControlInterface

type RCControlInterface interface {
	PatchReplicationController(namespace, name string, data []byte) error
}

RSControlInterface is an interface that knows how to add or delete ReplicationControllers, as well as increment or decrement them. It is used by the DeploymentConfig controller to ease testing of actions that it takes.

type RCControllerRefManager

type RCControllerRefManager struct {
	kcontroller.BaseControllerRefManager
	// contains filtered or unexported fields
}

func NewRCControllerRefManager

func NewRCControllerRefManager(
	rcControl RCControlInterface,
	controller kmetav1.Object,
	selector klabels.Selector,
	controllerKind kschema.GroupVersionKind,
	canAdopt func() error,
) *RCControllerRefManager

NewRCControllerRefManager returns a RCControllerRefManager that exposes methods to manage the controllerRef of ReplicationControllers.

The CanAdopt() function can be used to perform a potentially expensive check (such as a live GET from the API server) prior to the first adoption. It will only be called (at most once) if an adoption is actually attempted. If CanAdopt() returns a non-nil error, all adoptions will fail.

NOTE: Once CanAdopt() is called, it will not be called again by the same

RCControllerRefManager instance. Create a new instance if it
makes sense to check CanAdopt() again (e.g. in a different sync pass).

func (*RCControllerRefManager) AdoptReplicationController

func (m *RCControllerRefManager) AdoptReplicationController(rs *v1.ReplicationController) error

AdoptReplicationController sends a patch to take control of the ReplicationController. It returns the error if the patching fails.

func (*RCControllerRefManager) ClaimReplicationController

func (m *RCControllerRefManager) ClaimReplicationController(rc *v1.ReplicationController) (bool, error)

ClaimReplicationController tries to take ownership of a ReplicationController.

It will reconcile the following:

  • Adopt the ReplicationController if it's an orphan.
  • Release owned ReplicationController if the selector no longer matches.

A non-nil error is returned if some form of reconciliation was attempted and failed. Usually, controllers should try again later in case reconciliation is still needed.

If the error is nil, either the reconciliation succeeded, or no reconciliation was necessary. The returned boolean indicates whether you now own the object.

func (*RCControllerRefManager) ClaimReplicationControllers

func (m *RCControllerRefManager) ClaimReplicationControllers(rcs []*v1.ReplicationController) ([]*v1.ReplicationController, error)

ClaimReplicationControllers tries to take ownership of a list of ReplicationControllers.

It will reconcile the following:

  • Adopt orphans if the selector matches.
  • Release owned objects if the selector no longer matches.

A non-nil error is returned if some form of reconciliation was attempted and failed. Usually, controllers should try again later in case reconciliation is still needed.

If the error is nil, either the reconciliation succeeded, or no reconciliation was necessary. The list of ReplicationControllers that you now own is returned.

func (*RCControllerRefManager) ReleaseReplicationController

func (m *RCControllerRefManager) ReleaseReplicationController(rc *v1.ReplicationController) error

ReleaseReplicationController sends a patch to free the ReplicationController from the control of the Deployment controller. It returns the error if the patching fails. 404 and 422 errors are ignored.

type RealRCControl

type RealRCControl struct {
	KubeClient kclientset.Interface
	Recorder   record.EventRecorder
}

RealRCControl is the default implementation of RCControlInterface.

func (RealRCControl) PatchReplicationController

func (r RealRCControl) PatchReplicationController(namespace, name string, data []byte) error

PatchReplicationController executes a strategic merge patch contained in 'data' on RC specified by 'namespace' and 'name'

Jump to

Keyboard shortcuts

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