Skip to content

Commit bbf7624

Browse files
authored
Merge branch 'main' into khewonc/refactor-experiment-signals
2 parents fa556ba + bed889f commit bbf7624

201 files changed

Lines changed: 21647 additions & 14047 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ README.md @DataDog/documentation @DataDog/container-platform
3737
/internal/controller/datadogagent/feature/livecontainer @DataDog/container-experiences @DataDog/container-platform
3838
/internal/controller/datadogagent/feature/liveprocess @DataDog/container-experiences @DataDog/container-platform
3939
/internal/controller/datadogagent/feature/logcollection @DataDog/agent-log-pipelines @DataDog/container-platform
40-
/internal/controller/datadogagent/feature/npm @DataDog/ndm-core @DataDog/container-platform
40+
/internal/controller/datadogagent/feature/npm @DataDog/cloud-network-monitoring @DataDog/container-platform
4141
/internal/controller/datadogagent/feature/oomkill @DataDog/ebpf-platform @DataDog/container-platform
4242
/internal/controller/datadogagent/feature/orchestratorexplorer @DataDog/kubernetes-experiences @DataDog/container-platform
4343
/internal/controller/datadogagent/feature/otelagentgateway @DataDog/opentelemetry-agent @DataDog/container-platform

.github/chainguard/self.operatorrelease-prod.sts.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/chainguard/self.operatorrelease-staging.sts.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

LICENSE-3rdparty.csv

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ core,github.com/aws/aws-sdk-go-v2/internal/configsources,Apache-2.0
5050
core,github.com/aws/aws-sdk-go-v2/internal/endpoints/v2,Apache-2.0
5151
core,github.com/aws/aws-sdk-go-v2/internal/ini,Apache-2.0
5252
core,github.com/aws/aws-sdk-go-v2/internal/sync/singleflight,BSD-3-Clause
53+
core,github.com/aws/aws-sdk-go-v2/service/autoscaling,Apache-2.0
5354
core,github.com/aws/aws-sdk-go-v2/service/cloudformation,Apache-2.0
5455
core,github.com/aws/aws-sdk-go-v2/service/ec2,Apache-2.0
5556
core,github.com/aws/aws-sdk-go-v2/service/eks,Apache-2.0
@@ -76,7 +77,7 @@ core,github.com/containerd/containerd,Apache-2.0
7677
core,github.com/containerd/errdefs,Apache-2.0
7778
core,github.com/containerd/log,Apache-2.0
7879
core,github.com/containerd/platforms,Apache-2.0
79-
core,github.com/cyphar/filepath-securejoin,BSD-3-Clause
80+
core,github.com/cyphar/filepath-securejoin,MPL-2.0
8081
core,github.com/davecgh/go-spew/spew,ISC
8182
core,github.com/dsnet/compress,BSD-3-Clause
8283
core,github.com/dustin/go-humanize,MIT
@@ -114,6 +115,7 @@ core,github.com/golang/snappy,BSD-3-Clause
114115
core,github.com/google/btree,Apache-2.0
115116
core,github.com/google/cel-go,Apache-2.0
116117
core,github.com/google/gnostic-models,Apache-2.0
118+
core,github.com/google/go-containerregistry/pkg/name,Apache-2.0
117119
core,github.com/google/pprof/profile,Apache-2.0
118120
core,github.com/google/uuid,BSD-3-Clause
119121
core,github.com/gorilla/websocket,BSD-2-Clause

PROJECT

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ resources:
7272
kind: DatadogPodAutoscaler
7373
path: github.com/DataDog/datadog-operator/api/datadoghq/v1alpha1
7474
version: v1alpha1
75+
- api:
76+
crdVersion: v1
77+
namespaced: true
78+
domain: com
79+
group: datadoghq
80+
kind: DatadogInstrumentation
81+
path: github.com/DataDog/datadog-operator/api/datadoghq/v1alpha1
82+
version: v1alpha1
7583
- api:
7684
crdVersion: v1
7785
namespaced: true

api/datadoghq/common/datadogpodautoscaler_types.go

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,12 +359,21 @@ type DatadogPodAutoscalerConstraints struct {
359359
}
360360

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

365365
const (
366+
// DatadogPodAutoscalerContainerControlledValuesRequestsAndLimits controls both requests and limits for all resources (CPU and Memory).
366367
DatadogPodAutoscalerContainerControlledValuesRequestsAndLimits DatadogPodAutoscalerContainerControlledValues = "RequestsAndLimits"
367-
DatadogPodAutoscalerContainerControlledValuesRequestsOnly DatadogPodAutoscalerContainerControlledValues = "RequestsOnly"
368+
369+
// DatadogPodAutoscalerContainerControlledValuesRequestsOnly controls only requests for all resources (CPU and Memory).
370+
// Existing limits are left unchanged.
371+
DatadogPodAutoscalerContainerControlledValuesRequestsOnly DatadogPodAutoscalerContainerControlledValues = "RequestsOnly"
372+
373+
// DatadogPodAutoscalerContainerControlledValuesCPURequestsRemoveLimitsMemoryRequestsAndLimits applies different strategies per resource:
374+
// - CPU: only requests are controlled and any existing CPU limit is removed, allowing the container to burst freely and avoid CPU throttling.
375+
// - Memory: both requests and limits are controlled.
376+
DatadogPodAutoscalerContainerControlledValuesCPURequestsRemoveLimitsMemoryRequestsAndLimits DatadogPodAutoscalerContainerControlledValues = "CPURequestsRemoveLimitsMemoryRequestsAndLimits"
368377
)
369378

370379
// DatadogPodAutoscalerContainerConstraints defines constraints that should always be respected for a container.
@@ -419,6 +428,12 @@ type DatadogPodAutoscalerOptions struct {
419428
// OutOfMemory configures behavior when OOM events are detected.
420429
// +optional
421430
OutOfMemory *DatadogPodAutoscalerOutOfMemoryOptions `json:"outOfMemory,omitempty"`
431+
432+
// Burstable, if true, removes CPU limits from containers while keeping CPU request recommendations,
433+
// granting the pod a Burstable QoS class and allowing it to consume idle node CPU capacity beyond its requests.
434+
// If not set, the default value is determined by the Cluster Agent setting autoscaling.workload.options.burstable.
435+
// +optional
436+
Burstable *bool `json:"burstable,omitempty"`
422437
}
423438

424439
// DatadogPodAutoscalerOutOfMemoryOptions configures the behavior when out-of-memory events are detected.
@@ -431,6 +446,16 @@ type DatadogPodAutoscalerOutOfMemoryOptions struct {
431446
BumpUpRatio *resource.Quantity `json:"bumpUpRatio,omitempty"`
432447
}
433448

449+
// DatadogPodAutoscalerOptionsStatus reflects the effective options applied by the autoscaler.
450+
// +kubebuilder:object:generate=true
451+
type DatadogPodAutoscalerOptionsStatus struct {
452+
// Burstable is the effective value of the burstable setting applied by the autoscaler.
453+
// When not set in the spec, this reflects the default determined by the Cluster Agent
454+
// setting autoscaling.workload.options.burstable.
455+
// +optional
456+
Burstable *bool `json:"burstable,omitempty"`
457+
}
458+
434459
// DatadogPodAutoscalerStatus defines the observed state of DatadogPodAutoscaler
435460
// +kubebuilder:object:generate=true
436461
type DatadogPodAutoscalerStatus struct {
@@ -446,6 +471,10 @@ type DatadogPodAutoscalerStatus struct {
446471
// +optional
447472
CurrentReplicas *int32 `json:"currentReplicas,omitempty"`
448473

474+
// Options reflects the effective options applied by the autoscaler.
475+
// +optional
476+
Options *DatadogPodAutoscalerOptionsStatus `json:"options,omitempty"`
477+
449478
// Conditions describe the current state of the DatadogPodAutoscaler operations.
450479
// +patchMergeKey=type
451480
// +patchStrategy=merge

api/datadoghq/common/zz_generated.deepcopy.go

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/datadoghq/v1alpha1/datadogagentprofile_validation.go

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ import (
1414
)
1515

1616
// ValidateDatadogAgentProfileSpec is used to check if a DatadogAgentProfileSpec is valid
17-
func ValidateDatadogAgentProfileSpec(spec *DatadogAgentProfileSpec, datadogAgentInternalEnabled bool) error {
17+
func ValidateDatadogAgentProfileSpec(spec *DatadogAgentProfileSpec) error {
1818
if err := validateProfileAffinity(spec.ProfileAffinity); err != nil {
1919
return err
2020
}
21-
if err := validateConfig(spec.Config, datadogAgentInternalEnabled); err != nil {
21+
if err := validateConfig(spec.Config); err != nil {
2222
return err
2323
}
2424

@@ -39,20 +39,17 @@ func validateProfileAffinity(profileAffinity *ProfileAffinity) error {
3939
return nil
4040
}
4141

42-
func validateConfig(spec *v2alpha1.DatadogAgentSpec, datadogAgentInternalEnabled bool) error {
42+
func validateConfig(spec *v2alpha1.DatadogAgentSpec) error {
4343
if spec == nil {
4444
return undefinedError("config")
4545
}
46-
if err := validateFeatures(spec.Features, datadogAgentInternalEnabled); err != nil {
46+
if err := validateFeatures(spec.Features); err != nil {
4747
return err
4848
}
4949
// global is not supported
5050
if spec.Global != nil {
5151
return unsupportedError("global")
5252
}
53-
if !datadogAgentInternalEnabled && spec.Override == nil {
54-
return undefinedError("config override")
55-
}
5653
for component, override := range spec.Override {
5754
if err := validateOverride(component, override); err != nil {
5855
return err
@@ -62,13 +59,10 @@ func validateConfig(spec *v2alpha1.DatadogAgentSpec, datadogAgentInternalEnabled
6259
return nil
6360
}
6461

65-
func validateFeatures(features *v2alpha1.DatadogFeatures, datadogAgentInternalEnabled bool) error {
62+
func validateFeatures(features *v2alpha1.DatadogFeatures) error {
6663
if features == nil {
6764
return nil
6865
}
69-
if !datadogAgentInternalEnabled {
70-
return fmt.Errorf("the 'features' field is only supported when DatadogAgentInternal is enabled")
71-
}
7266

7367
// Only GPU feature is currently supported in DatadogAgentProfile context.
7468
// Remove supported features from the `unsupportedFeatures` array.

api/datadoghq/v1alpha1/datadogagentprofile_validation_test.go

Lines changed: 35 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -155,101 +155,70 @@ func TestIsValidDatadogAgentProfile(t *testing.T) {
155155
},
156156
},
157157
}
158-
invalidFeaturesNoDDAI := &DatadogAgentProfileSpec{
159-
ProfileAffinity: basicProfileAffinity,
160-
Config: &v2alpha1.DatadogAgentSpec{
161-
Features: &v2alpha1.DatadogFeatures{
162-
GPU: &v2alpha1.GPUFeatureConfig{
163-
Enabled: ptr.To(true),
164-
},
165-
},
166-
},
167-
}
168-
169158
testCases := []struct {
170-
name string
171-
spec *DatadogAgentProfileSpec
172-
datadogAgentInternalEnabled bool
173-
wantErr string
159+
name string
160+
spec *DatadogAgentProfileSpec
161+
wantErr string
174162
}{
175163
{
176-
name: "valid dap",
177-
spec: valid,
178-
datadogAgentInternalEnabled: true,
179-
},
180-
{
181-
name: "valid dap, resources specified in one container only",
182-
spec: validResourceOverrideInOneContainerOnly,
183-
datadogAgentInternalEnabled: true,
164+
name: "valid dap",
165+
spec: valid,
184166
},
185167
{
186-
name: "invalid component override",
187-
spec: invalidComponentOverride,
188-
datadogAgentInternalEnabled: true,
189-
wantErr: "component node selector override is not supported",
168+
name: "valid dap, resources specified in one container only",
169+
spec: validResourceOverrideInOneContainerOnly,
190170
},
191171
{
192-
name: "invalid container override",
193-
spec: invalidContainerOverride,
194-
datadogAgentInternalEnabled: true,
195-
wantErr: "container command override is not supported",
172+
name: "invalid component override",
173+
spec: invalidComponentOverride,
174+
wantErr: "component node selector override is not supported",
196175
},
197176
{
198-
name: "missing override when ddai disabled",
199-
spec: missingOverride,
200-
datadogAgentInternalEnabled: false,
201-
wantErr: "config override must be defined",
177+
name: "invalid container override",
178+
spec: invalidContainerOverride,
179+
wantErr: "container command override is not supported",
202180
},
203181
{
204-
name: "missing config",
205-
spec: missingConfig,
206-
datadogAgentInternalEnabled: true,
207-
wantErr: "config must be defined",
182+
name: "missing override is valid",
183+
spec: missingOverride,
208184
},
209185
{
210-
name: "missing node selector requirement",
211-
spec: missingNSR,
212-
datadogAgentInternalEnabled: true,
213-
wantErr: "profileNodeAffinity must have at least 1 requirement",
186+
name: "missing config",
187+
spec: missingConfig,
188+
wantErr: "config must be defined",
214189
},
215190
{
216-
name: "missing profile node affinity",
217-
spec: missingNodeAffinity,
218-
datadogAgentInternalEnabled: true,
219-
wantErr: "profileNodeAffinity must be defined",
191+
name: "missing node selector requirement",
192+
spec: missingNSR,
193+
wantErr: "profileNodeAffinity must have at least 1 requirement",
220194
},
221195
{
222-
name: "missing profile affinity",
223-
spec: missingProfileAffinity,
224-
datadogAgentInternalEnabled: true,
225-
wantErr: "profileAffinity must be defined",
196+
name: "missing profile node affinity",
197+
spec: missingNodeAffinity,
198+
wantErr: "profileNodeAffinity must be defined",
226199
},
227200
{
228-
name: "gpu feature override",
229-
spec: validGPUFeature,
230-
datadogAgentInternalEnabled: true,
201+
name: "missing profile affinity",
202+
spec: missingProfileAffinity,
203+
wantErr: "profileAffinity must be defined",
231204
},
232205
{
233-
name: "valid dap with features only when ddai enabled",
234-
spec: validFeaturesNoOverride,
235-
datadogAgentInternalEnabled: true,
206+
name: "gpu feature override",
207+
spec: validGPUFeature,
236208
},
237209
{
238-
name: "dap with unsupported feature when ddai enabled",
239-
spec: invalidFeatures,
240-
datadogAgentInternalEnabled: true,
241-
wantErr: "npm override is not supported",
210+
name: "valid dap with features only, no override",
211+
spec: validFeaturesNoOverride,
242212
},
243213
{
244-
name: "features not supported when ddai disabled",
245-
spec: invalidFeaturesNoDDAI,
246-
datadogAgentInternalEnabled: false,
247-
wantErr: "the 'features' field is only supported when DatadogAgentInternal is enabled",
214+
name: "dap with unsupported feature",
215+
spec: invalidFeatures,
216+
wantErr: "npm override is not supported",
248217
},
249218
}
250219
for _, test := range testCases {
251220
t.Run(test.name, func(t *testing.T) {
252-
result := ValidateDatadogAgentProfileSpec(test.spec, test.datadogAgentInternalEnabled)
221+
result := ValidateDatadogAgentProfileSpec(test.spec)
253222
if test.wantErr != "" {
254223
assert.EqualError(t, result, test.wantErr)
255224
} else {

0 commit comments

Comments
 (0)