Skip to content

Commit

Permalink
service discovery: Add operator support
Browse files Browse the repository at this point in the history
  • Loading branch information
guyarb committed Oct 6, 2024
1 parent 7fe7979 commit d583968
Show file tree
Hide file tree
Showing 17 changed files with 352 additions and 124 deletions.
121 changes: 0 additions & 121 deletions LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
@@ -1,121 +0,0 @@
Component,Origin,License
core,github.com/DataDog/datadog-agent/pkg/config/model,Apache-2.0
core,github.com/DataDog/datadog-agent/pkg/config/remote,Apache-2.0
core,github.com/DataDog/datadog-agent/pkg/proto,Apache-2.0
core,github.com/DataDog/datadog-agent/pkg/remoteconfig/state,Apache-2.0
core,github.com/DataDog/datadog-agent/pkg/util/backoff,Apache-2.0
core,github.com/DataDog/datadog-agent/pkg/util/cache,Apache-2.0
core,github.com/DataDog/datadog-agent/pkg/util/grpc,Apache-2.0
core,github.com/DataDog/datadog-agent/pkg/util/http,Apache-2.0
core,github.com/DataDog/datadog-agent/pkg/util/log,Apache-2.0
core,github.com/DataDog/datadog-agent/pkg/util/scrubber,Apache-2.0
core,github.com/DataDog/datadog-agent/pkg/util/uuid,Apache-2.0
core,github.com/DataDog/datadog-api-client-go/v2,Apache-2.0
core,github.com/DataDog/datadog-go/v5/statsd,MIT
core,github.com/DataDog/datadog-operator,Apache-2.0
core,github.com/DataDog/extendeddaemonset/api/v1alpha1,Apache-2.0
core,github.com/DataDog/go-tuf,BSD-3-Clause
core,github.com/DataDog/gostackparse,Apache-2.0
core,github.com/DataDog/viper,MIT
core,github.com/DataDog/zstd,BSD-3-Clause
core,github.com/Masterminds/semver,MIT
core,github.com/Masterminds/semver/v3,MIT
core,github.com/benbjohnson/clock,MIT
core,github.com/beorn7/perks/quantile,MIT
core,github.com/cenkalti/backoff,MIT
core,github.com/cespare/xxhash/v2,MIT
core,github.com/cihub/seelog,BSD-3-Clause
core,github.com/davecgh/go-spew/spew,ISC
core,github.com/emicklei/go-restful/v3,MIT
core,github.com/evanphx/json-patch/v5,BSD-3-Clause
core,github.com/fsnotify/fsnotify,BSD-3-Clause
core,github.com/go-logr/logr,Apache-2.0
core,github.com/go-logr/zapr,Apache-2.0
core,github.com/go-openapi/jsonpointer,Apache-2.0
core,github.com/go-openapi/jsonreference,Apache-2.0
core,github.com/go-openapi/swag,Apache-2.0
core,github.com/gobwas/glob,MIT
core,github.com/gogo/protobuf,BSD-3-Clause
core,github.com/golang/groupcache/lru,Apache-2.0
core,github.com/golang/protobuf,BSD-3-Clause
core,github.com/google/gnostic-models,Apache-2.0
core,github.com/google/go-cmp/cmp,BSD-3-Clause
core,github.com/google/gofuzz,Apache-2.0
core,github.com/google/pprof/profile,Apache-2.0
core,github.com/google/uuid,BSD-3-Clause
core,github.com/grpc-ecosystem/go-grpc-middleware,Apache-2.0
core,github.com/grpc-ecosystem/grpc-gateway,BSD-3-Clause
core,github.com/hashicorp/hcl,MPL-2.0
core,github.com/imdario/mergo,BSD-3-Clause
core,github.com/josharian/intern,MIT
core,github.com/json-iterator/go,MIT
core,github.com/magiconair/properties,BSD-2-Clause
core,github.com/mailru/easyjson,MIT
core,github.com/matttproud/golang_protobuf_extensions/pbutil,Apache-2.0
core,github.com/mitchellh/mapstructure,MIT
core,github.com/modern-go/concurrent,Apache-2.0
core,github.com/modern-go/reflect2,Apache-2.0
core,github.com/mohae/deepcopy,MIT
core,github.com/munnerz/goautoneg,BSD-3-Clause
core,github.com/patrickmn/go-cache,MIT
core,github.com/pelletier/go-toml,Apache-2.0
core,github.com/philhofer/fwd,MIT
core,github.com/pkg/errors,BSD-2-Clause
core,github.com/pmezard/go-difflib/difflib,BSD-3-Clause
core,github.com/prometheus/client_golang/prometheus,Apache-2.0
core,github.com/prometheus/client_model/go,Apache-2.0
core,github.com/prometheus/common,Apache-2.0
core,github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg,BSD-3-Clause
core,github.com/prometheus/procfs,Apache-2.0
core,github.com/richardartoul/molecule,MIT
core,github.com/richardartoul/molecule/src/codec,Apache-2.0
core,github.com/richardartoul/molecule/src/protowire,BSD-3-Clause
core,github.com/secure-systems-lab/go-securesystemslib/cjson,MIT
core,github.com/shirou/gopsutil/v3,BSD-3-Clause
core,github.com/spaolacci/murmur3,BSD-3-Clause
core,github.com/spf13/afero,Apache-2.0
core,github.com/spf13/cast,MIT
core,github.com/spf13/jwalterweatherman,MIT
core,github.com/spf13/pflag,BSD-3-Clause
core,github.com/stretchr/objx,MIT
core,github.com/stretchr/testify,MIT
core,github.com/tinylib/msgp/msgp,MIT
core,github.com/zorkian/go-datadog-api,BSD-3-Clause
core,go.etcd.io/bbolt,MIT
core,go.uber.org/atomic,MIT
core,go.uber.org/multierr,MIT
core,go.uber.org/zap,MIT
core,golang.org/x/exp,BSD-3-Clause
core,golang.org/x/net,BSD-3-Clause
core,golang.org/x/oauth2,BSD-3-Clause
core,golang.org/x/sys/unix,BSD-3-Clause
core,golang.org/x/term,BSD-3-Clause
core,golang.org/x/text,BSD-3-Clause
core,golang.org/x/time/rate,BSD-3-Clause
core,gomodules.xyz/jsonpatch/v2,Apache-2.0
core,google.golang.org/genproto/googleapis/api,Apache-2.0
core,google.golang.org/genproto/googleapis/rpc/status,Apache-2.0
core,google.golang.org/genproto/protobuf/field_mask,Apache-2.0
core,google.golang.org/grpc,Apache-2.0
core,google.golang.org/protobuf,BSD-3-Clause
core,gopkg.in/DataDog/dd-trace-go.v1,Apache-2.0
core,gopkg.in/inf.v0,BSD-3-Clause
core,gopkg.in/yaml.v2,Apache-2.0
core,gopkg.in/yaml.v3,MIT
core,k8s.io/api,Apache-2.0
core,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions,Apache-2.0
core,k8s.io/apimachinery/pkg,Apache-2.0
core,k8s.io/apimachinery/third_party/forked/golang,BSD-3-Clause
core,k8s.io/client-go,Apache-2.0
core,k8s.io/component-base/config,Apache-2.0
core,k8s.io/klog/v2,Apache-2.0
core,k8s.io/kube-aggregator/pkg/apis/apiregistration,Apache-2.0
core,k8s.io/kube-openapi/pkg,Apache-2.0
core,k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json,BSD-3-Clause
core,k8s.io/kube-openapi/pkg/validation/spec,Apache-2.0
core,k8s.io/utils,Apache-2.0
core,k8s.io/utils/internal/third_party/forked/golang/net,BSD-3-Clause
core,sigs.k8s.io/controller-runtime,Apache-2.0
core,sigs.k8s.io/json,Apache-2.0
core,sigs.k8s.io/structured-merge-diff/v4,Apache-2.0
core,sigs.k8s.io/yaml,MIT
1 change: 1 addition & 0 deletions api/datadoghq/common/envvar.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,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
7 changes: 7 additions & 0 deletions api/datadoghq/v2alpha1/datadogagent_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ const (

defaultEBPFCheckEnabled bool = false

defaultServiceDiscoveryEnabled bool = false

defaultAPMEnabled bool = true
defaultAPMHostPortEnabled bool = false
defaultAPMHostPort int32 = 8126
Expand Down Expand Up @@ -244,6 +246,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 @@ -194,6 +194,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 @@ -314,6 +317,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 @@ -396,6 +402,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 @@ -507,6 +516,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 @@ -639,6 +651,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 @@ -766,6 +781,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 @@ -893,6 +911,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 @@ -1029,6 +1050,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 @@ -1156,6 +1180,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 @@ -1286,6 +1313,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 @@ -1443,6 +1473,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 @@ -1546,6 +1579,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 @@ -1654,6 +1690,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 @@ -1695,6 +1732,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 @@ -1825,6 +1865,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 discover check.
// Default: false
// +optional
Enabled *bool `json:"enabled,omitempty"`
}

// DogstatsdFeatureConfig contains the Dogstatsd configuration parameters.
// +k8s:openapi-gen=true
type DogstatsdFeatureConfig struct {
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 d583968

Please sign in to comment.