Skip to content

Commit

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

Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
  • Loading branch information
odubajDT committed Mar 1, 2024
1 parent de077c7 commit 79de15e
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/scripts/.helm-tests/default/result.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2056,6 +2056,14 @@ spec:
KeptnAppCreationRequestTimeoutSeconds is used to set the interval in which automatic app discovery
searches for workload to put into the same auto-generated KeptnApp
type: integer
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
type: object
status:
description: unused field
Expand Down
8 changes: 8 additions & 0 deletions .github/scripts/.helm-tests/lifecycle-only/result.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2002,6 +2002,14 @@ spec:
KeptnAppCreationRequestTimeoutSeconds is used to set the interval in which automatic app discovery
searches for workload to put into the same auto-generated KeptnApp
type: integer
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
type: object
status:
description: unused field
Expand Down
8 changes: 8 additions & 0 deletions .github/scripts/.helm-tests/lifecycle-with-certs/result.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2031,6 +2031,14 @@ spec:
KeptnAppCreationRequestTimeoutSeconds is used to set the interval in which automatic app discovery
searches for workload to put into the same auto-generated KeptnApp
type: integer
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
type: object
status:
description: unused field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,6 @@ _Appears in:_
| `keptnAppCreationRequestTimeoutSeconds` _integer_ | KeptnAppCreationRequestTimeoutSeconds is used to set the interval in which automatic app discovery searches for workload to put into the same auto-generated KeptnApp |30||
| `cloudEventsEndpoint` _string_ | CloudEventsEndpoint can be used to set the endpoint where Cloud Events should be posted by the lifecycle operator |||
| `blockDeployment` _boolean_ | BlockDeployment is used to block the deployment of the application until the pre-deployment tasks and evaluations succeed |true||
| `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||


9 changes: 9 additions & 0 deletions docs/docs/reference/crd-reference/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ spec:
keptnAppCreationRequestTimeoutSeconds: <#-seconds>
cloudEventsEndpoint: <endpoint>
blockDeployment: true | false
observabilityTimeout: <duration>
```

## Fields
Expand Down Expand Up @@ -48,6 +49,13 @@ spec:
even if the pre-deployment tasks and/or evaluations fail.
For more information see the
[non-blocking deployment section](../../components/lifecycle-operator/keptn-non-blocking.md).
* **observabilityTimeout** -- specifies the maximum time
to observe the deployment phase of
[KeptnWorkload](../api-reference/lifecycle/v1beta1/index.md).
The value supplied should specify the unit of measurement;
for example, `5m` indicates 5 minutes and `1h` indicates 1 hour.
If the workload is not deployed successfully within this time frame,
it is considered to be failed.

## Usage

Expand All @@ -73,6 +81,7 @@ spec:
keptnAppCreationRequestTimeoutSeconds: 40
cloudEventsEndpoint: 'http://endpoint.com'
blockDeployment: false
observabilityTimeout: 10m
```

## Files
Expand Down
9 changes: 9 additions & 0 deletions lifecycle-operator/apis/options/v1alpha1/keptnconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ type KeptnConfigSpec struct {
// +kubebuilder:default:=true
// +optional
BlockDeployment bool `json:"blockDeployment,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"`
}

// +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/keptnconfig-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ spec:
KeptnAppCreationRequestTimeoutSeconds is used to set the interval in which automatic app discovery
searches for workload to put into the same auto-generated KeptnApp
type: integer
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
type: object
status:
description: unused field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ spec:
KeptnAppCreationRequestTimeoutSeconds is used to set the interval in which automatic app discovery
searches for workload to put into the same auto-generated KeptnApp
type: integer
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
type: object
status:
description: unused field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ metadata:
spec:
OTelCollectorUrl: 'otel-collector:4317'
keptnAppCreationRequestTimeoutSeconds: 30
blockDeployment: true
observabilityTimeout: 5m

0 comments on commit 79de15e

Please sign in to comment.