Documentation ¶
Index ¶
- Constants
- type CustomDeploymentStrategyParams
- type DeploymentCause
- type DeploymentCauseImageTrigger
- type DeploymentConfig
- type DeploymentConfigList
- type DeploymentConfigRollback
- type DeploymentConfigRollbackSpec
- type DeploymentConfigSpec
- type DeploymentConfigStatus
- type DeploymentDetails
- type DeploymentPhase
- type DeploymentStrategy
- type DeploymentStrategyType
- type DeploymentTriggerImageChangeParams
- type DeploymentTriggerPolicy
- type DeploymentTriggerType
- type ExecNewPodHook
- type LifecycleHook
- type LifecycleHookFailurePolicy
- type RecreateDeploymentStrategyParams
- type RollingDeploymentStrategyParams
Constants ¶
const ( // DeploymentConfigAnnotation is an annotation name used to correlate a deployment with the // DeploymentConfig on which the deployment is based. DeploymentConfigAnnotation = "deploymentConfig" // DeploymentAnnotation is an annotation on a deployer Pod. The annotation value is the name // of the deployment (a ReplicationController) on which the deployer Pod acts. DeploymentAnnotation = "deployment" // DeploymentPodAnnotation is an annotation on a deployment (a ReplicationController). The // annotation value is the name of the deployer Pod which will act upon the ReplicationController // to implement the deployment behavior. DeploymentPodAnnotation = "pod" // DeploymentPhaseAnnotation is an annotation name used to retrieve the DeploymentPhase of // a deployment. DeploymentPhaseAnnotation = "deploymentStatus" // DeploymentEncodedConfigAnnotation is an annotation name used to retrieve specific encoded // DeploymentConfig on which a given deployment is based. DeploymentEncodedConfigAnnotation = "encodedDeploymentConfig" // DeploymentVersionAnnotation is an annotation on a deployment (a ReplicationController). The // annotation value is the LatestVersion value of the DeploymentConfig which was the basis for // the deployment. DeploymentVersionAnnotation = "deploymentVersion" // DeploymentLabel is the name of a label used to correlate a deployment with the Pod created // to execute the deployment logic. // TODO: This is a workaround for upstream's lack of annotation support on PodTemplate. Once // annotations are available on PodTemplate, audit this constant with the goal of removing it. DeploymentLabel = "deployment" // DeploymentConfigLabel is the name of a label used to correlate a deployment with the // DeploymentConfigs on which the deployment is based. DeploymentConfigLabel = "deploymentconfig" )
These constants represent keys used for correlating objects related to deployments.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomDeploymentStrategyParams ¶
type CustomDeploymentStrategyParams struct { // Image specifies a Docker image which can carry out a deployment. Image string `json:"image,omitempty"` // Environment holds the environment which will be given to the container for Image. Environment []kapi.EnvVar `json:"environment,omitempty"` // Command is optional and overrides CMD in the container Image. Command []string `json:"command,omitempty"` }
CustomParams are the input to the Custom deployment strategy.
type DeploymentCause ¶
type DeploymentCause struct { // The type of the trigger that resulted in the creation of a new deployment Type DeploymentTriggerType `json:"type"` // The image trigger details, if this trigger was fired based on an image change ImageTrigger *DeploymentCauseImageTrigger `json:"imageTrigger,omitempty"` }
DeploymentCause captures information about a particular cause of a deployment.
type DeploymentCauseImageTrigger ¶
type DeploymentCauseImageTrigger struct { // From is a reference to the changed object which triggered a build. The field may have // the kinds DockerImage, ImageStreamTag, or ImageStreamImage. From kapi.ObjectReference `json:"from"` }
DeploymentCauseImageTrigger represents details about the cause of a deployment originating from an image change trigger
type DeploymentConfig ¶
type DeploymentConfig struct { kapi.TypeMeta `json:",inline"` kapi.ObjectMeta `json:"metadata,omitempty"` // Spec represents a desired deployment state and how to deploy to it. Spec DeploymentConfigSpec `json:"spec"` // Status represents a desired deployment state and how to deploy to it. Status DeploymentConfigStatus `json:"status"` }
DeploymentConfig represents a configuration for a single deployment (represented as a ReplicationController). It also contains details about changes which resulted in the current state of the DeploymentConfig. Each change to the DeploymentConfig which should result in a new deployment results in an increment of LatestVersion.
func (*DeploymentConfig) IsAnAPIObject ¶
func (*DeploymentConfig) IsAnAPIObject()
type DeploymentConfigList ¶
type DeploymentConfigList struct { kapi.TypeMeta `json:",inline"` kapi.ListMeta `json:"metadata,omitempty"` Items []DeploymentConfig `json:"items"` }
A DeploymentConfigList is a collection of deployment configs.
func (*DeploymentConfigList) IsAnAPIObject ¶
func (*DeploymentConfigList) IsAnAPIObject()
type DeploymentConfigRollback ¶
type DeploymentConfigRollback struct { kapi.TypeMeta `json:",inline"` // Spec defines the options to rollback generation. Spec DeploymentConfigRollbackSpec `json:"spec"` }
DeploymentConfigRollback provides the input to rollback generation.
func (*DeploymentConfigRollback) IsAnAPIObject ¶
func (*DeploymentConfigRollback) IsAnAPIObject()
type DeploymentConfigRollbackSpec ¶
type DeploymentConfigRollbackSpec struct { // From points to a ReplicationController which is a deployment. From kapi.ObjectReference `json:"from"` // IncludeTriggers specifies whether to include config Triggers. IncludeTriggers bool `json:"includeTriggers"` // IncludeTemplate specifies whether to include the PodTemplateSpec. IncludeTemplate bool `json:"includeTemplate"` // IncludeReplicationMeta specifies whether to include the replica count and selector. IncludeReplicationMeta bool `json:"includeReplicationMeta"` // IncludeStrategy specifies whether to include the deployment Strategy. IncludeStrategy bool `json:"includeStrategy"` }
DeploymentConfigRollbackSpec represents the options for rollback generation.
type DeploymentConfigSpec ¶
type DeploymentConfigSpec struct { // Strategy describes how a deployment is executed. Strategy DeploymentStrategy `json:"strategy,omitempty"` // Triggers determine how updates to a DeploymentConfig result in new deployments. If no triggers // are defined, a new deployment can only occur as a result of an explicit client update to the // DeploymentConfig with a new LatestVersion. Triggers []DeploymentTriggerPolicy `json:"triggers,omitempty"` // Replicas is the number of desired replicas. Replicas int `json:"replicas"` // Selector is a label query over pods that should match the Replicas count. Selector map[string]string `json:"selector"` // TemplateRef is a reference to an object that describes the pod that will be created if // insufficient replicas are detected. This reference is ignored if a Template is set. // Must be set before converting to a v1beta3 API object TemplateRef *kapi.ObjectReference `json:"templateRef,omitempty"` // Template is the object that describes the pod that will be created if // insufficient replicas are detected. Internally, this takes precedence over a // TemplateRef. // Must be set before converting to a v1beta1 or v1beta2 API object. Template *kapi.PodTemplateSpec `json:"template,omitempty"` }
DeploymentTemplate contains all the necessary information to create a deployment from a DeploymentStrategy.
type DeploymentConfigStatus ¶
type DeploymentConfigStatus struct { // LatestVersion is used to determine whether the current deployment associated with a DeploymentConfig // is out of sync. LatestVersion int `json:"latestVersion,omitempty"` // The reasons for the update to this deployment config. // This could be based on a change made by the user or caused by an automatic trigger Details *DeploymentDetails `json:"details,omitempty"` }
type DeploymentDetails ¶
type DeploymentDetails struct { // The user specified change message, if this deployment was triggered manually by the user Message string `json:"message,omitempty"` // Extended data associated with all the causes for creating a new deployment Causes []*DeploymentCause `json:"causes,omitempty"` }
DeploymentDetails captures information about the causes of a deployment.
type DeploymentPhase ¶
type DeploymentPhase string
DeploymentPhase describes the possible states a deployment can be in.
const ( // DeploymentPhaseNew means the deployment has been accepted but not yet acted upon. DeploymentPhaseNew DeploymentPhase = "New" // DeploymentPhasePending means the deployment been handed over to a deployment strategy, // but the strategy has not yet declared the deployment to be running. DeploymentPhasePending DeploymentPhase = "Pending" // DeploymentPhaseRunning means the deployment strategy has reported the deployment as // being in-progress. DeploymentPhaseRunning DeploymentPhase = "Running" // DeploymentPhaseComplete means the deployment finished without an error. DeploymentPhaseComplete DeploymentPhase = "Complete" // DeploymentPhaseFailed means the deployment finished with an error. DeploymentPhaseFailed DeploymentPhase = "Failed" )
type DeploymentStrategy ¶
type DeploymentStrategy struct { // Type is the name of a deployment strategy. Type DeploymentStrategyType `json:"type,omitempty"` // CustomParams are the input to the Custom deployment strategy. CustomParams *CustomDeploymentStrategyParams `json:"customParams,omitempty"` // RecreateParams are the input to the Recreate deployment strategy. RecreateParams *RecreateDeploymentStrategyParams `json:"recreateParams,omitempty"` // RollingParams are the input to the Rolling deployment strategy. RollingParams *RollingDeploymentStrategyParams `json:"rollingParams,omitempty"` // Compute resource requirements to execute the deployment Resources kapi.ResourceRequirements `json:"resources,omitempty"` }
DeploymentStrategy describes how to perform a deployment.
type DeploymentStrategyType ¶
type DeploymentStrategyType string
DeploymentStrategyType refers to a specific DeploymentStrategy implementation.
const ( // DeploymentStrategyTypeRecreate is a simple strategy suitable as a default. DeploymentStrategyTypeRecreate DeploymentStrategyType = "Recreate" // DeploymentStrategyTypeCustom is a user defined strategy. DeploymentStrategyTypeCustom DeploymentStrategyType = "Custom" // DeploymentStrategyTypeRolling uses the Kubernetes RollingUpdater. DeploymentStrategyTypeRolling DeploymentStrategyType = "Rolling" )
type DeploymentTriggerImageChangeParams ¶
type DeploymentTriggerImageChangeParams struct { // Automatic means that the detection of a new tag value should result in a new deployment. Automatic bool `json:"automatic,omitempty"` // ContainerNames is used to restrict tag updates to the specified set of container names in a pod. ContainerNames []string `json:"containerNames,omitempty"` // From is a reference to a Docker image repository tag to watch for changes. The // Kind may be left blank, in which case it defaults to "ImageStreamTag". The "Name" is // the only required subfield - if Namespace is blank, the namespace of the current deployment // trigger will be used. From kapi.ObjectReference `json:"from"` // LastTriggeredImage is the last image to be triggered. LastTriggeredImage string `json:"lastTriggeredImage"` }
DeploymentTriggerImageChangeParams represents the parameters to the ImageChange trigger.
type DeploymentTriggerPolicy ¶
type DeploymentTriggerPolicy struct { Type DeploymentTriggerType `json:"type,omitempty"` // ImageChangeParams represents the parameters for the ImageChange trigger. ImageChangeParams *DeploymentTriggerImageChangeParams `json:"imageChangeParams,omitempty"` }
DeploymentTriggerPolicy describes a policy for a single trigger that results in a new deployment.
type DeploymentTriggerType ¶
type DeploymentTriggerType string
DeploymentTriggerType refers to a specific DeploymentTriggerPolicy implementation.
const ( // DeploymentTriggerOnImageChange will create new deployments in response to updated tags from // a Docker image repository. DeploymentTriggerOnImageChange DeploymentTriggerType = "ImageChange" // DeploymentTriggerOnConfigChange will create new deployments in response to changes to // the ControllerTemplate of a DeploymentConfig. DeploymentTriggerOnConfigChange DeploymentTriggerType = "ConfigChange" )
type ExecNewPodHook ¶
type ExecNewPodHook struct { // Command is the action command and its arguments. Command []string `json:"command"` // Env is a set of environment variables to supply to the hook pod's container. Env []kapi.EnvVar `json:"env,omitempty"` // ContainerName is the name of a container in the deployment pod template // whose Docker image will be used for the hook pod's container. ContainerName string `json:"containerName"` }
ExecNewPodHook is a hook implementation which runs a command in a new pod based on the specified container which is assumed to be part of the deployment template.
type LifecycleHook ¶
type LifecycleHook struct { // FailurePolicy specifies what action to take if the hook fails. FailurePolicy LifecycleHookFailurePolicy `json:"failurePolicy"` // ExecNewPod specifies the options for a lifecycle hook backed by a pod. ExecNewPod *ExecNewPodHook `json:"execNewPod,omitempty"` }
Handler defines a specific deployment lifecycle action.
type LifecycleHookFailurePolicy ¶
type LifecycleHookFailurePolicy string
HandlerFailurePolicy describes possibles actions to take if a hook fails.
const ( // LifecycleHookFailurePolicyRetry means retry the hook until it succeeds. LifecycleHookFailurePolicyRetry LifecycleHookFailurePolicy = "Retry" // LifecycleHookFailurePolicyAbort means abort the deployment (if possible). LifecycleHookFailurePolicyAbort LifecycleHookFailurePolicy = "Abort" // LifecycleHookFailurePolicyIgnore means ignore failure and continue the deployment. LifecycleHookFailurePolicyIgnore LifecycleHookFailurePolicy = "Ignore" )
type RecreateDeploymentStrategyParams ¶
type RecreateDeploymentStrategyParams struct { // Pre is a lifecycle hook which is executed before the strategy manipulates // the deployment. All LifecycleHookFailurePolicy values are supported. Pre *LifecycleHook `json:"pre,omitempty"` // Post is a lifecycle hook which is executed after the strategy has // finished all deployment logic. The LifecycleHookFailurePolicyAbort policy // is NOT supported. Post *LifecycleHook `json:"post,omitempty"` }
RecreateDeploymentStrategyParams are the input to the Recreate deployment strategy.
type RollingDeploymentStrategyParams ¶
type RollingDeploymentStrategyParams struct { // UpdatePeriodSeconds is the time to wait between individual pod updates. // If the value is nil, a default will be used. UpdatePeriodSeconds *int64 `json:"updatePeriodSeconds,omitempty" description:"the time to wait between individual pod updates"` // IntervalSeconds is the time to wait between polling deployment status // after update. If the value is nil, a default will be used. IntervalSeconds *int64 `json:"intervalSeconds,omitempty" description:"the time to wait between polling deployment status after update"` // TimeoutSeconds is the time to wait for updates before giving up. If the // value is nil, a default will be used. TimeoutSeconds *int64 `json:"timeoutSeconds,omitempty" description:"the time to wait for updates before giving up"` }
RollingDeploymentStrategyParams are the input to the Rolling deployment strategy.