Skip to content
Draft
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
11 changes: 11 additions & 0 deletions api/datadoghq/common/datadogpodautoscaler_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,17 @@ type DatadogPodAutoscalerContainerResourceConstraints struct {
MaxAllowed corev1.ResourceList `json:"maxAllowed,omitempty"`
}

// DatadogPodAutoscalerRecommendationOptions defines options for how recommendations are generated.
// +kubebuilder:object:generate=true
type DatadogPodAutoscalerRecommendationOptions struct {
// OOMBumpUpRatio is the ratio to increase memory when OOM is detected.
// This is a pod-level setting that applies to memory scaling recommendations.
// Use a plain number (e.g., "1.2" means increase by 20%).
// Represented as a resource.Quantity to avoid floating point in CRDs.
// +optional
OOMBumpUpRatio *resource.Quantity `json:"oomBumpUpRatio,omitempty"`
}

// DatadogPodAutoscalerStatus defines the observed state of DatadogPodAutoscaler
// +kubebuilder:object:generate=true
type DatadogPodAutoscalerStatus struct {
Expand Down
20 changes: 20 additions & 0 deletions api/datadoghq/common/zz_generated.deepcopy.go

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

6 changes: 6 additions & 0 deletions api/datadoghq/v1alpha2/datadogpodautoscaler_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ import (
// requests:
// minAllowed:
// maxAllowed:
// recommendationOptions:
// oomBumpUpRatio: 1.2

// DatadogPodAutoscalerSpec defines the desired state of DatadogPodAutoscaler
type DatadogPodAutoscalerSpec struct {
Expand Down Expand Up @@ -121,6 +123,10 @@ type DatadogPodAutoscalerSpec struct {

// Constraints defines constraints that should always be respected.
Constraints *common.DatadogPodAutoscalerConstraints `json:"constraints,omitempty"`

// RecommendationOptions defines options for how recommendations are generated.
// +optional
RecommendationOptions *common.DatadogPodAutoscalerRecommendationOptions `json:"recommendationOptions,omitempty"`
}

// DatadogPodAutoscalerApplyMode specifies if the controller should apply recommendations.
Expand Down
5 changes: 5 additions & 0 deletions api/datadoghq/v1alpha2/zz_generated.deepcopy.go

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

15 changes: 15 additions & 0 deletions config/crd/bases/v1/datadoghq.com_datadogpodautoscalers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1501,6 +1501,21 @@ spec:
- Local
- Remote
type: string
recommendationOptions:
description: RecommendationOptions defines options for how recommendations are generated.
properties:
oomBumpUpRatio:
anyOf:
- type: integer
- type: string
description: |-
OOMBumpUpRatio is the ratio to increase memory when OOM is detected.
This is a pod-level setting that applies to memory scaling recommendations.
Use a plain number (e.g., "1.2" means increase by 20%).
Represented as a resource.Quantity to avoid floating point in CRDs.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
remoteVersion:
description: |-
RemoteVersion is the version of the .Spec currently stored in this object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,26 @@
],
"type": "string"
},
"recommendationOptions": {
"additionalProperties": false,
"description": "RecommendationOptions defines options for how recommendations are generated.",
"properties": {
"oomBumpUpRatio": {
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
],
"description": "OOMBumpUpRatio is the ratio to increase memory when OOM is detected.\nThis is a pod-level setting that applies to memory scaling recommendations.\nUse a plain number (e.g., \"1.2\" means increase by 20%).\nRepresented as a resource.Quantity to avoid floating point in CRDs.",
"pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
"x-kubernetes-int-or-string": true
}
},
"type": "object"
},
"remoteVersion": {
"description": "RemoteVersion is the version of the .Spec currently stored in this object.\nThis is only set if the owner is Remote.",
"format": "int64",
Expand Down
Loading