Skip to content
Open
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
13 changes: 11 additions & 2 deletions api/datadoghq/common/datadogpodautoscaler_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,12 +359,21 @@ type DatadogPodAutoscalerConstraints struct {
}

// DatadogPodAutoscalerContainerControlledValues specifies which resource values should be controlled.
// +kubebuilder:validation:Enum:=RequestsAndLimits;RequestsOnly
// +kubebuilder:validation:Enum:=RequestsAndLimits;RequestsOnly;CPURequestsRemoveLimitsMemoryRequestsAndLimits
type DatadogPodAutoscalerContainerControlledValues string

const (
// DatadogPodAutoscalerContainerControlledValuesRequestsAndLimits controls both requests and limits for all resources (CPU and Memory).
DatadogPodAutoscalerContainerControlledValuesRequestsAndLimits DatadogPodAutoscalerContainerControlledValues = "RequestsAndLimits"
DatadogPodAutoscalerContainerControlledValuesRequestsOnly DatadogPodAutoscalerContainerControlledValues = "RequestsOnly"

// DatadogPodAutoscalerContainerControlledValuesRequestsOnly controls only requests for all resources (CPU and Memory).
// Existing limits are left unchanged.
DatadogPodAutoscalerContainerControlledValuesRequestsOnly DatadogPodAutoscalerContainerControlledValues = "RequestsOnly"

// DatadogPodAutoscalerContainerControlledValuesCPURequestsRemoveLimitsMemoryRequestsAndLimits applies different strategies per resource:
// - CPU: only requests are controlled and any existing CPU limit is removed, allowing the container to burst freely and avoid CPU throttling.
// - Memory: both requests and limits are controlled.
DatadogPodAutoscalerContainerControlledValuesCPURequestsRemoveLimitsMemoryRequestsAndLimits DatadogPodAutoscalerContainerControlledValues = "CPURequestsRemoveLimitsMemoryRequestsAndLimits"
)

// DatadogPodAutoscalerContainerConstraints defines constraints that should always be respected for a container.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ spec:
enum:
- RequestsAndLimits
- RequestsOnly
- CPURequestsRemoveLimitsMemoryRequestsAndLimits
type: string
enabled:
description: Enabled, if false, allows one to disable resource autoscaling for the container. Defaults to true.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@
"description": "Specifies whether recommendations are made to Requests and Limits (RequestsAndLimits) or Requests only (RequestsOnly).\nThe default is \"RequestsAndLimits\".",
"enum": [
"RequestsAndLimits",
"RequestsOnly"
"RequestsOnly",
"CPURequestsRemoveLimitsMemoryRequestsAndLimits"
],
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ spec:
enum:
- RequestsAndLimits
- RequestsOnly
- CPURequestsRemoveLimitsMemoryRequestsAndLimits
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Regenerate packaged CRDs for new controlledValues enum

This adds CPURequestsRemoveLimitsMemoryRequestsAndLimits to the source CRD schema, but the distributed CRD artifacts still shipped from this repo (bundle/manifests/datadoghq.com_datadogpodautoscalers.yaml and marketplaces/charts/google-marketplace/chart/datadog-mp/templates/manifests.yaml) still only allow RequestsAndLimits and RequestsOnly. In installs that use those packaged manifests (OLM bundle / marketplace), the new mode will be rejected by CRD validation, so the feature is only partially delivered.

Useful? React with 👍 / 👎.

type: string
enabled:
description: Enabled, if false, allows one to disable resource autoscaling for the container. Defaults to true.
Expand Down Expand Up @@ -1044,6 +1045,7 @@ spec:
enum:
- RequestsAndLimits
- RequestsOnly
- CPURequestsRemoveLimitsMemoryRequestsAndLimits
type: string
enabled:
description: Enabled, if false, allows one to disable resource autoscaling for the container. Defaults to true.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"description": "Specifies whether recommendations are made to Requests and Limits (RequestsAndLimits) or Requests only (RequestsOnly).\nThe default is \"RequestsAndLimits\".",
"enum": [
"RequestsAndLimits",
"RequestsOnly"
"RequestsOnly",
"CPURequestsRemoveLimitsMemoryRequestsAndLimits"
],
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@
"description": "Specifies whether recommendations are made to Requests and Limits (RequestsAndLimits) or Requests only (RequestsOnly).\nThe default is \"RequestsAndLimits\".",
"enum": [
"RequestsAndLimits",
"RequestsOnly"
"RequestsOnly",
"CPURequestsRemoveLimitsMemoryRequestsAndLimits"
],
"type": "string"
},
Expand Down
Loading