Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lifecycle-operator): introduce ObservabilityTimeout parameter in KeptnConfig #3149

Merged
merged 2 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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))+$"
odubajDT marked this conversation as resolved.
Show resolved Hide resolved
// +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
Loading