Skip to content

Commit

Permalink
Merge branch 'main' into levan-m/conductor_testing_branch
Browse files Browse the repository at this point in the history
  • Loading branch information
levan-m authored Nov 12, 2024
2 parents d941864 + 14ad766 commit ea3ec22
Show file tree
Hide file tree
Showing 25 changed files with 592 additions and 42 deletions.
3 changes: 1 addition & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -529,12 +529,11 @@ publish_nightly_workflow:
CONDUCTOR_TARGET: $CONDUCTOR_TARGET
DDR_WORKFLOW_ID: $DDR_WORKFLOW_ID

# On success, this will cause CNAB to trigger a Deployment to Release Candidate clusters
# On success, this will cause CNAB to trigger a Deployment to Release Candidate clusters and open a corresponding pull request
publish_release_candidate_workflow:
stage: deploy
rules:
- if: $CI_COMMIT_TAG
when: manual # TODO: change this to on_success when feeling confident
- when: never
needs:
- trigger_internal_operator_image
Expand Down
1 change: 1 addition & 0 deletions api/datadoghq/common/envvar.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ const (
DDSecretBackendCommand = "DD_SECRET_BACKEND_COMMAND"
DDSecretBackendArguments = "DD_SECRET_BACKEND_ARGUMENTS"
DDSecretBackendTimeout = "DD_SECRET_BACKEND_TIMEOUT"
DDServiceDiscoveryEnabled = "DD_DISCOVERY_ENABLED"
DDSite = "DD_SITE"
DDSystemProbeAgentEnabled = "DD_SYSTEM_PROBE_ENABLED"
DDSystemProbeBPFDebugEnabled = DDSystemProbeEnvPrefix + "BPF_DEBUG"
Expand Down
2 changes: 2 additions & 0 deletions api/datadoghq/common/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ const (
SystemProbeContainerName AgentContainerName = "system-probe"
// OtelAgent is the name of the OTel container
OtelAgent AgentContainerName = "otel-agent"
// AgentDataPlaneContainerName is the name of the Agent Data Plane container
AgentDataPlaneContainerName AgentContainerName = "agent-data-plane"
// AllContainers is used internally to reference all containers in the pod
AllContainers AgentContainerName = "all"
// ClusterAgentContainerName is the name of the Cluster Agent container
Expand Down
15 changes: 15 additions & 0 deletions api/datadoghq/v2alpha1/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,21 @@ const (
DefaultStartupProbeFailureThreshold int32 = 6
DefaultStartupProbeHTTPPath = "/startup"

// Agent Data plane default liveness/readiness probe configs
DefaultADPLivenessProbeInitialDelaySeconds int32 = 5
DefaultADPLivenessProbePeriodSeconds int32 = 5
DefaultADPLivenessProbeTimeoutSeconds int32 = 5
DefaultADPLivenessProbeSuccessThreshold int32 = 1
DefaultADPLivenessProbeFailureThreshold int32 = 12

DefaultADPReadinessProbeInitialDelaySeconds int32 = 5
DefaultADPReadinessProbePeriodSeconds int32 = 5
DefaultADPReadinessProbeTimeoutSeconds int32 = 5
DefaultADPReadinessProbeSuccessThreshold int32 = 1
DefaultADPReadinessProbeFailureThreshold int32 = 12

DefaultADPHealthPort = 5100

// DefaultApmPort default apm port
DefaultApmPort = 8126
// DefaultApmPortName default apm port name
Expand Down
7 changes: 7 additions & 0 deletions api/datadoghq/v2alpha1/datadogagent_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ const (

defaultEBPFCheckEnabled bool = false

defaultServiceDiscoveryEnabled bool = false

defaultAPMEnabled bool = true
defaultAPMHostPortEnabled bool = false
defaultAPMHostPort int32 = 8126
Expand Down Expand Up @@ -243,6 +245,11 @@ func defaultFeaturesConfig(ddaSpec *DatadogAgentSpec) {
}
apiutils.DefaultBooleanIfUnset(&ddaSpec.Features.EBPFCheck.Enabled, defaultEBPFCheckEnabled)

if ddaSpec.Features.ServiceDiscovery == nil {
ddaSpec.Features.ServiceDiscovery = &ServiceDiscoveryFeatureConfig{}
}
apiutils.DefaultBooleanIfUnset(&ddaSpec.Features.ServiceDiscovery.Enabled, defaultServiceDiscoveryEnabled)

// APM Feature
// APM is enabled by default
if ddaSpec.Features.APM == nil {
Expand Down
43 changes: 43 additions & 0 deletions api/datadoghq/v2alpha1/datadogagent_default_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ func Test_defaultFeatures(t *testing.T) {
EBPFCheck: &EBPFCheckFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultEBPFCheckEnabled),
},
ServiceDiscovery: &ServiceDiscoveryFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultServiceDiscoveryEnabled),
},
APM: &APMFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultAPMEnabled),
HostPortConfig: &HostPortConfig{
Expand Down Expand Up @@ -315,6 +318,9 @@ func Test_defaultFeatures(t *testing.T) {
EBPFCheck: &EBPFCheckFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultEBPFCheckEnabled),
},
ServiceDiscovery: &ServiceDiscoveryFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultServiceDiscoveryEnabled),
},
APM: &APMFeatureConfig{
Enabled: apiutils.NewBoolPointer(valueFalse),
},
Expand Down Expand Up @@ -397,6 +403,9 @@ func Test_defaultFeatures(t *testing.T) {
EBPFCheck: &EBPFCheckFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultEBPFCheckEnabled),
},
ServiceDiscovery: &ServiceDiscoveryFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultServiceDiscoveryEnabled),
},
APM: &APMFeatureConfig{
Enabled: apiutils.NewBoolPointer(valueFalse),
},
Expand Down Expand Up @@ -508,6 +517,9 @@ func Test_defaultFeatures(t *testing.T) {
EBPFCheck: &EBPFCheckFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultEBPFCheckEnabled),
},
ServiceDiscovery: &ServiceDiscoveryFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultServiceDiscoveryEnabled),
},
APM: &APMFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultAPMEnabled),
HostPortConfig: &HostPortConfig{
Expand Down Expand Up @@ -640,6 +652,9 @@ func Test_defaultFeatures(t *testing.T) {
EBPFCheck: &EBPFCheckFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultEBPFCheckEnabled),
},
ServiceDiscovery: &ServiceDiscoveryFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultServiceDiscoveryEnabled),
},
APM: &APMFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultAPMEnabled),
HostPortConfig: &HostPortConfig{
Expand Down Expand Up @@ -767,6 +782,9 @@ func Test_defaultFeatures(t *testing.T) {
EBPFCheck: &EBPFCheckFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultEBPFCheckEnabled),
},
ServiceDiscovery: &ServiceDiscoveryFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultServiceDiscoveryEnabled),
},
APM: &APMFeatureConfig{
Enabled: apiutils.NewBoolPointer(valueTrue),
HostPortConfig: &HostPortConfig{
Expand Down Expand Up @@ -894,6 +912,9 @@ func Test_defaultFeatures(t *testing.T) {
EBPFCheck: &EBPFCheckFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultEBPFCheckEnabled),
},
ServiceDiscovery: &ServiceDiscoveryFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultServiceDiscoveryEnabled),
},
APM: &APMFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultAPMEnabled),
HostPortConfig: &HostPortConfig{
Expand Down Expand Up @@ -1030,6 +1051,9 @@ func Test_defaultFeatures(t *testing.T) {
EBPFCheck: &EBPFCheckFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultEBPFCheckEnabled),
},
ServiceDiscovery: &ServiceDiscoveryFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultServiceDiscoveryEnabled),
},
APM: &APMFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultAPMEnabled),
HostPortConfig: &HostPortConfig{
Expand Down Expand Up @@ -1157,6 +1181,9 @@ func Test_defaultFeatures(t *testing.T) {
EBPFCheck: &EBPFCheckFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultEBPFCheckEnabled),
},
ServiceDiscovery: &ServiceDiscoveryFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultServiceDiscoveryEnabled),
},
APM: &APMFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultAPMEnabled),
HostPortConfig: &HostPortConfig{
Expand Down Expand Up @@ -1287,6 +1314,9 @@ func Test_defaultFeatures(t *testing.T) {
EBPFCheck: &EBPFCheckFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultEBPFCheckEnabled),
},
ServiceDiscovery: &ServiceDiscoveryFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultServiceDiscoveryEnabled),
},
APM: &APMFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultAPMEnabled),
HostPortConfig: &HostPortConfig{
Expand Down Expand Up @@ -1444,6 +1474,9 @@ func Test_defaultFeatures(t *testing.T) {
EBPFCheck: &EBPFCheckFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultEBPFCheckEnabled),
},
ServiceDiscovery: &ServiceDiscoveryFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultServiceDiscoveryEnabled),
},
CSPM: &CSPMFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultCSPMEnabled),
},
Expand Down Expand Up @@ -1547,6 +1580,9 @@ func Test_defaultFeatures(t *testing.T) {
EBPFCheck: &EBPFCheckFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultEBPFCheckEnabled),
},
ServiceDiscovery: &ServiceDiscoveryFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultServiceDiscoveryEnabled),
},
APM: &APMFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultAPMEnabled),
HostPortConfig: &HostPortConfig{
Expand Down Expand Up @@ -1655,6 +1691,7 @@ func Test_defaultFeatures(t *testing.T) {
OOMKill: &OOMKillFeatureConfig{},
TCPQueueLength: &TCPQueueLengthFeatureConfig{},
EBPFCheck: &EBPFCheckFeatureConfig{},
ServiceDiscovery: &ServiceDiscoveryFeatureConfig{},
APM: &APMFeatureConfig{},
ASM: &ASMFeatureConfig{},
CSPM: &CSPMFeatureConfig{},
Expand Down Expand Up @@ -1696,6 +1733,9 @@ func Test_defaultFeatures(t *testing.T) {
EBPFCheck: &EBPFCheckFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultEBPFCheckEnabled),
},
ServiceDiscovery: &ServiceDiscoveryFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultServiceDiscoveryEnabled),
},
APM: &APMFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultAPMEnabled),
HostPortConfig: &HostPortConfig{
Expand Down Expand Up @@ -1826,6 +1866,9 @@ func Test_defaultFeatures(t *testing.T) {
EBPFCheck: &EBPFCheckFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultEBPFCheckEnabled),
},
ServiceDiscovery: &ServiceDiscoveryFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultServiceDiscoveryEnabled),
},
APM: &APMFeatureConfig{
Enabled: apiutils.NewBoolPointer(defaultAPMEnabled),
HostPortConfig: &HostPortConfig{
Expand Down
10 changes: 10 additions & 0 deletions api/datadoghq/v2alpha1/datadogagent_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ type DatadogFeatures struct {
RemoteConfiguration *RemoteConfigurationFeatureConfig `json:"remoteConfiguration,omitempty"`
// SBOM collection configuration.
SBOM *SBOMFeatureConfig `json:"sbom,omitempty"`
// ServiceDiscovery
ServiceDiscovery *ServiceDiscoveryFeatureConfig `json:"serviceDiscovery,omitempty"`

// Cluster-level features

Expand Down Expand Up @@ -486,6 +488,14 @@ type USMFeatureConfig struct {
Enabled *bool `json:"enabled,omitempty"`
}

// ServiceDiscoveryFeatureConfig configures the service discovery check feature.
type ServiceDiscoveryFeatureConfig struct {
// Enables the service discovery check.
// Default: false
// +optional
Enabled *bool `json:"enabled,omitempty"`
}

// DogstatsdFeatureConfig contains the Dogstatsd configuration parameters.
// +k8s:openapi-gen=true
type DogstatsdFeatureConfig struct {
Expand Down
36 changes: 36 additions & 0 deletions api/datadoghq/v2alpha1/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,42 @@ func GetDefaultTraceAgentProbe() *corev1.Probe {
return probe
}

// GetDefaultAgentDataPlaneLivenessProbe creates a defaulted liveness probe for Agent Data Plane
func GetDefaultAgentDataPlaneLivenessProbe() *corev1.Probe {
livenessProbe := &corev1.Probe{
InitialDelaySeconds: DefaultADPLivenessProbeInitialDelaySeconds,
PeriodSeconds: DefaultADPLivenessProbePeriodSeconds,
TimeoutSeconds: DefaultADPLivenessProbeTimeoutSeconds,
SuccessThreshold: DefaultADPLivenessProbeSuccessThreshold,
FailureThreshold: DefaultADPLivenessProbeFailureThreshold,
}
livenessProbe.HTTPGet = &corev1.HTTPGetAction{
Path: DefaultLivenessProbeHTTPPath,
Port: intstr.IntOrString{
IntVal: DefaultADPHealthPort,
},
}
return livenessProbe
}

// GetDefaultAgentDataPlaneReadinessProbe creates a defaulted readiness probe for Agent Data Plane
func GetDefaultAgentDataPlaneReadinessProbe() *corev1.Probe {
readinessProbe := &corev1.Probe{
InitialDelaySeconds: DefaultADPReadinessProbeInitialDelaySeconds,
PeriodSeconds: DefaultADPReadinessProbePeriodSeconds,
TimeoutSeconds: DefaultADPReadinessProbeTimeoutSeconds,
SuccessThreshold: DefaultADPReadinessProbeSuccessThreshold,
FailureThreshold: DefaultADPReadinessProbeFailureThreshold,
}
readinessProbe.HTTPGet = &corev1.HTTPGetAction{
Path: DefaultReadinessProbeHTTPPath,
Port: intstr.IntOrString{
IntVal: DefaultADPHealthPort,
},
}
return readinessProbe
}

// GetImage builds the image string based on ImageConfig and the registry configuration.
func GetImage(imageSpec *AgentImageConfig, registry *string) string {
if defaulting.IsImageNameContainsTag(imageSpec.Name) {
Expand Down
25 changes: 25 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.

8 changes: 7 additions & 1 deletion api/datadoghq/v2alpha1/zz_generated.openapi.go

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

Loading

0 comments on commit ea3ec22

Please sign in to comment.