1 package v1 2 3 import ( 4 "fmt" 5 6 corev1 "k8s.io/api/core/v1" 7 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 8 "k8s.io/apimachinery/pkg/util/intstr" 9 ) 10 11 // +genclient 12 // +genclient:method=Instantiate,verb=create,subresource=instantiate,input=DeploymentRequest 13 // +genclient:method=Rollback,verb=create,subresource=rollback,input=DeploymentConfigRollback 14 // +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/api/extensions/v1beta1.Scale 15 // +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/api/extensions/v1beta1.Scale,result=k8s.io/api/extensions/v1beta1.Scale 16 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 17 18 // Deployment Configs define the template for a pod and manages deploying new images or configuration changes. 19 // A single deployment configuration is usually analogous to a single micro-service. Can support many different 20 // deployment patterns, including full restart, customizable rolling updates, and fully custom behaviors, as 21 // well as pre- and post- deployment hooks. Each individual deployment is represented as a replication controller. 22 // 23 // A deployment is "triggered" when its configuration is changed or a tag in an Image Stream is changed. 24 // Triggers can be disabled to allow manual control over a deployment. The "strategy" determines how the deployment 25 // is carried out and may be changed at any time. The `latestVersion` field is updated when a new deployment 26 // is triggered by any means. 27 // 28 // Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). 29 // +openshift:compatibility-gen:level=1 30 type DeploymentConfig struct { 31 metav1.TypeMeta `json:",inline"` 32 33 // metadata is the standard object's metadata. 34 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 35 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 36 37 // Spec represents a desired deployment state and how to deploy to it. 38 Spec DeploymentConfigSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` 39 40 // Status represents the current deployment state. 41 // +optional 42 Status DeploymentConfigStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` 43 } 44 45 // DeploymentConfigSpec represents the desired state of the deployment. 46 type DeploymentConfigSpec struct { 47 // Strategy describes how a deployment is executed. 48 // +optional 49 Strategy DeploymentStrategy `json:"strategy" protobuf:"bytes,1,opt,name=strategy"` 50 51 // MinReadySeconds is the minimum number of seconds for which a newly created pod should 52 // be ready without any of its container crashing, for it to be considered available. 53 // Defaults to 0 (pod will be considered available as soon as it is ready) 54 MinReadySeconds int32 `json:"minReadySeconds,omitempty" protobuf:"varint,9,opt,name=minReadySeconds"` 55 56 // Triggers determine how updates to a DeploymentConfig result in new deployments. If no triggers 57 // are defined, a new deployment can only occur as a result of an explicit client update to the 58 // DeploymentConfig with a new LatestVersion. If null, defaults to having a config change trigger. 59 // +optional 60 Triggers DeploymentTriggerPolicies `json:"triggers" protobuf:"bytes,2,rep,name=triggers"` 61 62 // Replicas is the number of desired replicas. 63 // +optional 64 Replicas int32 `json:"replicas" protobuf:"varint,3,opt,name=replicas"` 65 66 // RevisionHistoryLimit is the number of old ReplicationControllers to retain to allow for rollbacks. 67 // This field is a pointer to allow for differentiation between an explicit zero and not specified. 68 // Defaults to 10. (This only applies to DeploymentConfigs created via the new group API resource, not the legacy resource.) 69 RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty" protobuf:"varint,4,opt,name=revisionHistoryLimit"` 70 71 // Test ensures that this deployment config will have zero replicas except while a deployment is running. This allows the 72 // deployment config to be used as a continuous deployment test - triggering on images, running the deployment, and then succeeding 73 // or failing. Post strategy hooks and After actions can be used to integrate successful deployment with an action. 74 // +optional 75 Test bool `json:"test" protobuf:"varint,5,opt,name=test"` 76 77 // Paused indicates that the deployment config is paused resulting in no new deployments on template 78 // changes or changes in the template caused by other triggers. 79 Paused bool `json:"paused,omitempty" protobuf:"varint,6,opt,name=paused"` 80 81 // Selector is a label query over pods that should match the Replicas count. 82 Selector map[string]string `json:"selector,omitempty" protobuf:"bytes,7,rep,name=selector"` 83 84 // Template is the object that describes the pod that will be created if 85 // insufficient replicas are detected. 86 Template *corev1.PodTemplateSpec `json:"template,omitempty" protobuf:"bytes,8,opt,name=template"` 87 } 88 89 // DeploymentStrategy describes how to perform a deployment. 90 type DeploymentStrategy struct { 91 // Type is the name of a deployment strategy. 92 // +optional 93 Type DeploymentStrategyType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type,casttype=DeploymentStrategyType"` 94 95 // CustomParams are the input to the Custom deployment strategy, and may also 96 // be specified for the Recreate and Rolling strategies to customize the execution 97 // process that runs the deployment. 98 CustomParams *CustomDeploymentStrategyParams `json:"customParams,omitempty" protobuf:"bytes,2,opt,name=customParams"` 99 // RecreateParams are the input to the Recreate deployment strategy. 100 RecreateParams *RecreateDeploymentStrategyParams `json:"recreateParams,omitempty" protobuf:"bytes,3,opt,name=recreateParams"` 101 // RollingParams are the input to the Rolling deployment strategy. 102 RollingParams *RollingDeploymentStrategyParams `json:"rollingParams,omitempty" protobuf:"bytes,4,opt,name=rollingParams"` 103 104 // Resources contains resource requirements to execute the deployment and any hooks. 105 Resources corev1.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,5,opt,name=resources"` 106 // Labels is a set of key, value pairs added to custom deployer and lifecycle pre/post hook pods. 107 Labels map[string]string `json:"labels,omitempty" protobuf:"bytes,6,rep,name=labels"` 108 // Annotations is a set of key, value pairs added to custom deployer and lifecycle pre/post hook pods. 109 Annotations map[string]string `json:"annotations,omitempty" protobuf:"bytes,7,rep,name=annotations"` 110 111 // ActiveDeadlineSeconds is the duration in seconds that the deployer pods for this deployment 112 // config may be active on a node before the system actively tries to terminate them. 113 ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty" protobuf:"varint,8,opt,name=activeDeadlineSeconds"` 114 } 115 116 // DeploymentStrategyType refers to a specific DeploymentStrategy implementation. 117 type DeploymentStrategyType string 118 119 const ( 120 // DeploymentStrategyTypeRecreate is a simple strategy suitable as a default. 121 DeploymentStrategyTypeRecreate DeploymentStrategyType = "Recreate" 122 // DeploymentStrategyTypeCustom is a user defined strategy. 123 DeploymentStrategyTypeCustom DeploymentStrategyType = "Custom" 124 // DeploymentStrategyTypeRolling uses the Kubernetes RollingUpdater. 125 DeploymentStrategyTypeRolling DeploymentStrategyType = "Rolling" 126 ) 127 128 // CustomDeploymentStrategyParams are the input to the Custom deployment strategy. 129 type CustomDeploymentStrategyParams struct { 130 // Image specifies a container image which can carry out a deployment. 131 Image string `json:"image,omitempty" protobuf:"bytes,1,opt,name=image"` 132 // Environment holds the environment which will be given to the container for Image. 133 Environment []corev1.EnvVar `json:"environment,omitempty" protobuf:"bytes,2,rep,name=environment"` 134 // Command is optional and overrides CMD in the container Image. 135 Command []string `json:"command,omitempty" protobuf:"bytes,3,rep,name=command"` 136 } 137 138 // RecreateDeploymentStrategyParams are the input to the Recreate deployment 139 // strategy. 140 type RecreateDeploymentStrategyParams struct { 141 // TimeoutSeconds is the time to wait for updates before giving up. If the 142 // value is nil, a default will be used. 143 TimeoutSeconds *int64 `json:"timeoutSeconds,omitempty" protobuf:"varint,1,opt,name=timeoutSeconds"` 144 // Pre is a lifecycle hook which is executed before the strategy manipulates 145 // the deployment. All LifecycleHookFailurePolicy values are supported. 146 Pre *LifecycleHook `json:"pre,omitempty" protobuf:"bytes,2,opt,name=pre"` 147 // Mid is a lifecycle hook which is executed while the deployment is scaled down to zero before the first new 148 // pod is created. All LifecycleHookFailurePolicy values are supported. 149 Mid *LifecycleHook `json:"mid,omitempty" protobuf:"bytes,3,opt,name=mid"` 150 // Post is a lifecycle hook which is executed after the strategy has 151 // finished all deployment logic. All LifecycleHookFailurePolicy values are supported. 152 Post *LifecycleHook `json:"post,omitempty" protobuf:"bytes,4,opt,name=post"` 153 } 154 155 // RollingDeploymentStrategyParams are the input to the Rolling deployment 156 // strategy. 157 type RollingDeploymentStrategyParams struct { 158 // UpdatePeriodSeconds is the time to wait between individual pod updates. 159 // If the value is nil, a default will be used. 160 UpdatePeriodSeconds *int64 `json:"updatePeriodSeconds,omitempty" protobuf:"varint,1,opt,name=updatePeriodSeconds"` 161 // IntervalSeconds is the time to wait between polling deployment status 162 // after update. If the value is nil, a default will be used. 163 IntervalSeconds *int64 `json:"intervalSeconds,omitempty" protobuf:"varint,2,opt,name=intervalSeconds"` 164 // TimeoutSeconds is the time to wait for updates before giving up. If the 165 // value is nil, a default will be used. 166 TimeoutSeconds *int64 `json:"timeoutSeconds,omitempty" protobuf:"varint,3,opt,name=timeoutSeconds"` 167 // MaxUnavailable is the maximum number of pods that can be unavailable 168 // during the update. Value can be an absolute number (ex: 5) or a 169 // percentage of total pods at the start of update (ex: 10%). Absolute 170 // number is calculated from percentage by rounding down. 171 // 172 // This cannot be 0 if MaxSurge is 0. By default, 25% is used. 173 // 174 // Example: when this is set to 30%, the old RC can be scaled down by 30% 175 // immediately when the rolling update starts. Once new pods are ready, old 176 // RC can be scaled down further, followed by scaling up the new RC, 177 // ensuring that at least 70% of original number of pods are available at 178 // all times during the update. 179 MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty" protobuf:"bytes,4,opt,name=maxUnavailable"` 180 // MaxSurge is the maximum number of pods that can be scheduled above the 181 // original number of pods. Value can be an absolute number (ex: 5) or a 182 // percentage of total pods at the start of the update (ex: 10%). Absolute 183 // number is calculated from percentage by rounding up. 184 // 185 // This cannot be 0 if MaxUnavailable is 0. By default, 25% is used. 186 // 187 // Example: when this is set to 30%, the new RC can be scaled up by 30% 188 // immediately when the rolling update starts. Once old pods have been 189 // killed, new RC can be scaled up further, ensuring that total number of 190 // pods running at any time during the update is atmost 130% of original 191 // pods. 192 MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty" protobuf:"bytes,5,opt,name=maxSurge"` 193 // Pre is a lifecycle hook which is executed before the deployment process 194 // begins. All LifecycleHookFailurePolicy values are supported. 195 Pre *LifecycleHook `json:"pre,omitempty" protobuf:"bytes,7,opt,name=pre"` 196 // Post is a lifecycle hook which is executed after the strategy has 197 // finished all deployment logic. All LifecycleHookFailurePolicy values 198 // are supported. 199 Post *LifecycleHook `json:"post,omitempty" protobuf:"bytes,8,opt,name=post"` 200 } 201 202 // LifecycleHook defines a specific deployment lifecycle action. Only one type of action may be specified at any time. 203 type LifecycleHook struct { 204 // FailurePolicy specifies what action to take if the hook fails. 205 FailurePolicy LifecycleHookFailurePolicy `json:"failurePolicy" protobuf:"bytes,1,opt,name=failurePolicy,casttype=LifecycleHookFailurePolicy"` 206 207 // ExecNewPod specifies the options for a lifecycle hook backed by a pod. 208 ExecNewPod *ExecNewPodHook `json:"execNewPod,omitempty" protobuf:"bytes,2,opt,name=execNewPod"` 209 210 // TagImages instructs the deployer to tag the current image referenced under a container onto an image stream tag. 211 TagImages []TagImageHook `json:"tagImages,omitempty" protobuf:"bytes,3,rep,name=tagImages"` 212 } 213 214 // LifecycleHookFailurePolicy describes possibles actions to take if a hook fails. 215 type LifecycleHookFailurePolicy string 216 217 const ( 218 // LifecycleHookFailurePolicyRetry means retry the hook until it succeeds. 219 LifecycleHookFailurePolicyRetry LifecycleHookFailurePolicy = "Retry" 220 // LifecycleHookFailurePolicyAbort means abort the deployment. 221 LifecycleHookFailurePolicyAbort LifecycleHookFailurePolicy = "Abort" 222 // LifecycleHookFailurePolicyIgnore means ignore failure and continue the deployment. 223 LifecycleHookFailurePolicyIgnore LifecycleHookFailurePolicy = "Ignore" 224 ) 225 226 // ExecNewPodHook is a hook implementation which runs a command in a new pod 227 // based on the specified container which is assumed to be part of the 228 // deployment template. 229 type ExecNewPodHook struct { 230 // Command is the action command and its arguments. 231 Command []string `json:"command" protobuf:"bytes,1,rep,name=command"` 232 // Env is a set of environment variables to supply to the hook pod's container. 233 Env []corev1.EnvVar `json:"env,omitempty" protobuf:"bytes,2,rep,name=env"` 234 // ContainerName is the name of a container in the deployment pod template 235 // whose container image will be used for the hook pod's container. 236 ContainerName string `json:"containerName" protobuf:"bytes,3,opt,name=containerName"` 237 // Volumes is a list of named volumes from the pod template which should be 238 // copied to the hook pod. Volumes names not found in pod spec are ignored. 239 // An empty list means no volumes will be copied. 240 Volumes []string `json:"volumes,omitempty" protobuf:"bytes,4,rep,name=volumes"` 241 } 242 243 // TagImageHook is a request to tag the image in a particular container onto an ImageStreamTag. 244 type TagImageHook struct { 245 // ContainerName is the name of a container in the deployment config whose image value will be used as the source of the tag. If there is only a single 246 // container this value will be defaulted to the name of that container. 247 ContainerName string `json:"containerName" protobuf:"bytes,1,opt,name=containerName"` 248 // To is the target ImageStreamTag to set the container's image onto. 249 To corev1.ObjectReference `json:"to" protobuf:"bytes,2,opt,name=to"` 250 } 251 252 // DeploymentTriggerPolicies is a list of policies where nil values and different from empty arrays. 253 // +protobuf.nullable=true 254 // +protobuf.options.(gogoproto.goproto_stringer)=false 255 type DeploymentTriggerPolicies []DeploymentTriggerPolicy 256 257 func (t DeploymentTriggerPolicies) String() string { 258 return fmt.Sprintf("%v", []DeploymentTriggerPolicy(t)) 259 } 260 261 // DeploymentTriggerPolicy describes a policy for a single trigger that results in a new deployment. 262 type DeploymentTriggerPolicy struct { 263 // Type of the trigger 264 Type DeploymentTriggerType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type,casttype=DeploymentTriggerType"` 265 // ImageChangeParams represents the parameters for the ImageChange trigger. 266 ImageChangeParams *DeploymentTriggerImageChangeParams `json:"imageChangeParams,omitempty" protobuf:"bytes,2,opt,name=imageChangeParams"` 267 } 268 269 // DeploymentTriggerType refers to a specific DeploymentTriggerPolicy implementation. 270 type DeploymentTriggerType string 271 272 const ( 273 // DeploymentTriggerOnImageChange will create new deployments in response to updated tags from 274 // a container image repository. 275 DeploymentTriggerOnImageChange DeploymentTriggerType = "ImageChange" 276 // DeploymentTriggerOnConfigChange will create new deployments in response to changes to 277 // the ControllerTemplate of a DeploymentConfig. 278 DeploymentTriggerOnConfigChange DeploymentTriggerType = "ConfigChange" 279 ) 280 281 // DeploymentTriggerImageChangeParams represents the parameters to the ImageChange trigger. 282 type DeploymentTriggerImageChangeParams struct { 283 // Automatic means that the detection of a new tag value should result in an image update 284 // inside the pod template. 285 Automatic bool `json:"automatic,omitempty" protobuf:"varint,1,opt,name=automatic"` 286 // ContainerNames is used to restrict tag updates to the specified set of container names in a pod. 287 // If multiple triggers point to the same containers, the resulting behavior is undefined. Future 288 // API versions will make this a validation error. If ContainerNames does not point to a valid container, 289 // the trigger will be ignored. Future API versions will make this a validation error. 290 ContainerNames []string `json:"containerNames,omitempty" protobuf:"bytes,2,rep,name=containerNames"` 291 // From is a reference to an image stream tag to watch for changes. From.Name is the only 292 // required subfield - if From.Namespace is blank, the namespace of the current deployment 293 // trigger will be used. 294 From corev1.ObjectReference `json:"from" protobuf:"bytes,3,opt,name=from"` 295 // LastTriggeredImage is the last image to be triggered. 296 LastTriggeredImage string `json:"lastTriggeredImage,omitempty" protobuf:"bytes,4,opt,name=lastTriggeredImage"` 297 } 298 299 // DeploymentConfigStatus represents the current deployment state. 300 type DeploymentConfigStatus struct { 301 // LatestVersion is used to determine whether the current deployment associated with a deployment 302 // config is out of sync. 303 LatestVersion int64 `json:"latestVersion" protobuf:"varint,1,opt,name=latestVersion"` 304 // ObservedGeneration is the most recent generation observed by the deployment config controller. 305 ObservedGeneration int64 `json:"observedGeneration" protobuf:"varint,2,opt,name=observedGeneration"` 306 // Replicas is the total number of pods targeted by this deployment config. 307 Replicas int32 `json:"replicas" protobuf:"varint,3,opt,name=replicas"` 308 // UpdatedReplicas is the total number of non-terminated pods targeted by this deployment config 309 // that have the desired template spec. 310 UpdatedReplicas int32 `json:"updatedReplicas" protobuf:"varint,4,opt,name=updatedReplicas"` 311 // AvailableReplicas is the total number of available pods targeted by this deployment config. 312 AvailableReplicas int32 `json:"availableReplicas" protobuf:"varint,5,opt,name=availableReplicas"` 313 // UnavailableReplicas is the total number of unavailable pods targeted by this deployment config. 314 UnavailableReplicas int32 `json:"unavailableReplicas" protobuf:"varint,6,opt,name=unavailableReplicas"` 315 // Details are the reasons for the update to this deployment config. 316 // This could be based on a change made by the user or caused by an automatic trigger 317 Details *DeploymentDetails `json:"details,omitempty" protobuf:"bytes,7,opt,name=details"` 318 // Conditions represents the latest available observations of a deployment config's current state. 319 // +patchMergeKey=type 320 // +patchStrategy=merge 321 Conditions []DeploymentCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,8,rep,name=conditions"` 322 // Total number of ready pods targeted by this deployment. 323 ReadyReplicas int32 `json:"readyReplicas,omitempty" protobuf:"varint,9,opt,name=readyReplicas"` 324 } 325 326 // DeploymentDetails captures information about the causes of a deployment. 327 type DeploymentDetails struct { 328 // Message is the user specified change message, if this deployment was triggered manually by the user 329 Message string `json:"message,omitempty" protobuf:"bytes,1,opt,name=message"` 330 // Causes are extended data associated with all the causes for creating a new deployment 331 Causes []DeploymentCause `json:"causes" protobuf:"bytes,2,rep,name=causes"` 332 } 333 334 // DeploymentCause captures information about a particular cause of a deployment. 335 type DeploymentCause struct { 336 // Type of the trigger that resulted in the creation of a new deployment 337 Type DeploymentTriggerType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=DeploymentTriggerType"` 338 // ImageTrigger contains the image trigger details, if this trigger was fired based on an image change 339 ImageTrigger *DeploymentCauseImageTrigger `json:"imageTrigger,omitempty" protobuf:"bytes,2,opt,name=imageTrigger"` 340 } 341 342 // DeploymentCauseImageTrigger represents details about the cause of a deployment originating 343 // from an image change trigger 344 type DeploymentCauseImageTrigger struct { 345 // From is a reference to the changed object which triggered a deployment. The field may have 346 // the kinds DockerImage, ImageStreamTag, or ImageStreamImage. 347 From corev1.ObjectReference `json:"from" protobuf:"bytes,1,opt,name=from"` 348 } 349 350 type DeploymentConditionType string 351 352 // These are valid conditions of a DeploymentConfig. 353 const ( 354 // DeploymentAvailable means the DeploymentConfig is available, ie. at least the minimum available 355 // replicas required (dc.spec.replicas in case the DeploymentConfig is of Recreate type, 356 // dc.spec.replicas - dc.spec.strategy.rollingParams.maxUnavailable in case it's Rolling) are up and 357 // running for at least dc.spec.minReadySeconds. 358 DeploymentAvailable DeploymentConditionType = "Available" 359 // DeploymentProgressing is: 360 // * True: the DeploymentConfig has been successfully deployed or is amidst getting deployed. 361 // The two different states can be determined by looking at the Reason of the Condition. 362 // For example, a complete DC will have {Status: True, Reason: NewReplicationControllerAvailable} 363 // and a DC in the middle of a rollout {Status: True, Reason: ReplicationControllerUpdated}. 364 // TODO: Represent a successfully deployed DC by using something else for Status like Unknown? 365 // * False: the DeploymentConfig has failed to deploy its latest version. 366 // 367 // This condition is purely informational and depends on the dc.spec.strategy.*params.timeoutSeconds 368 // field, which is responsible for the time in seconds to wait for a rollout before deciding that 369 // no progress can be made, thus the rollout is aborted. 370 // 371 // Progress for a DeploymentConfig is considered when new pods scale up or old pods scale down. 372 DeploymentProgressing DeploymentConditionType = "Progressing" 373 // DeploymentReplicaFailure is added in a deployment config when one of its pods 374 // fails to be created or deleted. 375 DeploymentReplicaFailure DeploymentConditionType = "ReplicaFailure" 376 ) 377 378 // DeploymentCondition describes the state of a deployment config at a certain point. 379 type DeploymentCondition struct { 380 // Type of deployment condition. 381 Type DeploymentConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=DeploymentConditionType"` 382 // Status of the condition, one of True, False, Unknown. 383 Status corev1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/kubernetes/pkg/api/v1.ConditionStatus"` 384 // The last time this condition was updated. 385 LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty" protobuf:"bytes,6,opt,name=lastUpdateTime"` 386 // The last time the condition transitioned from one status to another. 387 LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"` 388 // The reason for the condition's last transition. 389 Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"` 390 // A human readable message indicating details about the transition. 391 Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"` 392 } 393 394 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 395 396 // DeploymentConfigList is a collection of deployment configs. 397 // 398 // Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). 399 // +openshift:compatibility-gen:level=1 400 type DeploymentConfigList struct { 401 metav1.TypeMeta `json:",inline"` 402 403 // metadata is the standard list's metadata. 404 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 405 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 406 407 // Items is a list of deployment configs 408 Items []DeploymentConfig `json:"items" protobuf:"bytes,2,rep,name=items"` 409 } 410 411 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 412 413 // DeploymentConfigRollback provides the input to rollback generation. 414 // 415 // Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). 416 // +openshift:compatibility-gen:level=1 417 type DeploymentConfigRollback struct { 418 metav1.TypeMeta `json:",inline"` 419 // Name of the deployment config that will be rolled back. 420 Name string `json:"name" protobuf:"bytes,1,opt,name=name"` 421 // UpdatedAnnotations is a set of new annotations that will be added in the deployment config. 422 UpdatedAnnotations map[string]string `json:"updatedAnnotations,omitempty" protobuf:"bytes,2,rep,name=updatedAnnotations"` 423 // Spec defines the options to rollback generation. 424 Spec DeploymentConfigRollbackSpec `json:"spec" protobuf:"bytes,3,opt,name=spec"` 425 } 426 427 // DeploymentConfigRollbackSpec represents the options for rollback generation. 428 type DeploymentConfigRollbackSpec struct { 429 // From points to a ReplicationController which is a deployment. 430 From corev1.ObjectReference `json:"from" protobuf:"bytes,1,opt,name=from"` 431 // Revision to rollback to. If set to 0, rollback to the last revision. 432 Revision int64 `json:"revision,omitempty" protobuf:"varint,2,opt,name=revision"` 433 // IncludeTriggers specifies whether to include config Triggers. 434 IncludeTriggers bool `json:"includeTriggers" protobuf:"varint,3,opt,name=includeTriggers"` 435 // IncludeTemplate specifies whether to include the PodTemplateSpec. 436 IncludeTemplate bool `json:"includeTemplate" protobuf:"varint,4,opt,name=includeTemplate"` 437 // IncludeReplicationMeta specifies whether to include the replica count and selector. 438 IncludeReplicationMeta bool `json:"includeReplicationMeta" protobuf:"varint,5,opt,name=includeReplicationMeta"` 439 // IncludeStrategy specifies whether to include the deployment Strategy. 440 IncludeStrategy bool `json:"includeStrategy" protobuf:"varint,6,opt,name=includeStrategy"` 441 } 442 443 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 444 445 // DeploymentRequest is a request to a deployment config for a new deployment. 446 // 447 // Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). 448 // +openshift:compatibility-gen:level=1 449 type DeploymentRequest struct { 450 metav1.TypeMeta `json:",inline"` 451 // Name of the deployment config for requesting a new deployment. 452 Name string `json:"name" protobuf:"bytes,1,opt,name=name"` 453 // Latest will update the deployment config with the latest state from all triggers. 454 Latest bool `json:"latest" protobuf:"varint,2,opt,name=latest"` 455 // Force will try to force a new deployment to run. If the deployment config is paused, 456 // then setting this to true will return an Invalid error. 457 Force bool `json:"force" protobuf:"varint,3,opt,name=force"` 458 // ExcludeTriggers instructs the instantiator to avoid processing the specified triggers. 459 // This field overrides the triggers from latest and allows clients to control specific 460 // logic. This field is ignored if not specified. 461 ExcludeTriggers []DeploymentTriggerType `json:"excludeTriggers,omitempty" protobuf:"bytes,4,rep,name=excludeTriggers,casttype=DeploymentTriggerType"` 462 } 463 464 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 465 466 // DeploymentLog represents the logs for a deployment 467 // 468 // Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). 469 // +openshift:compatibility-gen:level=1 470 type DeploymentLog struct { 471 metav1.TypeMeta `json:",inline"` 472 } 473 474 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 475 476 // DeploymentLogOptions is the REST options for a deployment log 477 // 478 // Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). 479 // +openshift:compatibility-gen:level=1 480 type DeploymentLogOptions struct { 481 metav1.TypeMeta `json:",inline"` 482 483 // The container for which to stream logs. Defaults to only container if there is one container in the pod. 484 Container string `json:"container,omitempty" protobuf:"bytes,1,opt,name=container"` 485 // Follow if true indicates that the build log should be streamed until 486 // the build terminates. 487 Follow bool `json:"follow,omitempty" protobuf:"varint,2,opt,name=follow"` 488 // Return previous deployment logs. Defaults to false. 489 Previous bool `json:"previous,omitempty" protobuf:"varint,3,opt,name=previous"` 490 // A relative time in seconds before the current time from which to show logs. If this value 491 // precedes the time a pod was started, only logs since the pod start will be returned. 492 // If this value is in the future, no logs will be returned. 493 // Only one of sinceSeconds or sinceTime may be specified. 494 SinceSeconds *int64 `json:"sinceSeconds,omitempty" protobuf:"varint,4,opt,name=sinceSeconds"` 495 // An RFC3339 timestamp from which to show logs. If this value 496 // precedes the time a pod was started, only logs since the pod start will be returned. 497 // If this value is in the future, no logs will be returned. 498 // Only one of sinceSeconds or sinceTime may be specified. 499 SinceTime *metav1.Time `json:"sinceTime,omitempty" protobuf:"bytes,5,opt,name=sinceTime"` 500 // If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line 501 // of log output. Defaults to false. 502 Timestamps bool `json:"timestamps,omitempty" protobuf:"varint,6,opt,name=timestamps"` 503 // If set, the number of lines from the end of the logs to show. If not specified, 504 // logs are shown from the creation of the container or sinceSeconds or sinceTime 505 TailLines *int64 `json:"tailLines,omitempty" protobuf:"varint,7,opt,name=tailLines"` 506 // If set, the number of bytes to read from the server before terminating the 507 // log output. This may not display a complete final line of logging, and may return 508 // slightly more or slightly less than the specified limit. 509 LimitBytes *int64 `json:"limitBytes,omitempty" protobuf:"varint,8,opt,name=limitBytes"` 510 511 // NoWait if true causes the call to return immediately even if the deployment 512 // is not available yet. Otherwise the server will wait until the deployment has started. 513 // TODO: Fix the tag to 'noWait' in v2 514 NoWait bool `json:"nowait,omitempty" protobuf:"varint,9,opt,name=nowait"` 515 516 // Version of the deployment for which to view logs. 517 Version *int64 `json:"version,omitempty" protobuf:"varint,10,opt,name=version"` 518 } 519