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
7 changes: 7 additions & 0 deletions api/datadoghq/v2alpha1/datadogagent_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,13 @@ type ServiceDiscoveryFeatureConfig struct {
// +optional
Enabled *bool `json:"enabled,omitempty"`

// Indicates that the operator enabled this feature automatically rather than in response to an
// explicit user setting. When true, if `system-probe-lite` is unavailable, the container falls
// back to `sleep infinity` rather than `system-probe`, to avoid unexpected resource usage on
// older agent images. This field is managed by the operator and must not be set by users.
// +optional
EnabledByDefault *bool `json:"enabledByDefault,omitempty"`

// DEPRECATED: NetworkStats is no longer configurable and will be ignored. Scheduled for removal in v1.28.
// +deprecated
// +optional
Expand Down
5 changes: 5 additions & 0 deletions api/datadoghq/v2alpha1/zz_generated.deepcopy.go

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

14 changes: 14 additions & 0 deletions config/crd/bases/v1/datadoghq.com_datadogagentinternals.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2488,6 +2488,13 @@ spec:
Enables the service discovery check.
Default: false
type: boolean
enabledByDefault:
description: |-
Indicates that the operator enabled this feature automatically rather than in response to an
explicit user setting. When true, if `system-probe-lite` is unavailable, the container falls
back to `sleep infinity` rather than `system-probe`, to avoid unexpected resource usage on
older agent images. This field is managed by the operator and must not be set by users.
type: boolean
networkStats:
description: 'DEPRECATED: NetworkStats is no longer configurable and will be ignored. Scheduled for removal in v1.28.'
properties:
Expand Down Expand Up @@ -10905,6 +10912,13 @@ spec:
Enables the service discovery check.
Default: false
type: boolean
enabledByDefault:
description: |-
Indicates that the operator enabled this feature automatically rather than in response to an
explicit user setting. When true, if `system-probe-lite` is unavailable, the container falls
back to `sleep infinity` rather than `system-probe`, to avoid unexpected resource usage on
older agent images. This field is managed by the operator and must not be set by users.
type: boolean
networkStats:
description: 'DEPRECATED: NetworkStats is no longer configurable and will be ignored. Scheduled for removal in v1.28.'
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2588,6 +2588,10 @@
"description": "Enables the service discovery check.\nDefault: false",
"type": "boolean"
},
"enabledByDefault": {
"description": "Indicates that the operator enabled this feature automatically rather than in response to an\nexplicit user setting. When true, if `system-probe-lite` is unavailable, the container falls\nback to `sleep infinity` rather than `system-probe`, to avoid unexpected resource usage on\nolder agent images. This field is managed by the operator and must not be set by users.",
"type": "boolean"
},
"networkStats": {
"additionalProperties": false,
"description": "DEPRECATED: NetworkStats is no longer configurable and will be ignored. Scheduled for removal in v1.28.",
Expand Down Expand Up @@ -10742,6 +10746,10 @@
"description": "Enables the service discovery check.\nDefault: false",
"type": "boolean"
},
"enabledByDefault": {
"description": "Indicates that the operator enabled this feature automatically rather than in response to an\nexplicit user setting. When true, if `system-probe-lite` is unavailable, the container falls\nback to `sleep infinity` rather than `system-probe`, to avoid unexpected resource usage on\nolder agent images. This field is managed by the operator and must not be set by users.",
"type": "boolean"
},
"networkStats": {
"additionalProperties": false,
"description": "DEPRECATED: NetworkStats is no longer configurable and will be ignored. Scheduled for removal in v1.28.",
Expand Down
7 changes: 7 additions & 0 deletions config/crd/bases/v1/datadoghq.com_datadogagentprofiles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2488,6 +2488,13 @@ spec:
Enables the service discovery check.
Default: false
type: boolean
enabledByDefault:
description: |-
Indicates that the operator enabled this feature automatically rather than in response to an
explicit user setting. When true, if `system-probe-lite` is unavailable, the container falls
back to `sleep infinity` rather than `system-probe`, to avoid unexpected resource usage on
older agent images. This field is managed by the operator and must not be set by users.
type: boolean
networkStats:
description: 'DEPRECATED: NetworkStats is no longer configurable and will be ignored. Scheduled for removal in v1.28.'
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2592,6 +2592,10 @@
"description": "Enables the service discovery check.\nDefault: false",
"type": "boolean"
},
"enabledByDefault": {
"description": "Indicates that the operator enabled this feature automatically rather than in response to an\nexplicit user setting. When true, if `system-probe-lite` is unavailable, the container falls\nback to `sleep infinity` rather than `system-probe`, to avoid unexpected resource usage on\nolder agent images. This field is managed by the operator and must not be set by users.",
"type": "boolean"
},
"networkStats": {
"additionalProperties": false,
"description": "DEPRECATED: NetworkStats is no longer configurable and will be ignored. Scheduled for removal in v1.28.",
Expand Down
14 changes: 14 additions & 0 deletions config/crd/bases/v1/datadoghq.com_datadogagents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2488,6 +2488,13 @@ spec:
Enables the service discovery check.
Default: false
type: boolean
enabledByDefault:
description: |-
Indicates that the operator enabled this feature automatically rather than in response to an
explicit user setting. When true, if `system-probe-lite` is unavailable, the container falls
back to `sleep infinity` rather than `system-probe`, to avoid unexpected resource usage on
older agent images. This field is managed by the operator and must not be set by users.
type: boolean
networkStats:
description: 'DEPRECATED: NetworkStats is no longer configurable and will be ignored. Scheduled for removal in v1.28.'
properties:
Expand Down Expand Up @@ -10955,6 +10962,13 @@ spec:
Enables the service discovery check.
Default: false
type: boolean
enabledByDefault:
description: |-
Indicates that the operator enabled this feature automatically rather than in response to an
explicit user setting. When true, if `system-probe-lite` is unavailable, the container falls
back to `sleep infinity` rather than `system-probe`, to avoid unexpected resource usage on
older agent images. This field is managed by the operator and must not be set by users.
type: boolean
networkStats:
description: 'DEPRECATED: NetworkStats is no longer configurable and will be ignored. Scheduled for removal in v1.28.'
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2588,6 +2588,10 @@
"description": "Enables the service discovery check.\nDefault: false",
"type": "boolean"
},
"enabledByDefault": {
"description": "Indicates that the operator enabled this feature automatically rather than in response to an\nexplicit user setting. When true, if `system-probe-lite` is unavailable, the container falls\nback to `sleep infinity` rather than `system-probe`, to avoid unexpected resource usage on\nolder agent images. This field is managed by the operator and must not be set by users.",
"type": "boolean"
},
"networkStats": {
"additionalProperties": false,
"description": "DEPRECATED: NetworkStats is no longer configurable and will be ignored. Scheduled for removal in v1.28.",
Expand Down Expand Up @@ -10807,6 +10811,10 @@
"description": "Enables the service discovery check.\nDefault: false",
"type": "boolean"
},
"enabledByDefault": {
"description": "Indicates that the operator enabled this feature automatically rather than in response to an\nexplicit user setting. When true, if `system-probe-lite` is unavailable, the container falls\nback to `sleep infinity` rather than `system-probe`, to avoid unexpected resource usage on\nolder agent images. This field is managed by the operator and must not be set by users.",
"type": "boolean"
},
"networkStats": {
"additionalProperties": false,
"description": "DEPRECATED: NetworkStats is no longer configurable and will be ignored. Scheduled for removal in v1.28.",
Expand Down
1 change: 1 addition & 0 deletions docs/configuration.v2alpha1.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ spec:
| features.sbom.host.analyzers | To use for SBOM collection. |
| features.sbom.host.enabled | Enable this option to activate SBOM collection. Default: false |
| features.serviceDiscovery.enabled | Enables the service discovery check. Default: false |
| features.serviceDiscovery.enabledByDefault | Indicates that the operator enabled this feature automatically rather than in response to an explicit user setting. When true, if `system-probe-lite` is unavailable, the container falls back to `sleep infinity` rather than `system-probe`, to avoid unexpected resource usage on older agent images. This field is managed by the operator and must not be set by users. |
| features.serviceDiscovery.networkStats.enabled | DEPRECATED: this field is ignored. |
| features.tcpQueueLength.enabled | Enables the TCP queue length eBPF-based check. Default: false |
| features.usm.enabled | Enables Universal Service Monitoring. Default: false |
Expand Down
3 changes: 3 additions & 0 deletions docs/configuration_public.md
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,9 @@ spec:
`features.serviceDiscovery.enabled`
: Enables the service discovery check. Default: false

`features.serviceDiscovery.enabledByDefault`
: Indicates that the operator enabled this feature automatically rather than in response to an explicit user setting. When true, if `system-probe-lite` is unavailable, the container falls back to `sleep infinity` rather than `system-probe`, to avoid unexpected resource usage on older agent images. This field is managed by the operator and must not be set by users.

`features.serviceDiscovery.networkStats.enabled`
: DEPRECATED: this field is ignored.

Expand Down
8 changes: 4 additions & 4 deletions internal/controller/datadogagent/controller_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1752,7 +1752,7 @@ func Test_DDAI_ReconcileV3(t *testing.T) {
wantFunc: func(t *testing.T, c client.Client) {
expectedDDAI := getBaseDDAI(dda)
expectedDDAI.Annotations = map[string]string{
constants.MD5DDAIDeploymentAnnotationKey: "ccac39a3a007bad81d7baf8febc6445f",
constants.MD5DDAIDeploymentAnnotationKey: "62d2822cc8547055dc8e2fca6f222a17",
}

verifyDDAI(t, c, []v1alpha1.DatadogAgentInternal{expectedDDAI})
Expand Down Expand Up @@ -1784,7 +1784,7 @@ func Test_DDAI_ReconcileV3(t *testing.T) {
baseDDAI := getBaseDDAI(dda)
expectedDDAI := baseDDAI.DeepCopy()
expectedDDAI.Annotations = map[string]string{
constants.MD5DDAIDeploymentAnnotationKey: "f2aa21d0ecced63c091ca2df3d31e451",
constants.MD5DDAIDeploymentAnnotationKey: "c362b9a0aa0e2ad1a1d60f4ee8575c8f",
}
expectedDDAI.Spec.Features.ClusterChecks.UseClusterChecksRunners = apiutils.NewBoolPointer(true)
expectedDDAI.Spec.Global.Credentials = &v2alpha1.DatadogCredentials{
Expand Down Expand Up @@ -1860,7 +1860,7 @@ func Test_DDAI_ReconcileV3(t *testing.T) {
profileDDAI := getBaseDDAI(dda)
profileDDAI.Name = "foo-profile"
profileDDAI.Annotations = map[string]string{
constants.MD5DDAIDeploymentAnnotationKey: "73e0cc1e445001e326507ac23654104e",
constants.MD5DDAIDeploymentAnnotationKey: "2c3c1664f08fb6d6591294f2c878d1dd",
}
profileDDAI.Labels[constants.ProfileLabelKey] = "foo-profile"
profileDDAI.Spec.Override = map[v2alpha1.ComponentName]*v2alpha1.DatadogAgentComponentOverride{
Expand Down Expand Up @@ -2094,7 +2094,7 @@ func getBaseDDAI(dda *v2alpha1.DatadogAgent) v1alpha1.DatadogAgentInternal {
func getDefaultDDAI(dda *v2alpha1.DatadogAgent) v1alpha1.DatadogAgentInternal {
expectedDDAI := getBaseDDAI(dda)
expectedDDAI.Annotations = map[string]string{
constants.MD5DDAIDeploymentAnnotationKey: "f98c0497c66e2747f6d116970ab8f0b1",
constants.MD5DDAIDeploymentAnnotationKey: "7e6c12e645247762609327ab80b63d9e",
}
expectedDDAI.Spec.Override = map[v2alpha1.ComponentName]*v2alpha1.DatadogAgentComponentOverride{
v2alpha1.NodeAgentComponentName: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ const (

defaultGPUMonitoringEnabled bool = false

defaultServiceDiscoveryEnabled bool = false
defaultServiceDiscoveryEnabled bool = false
defaultServiceDiscoveryEnabledByDefault bool = false

defaultAPMEnabled bool = true
defaultAPMHostPortEnabled bool = false
Expand Down Expand Up @@ -302,7 +303,12 @@ func defaultFeaturesConfig(ddaSpec *v2alpha1.DatadogAgentSpec) {
if ddaSpec.Features.ServiceDiscovery == nil {
ddaSpec.Features.ServiceDiscovery = &v2alpha1.ServiceDiscoveryFeatureConfig{}
}
apiutils.DefaultBooleanIfUnset(&ddaSpec.Features.ServiceDiscovery.Enabled, defaultServiceDiscoveryEnabled)
apiutils.DefaultBooleanIfUnset(&ddaSpec.Features.ServiceDiscovery.EnabledByDefault, defaultServiceDiscoveryEnabledByDefault)
// Only default Enabled to false when not enabled-by-default, so that Enabled=nil remains
// distinguishable from Enabled=false (explicit user opt-out) when EnabledByDefault=true.
if !apiutils.BoolValue(ddaSpec.Features.ServiceDiscovery.EnabledByDefault) {
apiutils.DefaultBooleanIfUnset(&ddaSpec.Features.ServiceDiscovery.Enabled, defaultServiceDiscoveryEnabled)
}

// GPU monitoring feature
if ddaSpec.Features.GPU == nil {
Expand Down
Loading
Loading