Skip to content

Commit

Permalink
feat(lifecycle-operator): introduce ObservabilityTimeout parameter in…
Browse files Browse the repository at this point in the history
… KeptnWorkload

Signed-off-by: odubajDT <[email protected]>
  • Loading branch information
odubajDT committed Feb 29, 2024
1 parent 65f7327 commit cb871db
Show file tree
Hide file tree
Showing 13 changed files with 123 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/scripts/.helm-tests/default/result.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7302,6 +7302,14 @@ spec:
description: Metadata contains additional key-value pairs for contextual
information.
type: object
observabilityTimeout:
default: 5m
description: |-
ObservabilityTimeout specifies the maximum time to observe the deployment phase of KeptnWorkload.
If the workload does not deploy successfully within this time frame, it will be
considered as failed.
pattern: ^0|([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$
type: string
postDeploymentEvaluations:
description: |-
PostDeploymentEvaluations is a list of all evaluations to be performed
Expand Down Expand Up @@ -7791,6 +7799,14 @@ spec:
description: Metadata contains additional key-value pairs for contextual
information.
type: object
observabilityTimeout:
default: 5m
description: |-
ObservabilityTimeout specifies the maximum time to observe the deployment phase of KeptnWorkload.
If the workload does not deploy successfully within this time frame, it will be
considered as failed.
pattern: ^0|([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$
type: string
postDeploymentEvaluations:
description: |-
PostDeploymentEvaluations is a list of all evaluations to be performed
Expand Down Expand Up @@ -7884,6 +7900,11 @@ spec:
- PostDeploymentTasks
- PostDeploymentEvaluations
type: string
deploymentStartTime:
description: DeploymentStartTime represents the start time of the
deployment phase
format: date-time
type: string
deploymentStatus:
default: Pending
description: DeploymentStatus indicates the current status of the
Expand Down
21 changes: 21 additions & 0 deletions .github/scripts/.helm-tests/lifecycle-only/result.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7248,6 +7248,14 @@ spec:
description: Metadata contains additional key-value pairs for contextual
information.
type: object
observabilityTimeout:
default: 5m
description: |-
ObservabilityTimeout specifies the maximum time to observe the deployment phase of KeptnWorkload.
If the workload does not deploy successfully within this time frame, it will be
considered as failed.
pattern: ^0|([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$
type: string
postDeploymentEvaluations:
description: |-
PostDeploymentEvaluations is a list of all evaluations to be performed
Expand Down Expand Up @@ -7737,6 +7745,14 @@ spec:
description: Metadata contains additional key-value pairs for contextual
information.
type: object
observabilityTimeout:
default: 5m
description: |-
ObservabilityTimeout specifies the maximum time to observe the deployment phase of KeptnWorkload.
If the workload does not deploy successfully within this time frame, it will be
considered as failed.
pattern: ^0|([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$
type: string
postDeploymentEvaluations:
description: |-
PostDeploymentEvaluations is a list of all evaluations to be performed
Expand Down Expand Up @@ -7830,6 +7846,11 @@ spec:
- PostDeploymentTasks
- PostDeploymentEvaluations
type: string
deploymentStartTime:
description: DeploymentStartTime represents the start time of the
deployment phase
format: date-time
type: string
deploymentStatus:
default: Pending
description: DeploymentStatus indicates the current status of the
Expand Down
21 changes: 21 additions & 0 deletions .github/scripts/.helm-tests/lifecycle-with-certs/result.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7282,6 +7282,14 @@ spec:
description: Metadata contains additional key-value pairs for contextual
information.
type: object
observabilityTimeout:
default: 5m
description: |-
ObservabilityTimeout specifies the maximum time to observe the deployment phase of KeptnWorkload.
If the workload does not deploy successfully within this time frame, it will be
considered as failed.
pattern: ^0|([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$
type: string
postDeploymentEvaluations:
description: |-
PostDeploymentEvaluations is a list of all evaluations to be performed
Expand Down Expand Up @@ -7772,6 +7780,14 @@ spec:
description: Metadata contains additional key-value pairs for contextual
information.
type: object
observabilityTimeout:
default: 5m
description: |-
ObservabilityTimeout specifies the maximum time to observe the deployment phase of KeptnWorkload.
If the workload does not deploy successfully within this time frame, it will be
considered as failed.
pattern: ^0|([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$
type: string
postDeploymentEvaluations:
description: |-
PostDeploymentEvaluations is a list of all evaluations to be performed
Expand Down Expand Up @@ -7865,6 +7881,11 @@ spec:
- PostDeploymentTasks
- PostDeploymentEvaluations
type: string
deploymentStartTime:
description: DeploymentStartTime represents the start time of the
deployment phase
format: date-time
type: string
deploymentStatus:
default: Pending
description: DeploymentStatus indicates the current status of the
Expand Down
3 changes: 3 additions & 0 deletions docs/docs/reference/api-reference/lifecycle/v1beta1/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,7 @@ _Appears in:_
| `postDeploymentEvaluations` _string array_ | PostDeploymentEvaluations is a list of all evaluations to be performed during the post-deployment phase of the KeptnWorkload. The items of this list refer to the names of KeptnEvaluationDefinitions located in the same namespace as the KeptnWorkload, or in the Keptn namespace. |||
| `resourceReference` _[ResourceReference](#resourcereference)_ | ResourceReference is a reference to the Kubernetes resource (Deployment, DaemonSet, StatefulSet or ReplicaSet) the KeptnWorkload is representing. || x |
| `metadata` _object (keys:string, values:string)_ | Metadata contains additional key-value pairs for contextual information. |||
| `observabilityTimeout` _[Duration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#duration-v1-meta)_ | ObservabilityTimeout specifies the maximum time to observe the deployment phase of KeptnWorkload. If the workload does not deploy successfully within this time frame, it will be considered as failed. |5m||


#### KeptnWorkloadStatus
Expand Down Expand Up @@ -896,6 +897,7 @@ _Appears in:_
| `postDeploymentEvaluations` _string array_ | PostDeploymentEvaluations is a list of all evaluations to be performed during the post-deployment phase of the KeptnWorkload. The items of this list refer to the names of KeptnEvaluationDefinitions located in the same namespace as the KeptnWorkload, or in the Keptn namespace. |||
| `resourceReference` _[ResourceReference](#resourcereference)_ | ResourceReference is a reference to the Kubernetes resource (Deployment, DaemonSet, StatefulSet or ReplicaSet) the KeptnWorkload is representing. || x |
| `metadata` _object (keys:string, values:string)_ | Metadata contains additional key-value pairs for contextual information. |||
| `observabilityTimeout` _[Duration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#duration-v1-meta)_ | ObservabilityTimeout specifies the maximum time to observe the deployment phase of KeptnWorkload. If the workload does not deploy successfully within this time frame, it will be considered as failed. |5m||
| `workloadName` _string_ | WorkloadName is the name of the KeptnWorkload. || x |
| `previousVersion` _string_ | PreviousVersion is the version of the KeptnWorkload that has been deployed prior to this version. |||
| `traceId` _object (keys:string, values:string)_ | TraceId contains the OpenTelemetry trace ID. |||
Expand Down Expand Up @@ -927,6 +929,7 @@ _Appears in:_
| `phaseTraceIDs` _[MapCarrier](https://pkg.go.dev/go.opentelemetry.io/otel/propagation#MapCarrier)_ | PhaseTraceIDs contains the trace IDs of the OpenTelemetry spans of each phase of the KeptnWorkloadVersion |||
| `status` _string_ | Status represents the overall status of the KeptnWorkloadVersion. |Pending||
| `appContextMetadata` _object (keys:string, values:string)_ | AppContextMetadata contains metadata from the related KeptnAppVersion. |||
| `deploymentStartTime` _[Time](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#time-v1-meta)_ | DeploymentStartTime represents the start time of the deployment phase |||


#### Objective
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ type KeptnWorkloadSpec struct {
// +optional
// Metadata contains additional key-value pairs for contextual information.
Metadata map[string]string `json:"metadata,omitempty"`
// ObservabilityTimeout specifies the maximum time to observe the deployment phase of KeptnWorkload.
// If the workload does not deploy successfully within this time frame, it will be
// considered as failed.
// +kubebuilder:default:="5m"
// +kubebuilder:validation:Pattern="^0|([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$"
// +kubebuilder:validation:Type:=string
// +optional
ObservabilityTimeout metav1.Duration `json:"observabilityTimeout,omitempty"`
}

// KeptnWorkloadStatus defines the observed state of KeptnWorkload
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ type KeptnWorkloadVersionStatus struct {
// AppContextMetadata contains metadata from the related KeptnAppVersion.
// +optional
AppContextMetadata map[string]string `json:"appContextMetadata,omitempty"`
// DeploymentStartTime represents the start time of the deployment phase
// +optional
DeploymentStartTime metav1.Time `json:"deploymentStartTime,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions lifecycle-operator/chart/templates/keptnworkload-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,14 @@ spec:
description: Metadata contains additional key-value pairs for contextual
information.
type: object
observabilityTimeout:
default: 5m
description: |-
ObservabilityTimeout specifies the maximum time to observe the deployment phase of KeptnWorkload.
If the workload does not deploy successfully within this time frame, it will be
considered as failed.
pattern: ^0|([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$
type: string
postDeploymentEvaluations:
description: |-
PostDeploymentEvaluations is a list of all evaluations to be performed
Expand Down
13 changes: 13 additions & 0 deletions lifecycle-operator/chart/templates/keptnworkloadversion-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,14 @@ spec:
description: Metadata contains additional key-value pairs for contextual
information.
type: object
observabilityTimeout:
default: 5m
description: |-
ObservabilityTimeout specifies the maximum time to observe the deployment phase of KeptnWorkload.
If the workload does not deploy successfully within this time frame, it will be
considered as failed.
pattern: ^0|([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$
type: string
postDeploymentEvaluations:
description: |-
PostDeploymentEvaluations is a list of all evaluations to be performed
Expand Down Expand Up @@ -502,6 +510,11 @@ spec:
- PostDeploymentTasks
- PostDeploymentEvaluations
type: string
deploymentStartTime:
description: DeploymentStartTime represents the start time of the
deployment phase
format: date-time
type: string
deploymentStatus:
default: Pending
description: DeploymentStatus indicates the current status of the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,14 @@ spec:
description: Metadata contains additional key-value pairs for contextual
information.
type: object
observabilityTimeout:
default: 5m
description: |-
ObservabilityTimeout specifies the maximum time to observe the deployment phase of KeptnWorkload.
If the workload does not deploy successfully within this time frame, it will be
considered as failed.
pattern: ^0|([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$
type: string
postDeploymentEvaluations:
description: |-
PostDeploymentEvaluations is a list of all evaluations to be performed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,14 @@ spec:
description: Metadata contains additional key-value pairs for contextual
information.
type: object
observabilityTimeout:
default: 5m
description: |-
ObservabilityTimeout specifies the maximum time to observe the deployment phase of KeptnWorkload.
If the workload does not deploy successfully within this time frame, it will be
considered as failed.
pattern: ^0|([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$
type: string
postDeploymentEvaluations:
description: |-
PostDeploymentEvaluations is a list of all evaluations to be performed
Expand Down Expand Up @@ -494,6 +502,11 @@ spec:
- PostDeploymentTasks
- PostDeploymentEvaluations
type: string
deploymentStartTime:
description: DeploymentStartTime represents the start time of the
deployment phase
format: date-time
type: string
deploymentStatus:
default: Pending
description: DeploymentStatus indicates the current status of the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ kind: KeptnWorkload
metadata:
name: keptnworkload-sample
spec:
observabilityTimeout: 5m
app: "some-keptn-app2"
version: "0.2.7"
preDeploymentTasks:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ metadata:
traceparent: my-trace-parent
name: some-keptn-workload-version
spec:
observabilityTimeout: 5m
app: podtato-head
resourceReference:
kind: ReplicaSet
Expand Down

0 comments on commit cb871db

Please sign in to comment.