Skip to content

Commit

Permalink
Merge branch 'main' into fanny/refactor-kind-e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
fanny-jiang authored Dec 27, 2024
2 parents 793e23b + 0ca2c91 commit d3fcaff
Show file tree
Hide file tree
Showing 116 changed files with 3,771 additions and 1,419 deletions.
28 changes: 26 additions & 2 deletions LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,25 @@ 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/antlr4-go/antlr/v4,BSD-3-Clause
core,github.com/asaskevich/govalidator,MIT
core,github.com/benbjohnson/clock,MIT
core,github.com/beorn7/perks/quantile,MIT
core,github.com/blang/semver/v4,MIT
core,github.com/cenkalti/backoff,MIT
core,github.com/cenkalti/backoff/v4,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/dustin/go-humanize,MIT
core,github.com/ebitengine/purego,Apache-2.0
core,github.com/emicklei/go-restful/v3,MIT
core,github.com/evanphx/json-patch/v5,BSD-3-Clause
core,github.com/felixge/httpsnoop,MIT
core,github.com/fsnotify/fsnotify,BSD-3-Clause
core,github.com/fxamacker/cbor/v2,MIT
core,github.com/go-logr/logr,Apache-2.0
core,github.com/go-logr/stdr,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
Expand All @@ -46,13 +52,15 @@ 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/cel-go,Apache-2.0
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/grpc-ecosystem/grpc-gateway/v2,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
Expand Down Expand Up @@ -87,29 +95,40 @@ 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/cobra,Apache-2.0
core,github.com/spf13/jwalterweatherman,MIT
core,github.com/spf13/pflag,BSD-3-Clause
core,github.com/stoewer/go-strcase,MIT
core,github.com/stretchr/objx,MIT
core,github.com/stretchr/testify,MIT
core,github.com/tinylib/msgp/msgp,MIT
core,github.com/x448/float16,MIT
core,github.com/zorkian/go-datadog-api,BSD-3-Clause
core,go.etcd.io/bbolt,MIT
core,go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp,Apache-2.0
core,go.opentelemetry.io/otel,Apache-2.0
core,go.opentelemetry.io/otel/exporters/otlp/otlptrace,Apache-2.0
core,go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc,Apache-2.0
core,go.opentelemetry.io/otel/metric,Apache-2.0
core,go.opentelemetry.io/otel/sdk,Apache-2.0
core,go.opentelemetry.io/otel/trace,Apache-2.0
core,go.opentelemetry.io/proto/otlp,Apache-2.0
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/mod/semver,BSD-3-Clause
core,golang.org/x/net,BSD-3-Clause
core,golang.org/x/oauth2,BSD-3-Clause
core,golang.org/x/sync/singleflight,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,golang.org/x/xerrors,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/googleapis/rpc,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
Expand All @@ -121,14 +140,19 @@ 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/apiserver,Apache-2.0
core,k8s.io/client-go,Apache-2.0
core,k8s.io/component-base,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/errors,Apache-2.0
core,k8s.io/kube-openapi/pkg/validation/spec,Apache-2.0
core,k8s.io/kube-openapi/pkg/validation/strfmt,Apache-2.0
core,k8s.io/utils,Apache-2.0
core,k8s.io/utils/internal/third_party/forked/golang/net,BSD-3-Clause
core,k8s.io/utils/internal/third_party/forked/golang,BSD-3-Clause
core,sigs.k8s.io/apiserver-network-proxy/konnectivity-client,Apache-2.0
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
Expand Down
7 changes: 7 additions & 0 deletions api/datadoghq/v1alpha1/datadogpodautoscaler_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@ type DatadogPodAutoscalerScalingPolicy struct {
// +listType=atomic
// +optional
Rules []DatadogPodAutoscalerScalingRule `json:"rules,omitempty"`

// StabilizationWindowSeconds is the number of seconds the controller should lookback at previous recommendations
// before deciding to apply a new one. Defaults to 0.
// +optional
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=1800
StabilizationWindowSeconds int32 `json:"stabilizationWindowSeconds,omitempty"`
}

// DatadogPodAutoscalerScalingRuleType defines how scaling rule value should be interpreted.
Expand Down
56 changes: 2 additions & 54 deletions api/datadoghq/v2alpha1/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package v2alpha1
// This file tracks constants related to the DatadogAgent CRD

const (

// ClusterAgentReconcileConditionType ReconcileConditionType for Cluster Agent component
ClusterAgentReconcileConditionType = "ClusterAgentReconcile"
// AgentReconcileConditionType ReconcileConditionType for Agent component
Expand All @@ -25,59 +24,6 @@ const (
// ExtraChecksdConfigMapName is the name of the ConfigMap storing Custom Checksd data
ExtraChecksdConfigMapName = "%s-extra-checksd"

// DefaultAgentHealthPort default agent health port
DefaultAgentHealthPort int32 = 5555

// Liveness probe default config
DefaultLivenessProbeInitialDelaySeconds int32 = 15
DefaultLivenessProbePeriodSeconds int32 = 15
DefaultLivenessProbeTimeoutSeconds int32 = 5
DefaultLivenessProbeSuccessThreshold int32 = 1
DefaultLivenessProbeFailureThreshold int32 = 6
DefaultLivenessProbeHTTPPath = "/live"

// Readiness probe default config
DefaultReadinessProbeInitialDelaySeconds int32 = 15
DefaultReadinessProbePeriodSeconds int32 = 15
DefaultReadinessProbeTimeoutSeconds int32 = 5
DefaultReadinessProbeSuccessThreshold int32 = 1
DefaultReadinessProbeFailureThreshold int32 = 6
DefaultReadinessProbeHTTPPath = "/ready"

// Startup probe default config
DefaultStartupProbeInitialDelaySeconds int32 = 15
DefaultStartupProbePeriodSeconds int32 = 15
DefaultStartupProbeTimeoutSeconds int32 = 5
DefaultStartupProbeSuccessThreshold int32 = 1
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
DefaultApmPortName = "traceport"

// DefaultAgentResourceSuffix use as suffix for agent resource naming
DefaultAgentResourceSuffix = "agent"
// DefaultClusterAgentResourceSuffix use as suffix for cluster-agent resource naming
DefaultClusterAgentResourceSuffix = "cluster-agent"
// DefaultClusterChecksRunnerResourceSuffix use as suffix for cluster-checks-runner resource naming
DefaultClusterChecksRunnerResourceSuffix = "cluster-checks-runner"
// DefaultMetricsServerResourceSuffix use as suffix for cluster-agent metrics-server resource naming
DefaultMetricsServerResourceSuffix = "cluster-agent-metrics-server"
// DefaultAPPKeyKey default app-key key (use in secret for instance).
Expand All @@ -102,6 +48,8 @@ const (
DefaultDogstatsdPort = 8125
// DefaultDogstatsdPortName default dogstatsd port name
DefaultDogstatsdPortName = "dogstatsdport"
// DefaultOTelAgentConf default otel agent ConfigMap name
DefaultOTelAgentConf string = "otel-agent-config"
// DefaultKubeStateMetricsCoreConf default ksm core ConfigMap name
DefaultKubeStateMetricsCoreConf string = "kube-state-metrics-core-config"
// DefaultOrchestratorExplorerConf default orchestrator explorer ConfigMap name
Expand Down
58 changes: 58 additions & 0 deletions api/datadoghq/v2alpha1/datadogagent_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ type DatadogAgentSpec struct {
type DatadogFeatures struct {
// Application-level features

// OtelCollector configuration.
OtelCollector *OtelCollectorFeatureConfig `json:"otelCollector,omitempty"`
// LogCollection configuration.
LogCollection *LogCollectionFeatureConfig `json:"logCollection,omitempty"`
// LiveProcessCollection configuration.
Expand Down Expand Up @@ -682,6 +684,51 @@ type KubeStateMetricsCoreFeatureConfig struct {
Conf *CustomConfig `json:"conf,omitempty"`
}

// OtelCollectorFeatureConfig contains the configuration for the otel-agent.
// +k8s:openapi-gen=true
type OtelCollectorFeatureConfig struct {
// Enabled enables the OTel Agent.
// Default: true
// +optional
Enabled *bool `json:"enabled,omitempty"`

// Conf overrides the configuration for the default Kubernetes State Metrics Core check.
// This must point to a ConfigMap containing a valid cluster check configuration.
// When passing a configmap, file name *must* be otel-config.yaml.
// +optional
Conf *CustomConfig `json:"conf,omitempty"`

// Ports contains the ports for the otel-agent.
// Defaults: otel-grpc:4317 / otel-http:4318. Note: setting 4317
// or 4318 manually is *only* supported if name match default names (otel-grpc, otel-http).
// If not, this will lead to a port conflict.
// This limitation will be lifted once annotations support is removed.
// +optional
Ports []*corev1.ContainerPort `json:"ports,omitempty"`

// OTelCollector Config Relevant to the Core agent
// +optional
CoreConfig *CoreConfig `json:"coreConfig,omitempty"`
}

// CoreConfig exposes the otel collector configs relevant to the core agent.
// +k8s:openapi-gen=true
type CoreConfig struct {
// Enabled marks otelcollector as enabled in core agent.
// +optional
Enabled *bool `json:"enabled,omitempty"`

// +optional
// Extension URL provides the URL of the ddflareextension to
// the core agent.
ExtensionURL *string `json:"extension_url,omitempty"`

// +optional
// Extension URL provides the timout of the ddflareextension to
// the core agent.
ExtensionTimeout *int `json:"extension_timeout,omitempty"`
}

// AdmissionControllerFeatureConfig contains the Admission Controller feature configuration.
// The Admission Controller runs in the Cluster Agent.
type AdmissionControllerFeatureConfig struct {
Expand Down Expand Up @@ -729,6 +776,10 @@ type AdmissionControllerFeatureConfig struct {
// +optional
Registry *string `json:"registry,omitempty"`

// KubernetesAdmissionEvents holds the Kubernetes Admission Events configuration.
// +optional
KubernetesAdmissionEvents *KubernetesAdmissionEventsConfig `json:"kubernetesAdmissionEvents,omitempty"`

// CWSInstrumentation holds the CWS Instrumentation endpoint configuration
// +optional
CWSInstrumentation *CWSInstrumentationConfig `json:"cwsInstrumentation,omitempty"`
Expand Down Expand Up @@ -809,6 +860,13 @@ type Profile struct {
ResourceRequirements *corev1.ResourceRequirements `json:"resources,omitempty"`
}

type KubernetesAdmissionEventsConfig struct {
// Enable the Kubernetes Admission Events feature.
// Default: false
// +optional
Enabled *bool `json:"enabled,omitempty"`
}

// CWSInstrumentationConfig contains the configuration of the CWS Instrumentation admission controller endpoint.
type CWSInstrumentationConfig struct {
// Enable the CWS Instrumentation admission controller endpoint.
Expand Down
4 changes: 4 additions & 0 deletions api/datadoghq/v2alpha1/envvar.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ const (
DDSystemProbeExternal = "DD_SYSTEM_PROBE_EXTERNAL"
DDSystemProbeSocket = "DD_SYSPROBE_SOCKET"
DDTags = "DD_TAGS"
// otelcollector core agent configs
DDOtelCollectorCoreConfigEnabled = "DD_OTELCOLLECTOR_ENABLED"
DDOtelCollectorCoreConfigExtensionURL = "DD_OTELCOLLECTOR_EXTENSION_URL"
DDOtelCollectorCoreConfigExtensionTimeout = "DD_OTELCOLLECTOR_EXTENSION_TIMEOUT"

DockerHost = "DOCKER_HOST"
// KubernetesEnvvarName Env var used by the Datadog Agent container entrypoint
Expand Down
Loading

0 comments on commit d3fcaff

Please sign in to comment.