Skip to content

Commit cf217ea

Browse files
khewoncgjulianmtbaveliervboulineaucelenechang
authored
Merge main into dda 2025-04-22 (#1873)
* Use PodResources mount as a path instead of file (#1674) * Use folder instead of file mount * Fix test * PodResourcesSocketDir->PodResourcesSocketPath * remove unused function from merge * nits + generate --------- Co-authored-by: Timothée Bavelier <timothee.bavelier@datadoghq.com> * Share common types between Autoscaler versions (#1663) * Share common types between Autoscaler versions * Apply suggestions from code review Co-authored-by: Celene <celene@datadoghq.com> --------- Co-authored-by: Timothée Bavelier <97530782+tbavelier@users.noreply.github.com> Co-authored-by: Celene <celene@datadoghq.com> * Bump the gh-actions-packages group with 7 updates (#1659) Bumps the gh-actions-packages group with 7 updates: | Package | From | To | | --- | --- | --- | | [actions/checkout](https://github.com/actions/checkout) | `1.2.0` | `4.2.2` | | [actions/setup-go](https://github.com/actions/setup-go) | `1.1.3` | `5.3.0` | | [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) | `3.2.0` | `6.1.0` | | [github/codeql-action](https://github.com/github/codeql-action) | `2.28.1` | `3.28.8` | | [codecov/codecov-action](https://github.com/codecov/codecov-action) | `2.1.0` | `5.3.1` | | [softprops/action-gh-release](https://github.com/softprops/action-gh-release) | `1` | `2` | | [rajatjindal/krew-release-bot](https://github.com/rajatjindal/krew-release-bot) | `0.0.43` | `0.0.47` | Updates `actions/checkout` from 1.2.0 to 4.2.2 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v1.2.0...11bd719) Updates `actions/setup-go` from 1.1.3 to 5.3.0 - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](actions/setup-go@v1.1.3...f111f33) Updates `goreleaser/goreleaser-action` from 3.2.0 to 6.1.0 - [Release notes](https://github.com/goreleaser/goreleaser-action/releases) - [Commits](goreleaser/goreleaser-action@b508e2e...9ed2f89) Updates `github/codeql-action` from 2.28.1 to 3.28.8 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@b8d3b6e...dd74661) Updates `codecov/codecov-action` from 2.1.0 to 5.3.1 - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](codecov/codecov-action@f32b3a3...13ce06b) Updates `softprops/action-gh-release` from 1 to 2 - [Release notes](https://github.com/softprops/action-gh-release/releases) - [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md) - [Commits](softprops/action-gh-release@de2c0eb...c95fe14) Updates `rajatjindal/krew-release-bot` from 0.0.43 to 0.0.47 - [Release notes](https://github.com/rajatjindal/krew-release-bot/releases) - [Changelog](https://github.com/rajatjindal/krew-release-bot/blob/main/.goreleaser.yml) - [Commits](rajatjindal/krew-release-bot@92da038...3d9faef) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major dependency-group: gh-actions-packages - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major dependency-group: gh-actions-packages - dependency-name: goreleaser/goreleaser-action dependency-type: direct:production update-type: version-update:semver-major dependency-group: gh-actions-packages - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major dependency-group: gh-actions-packages - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major dependency-group: gh-actions-packages - dependency-name: softprops/action-gh-release dependency-type: direct:production update-type: version-update:semver-major dependency-group: gh-actions-packages - dependency-name: rajatjindal/krew-release-bot dependency-type: direct:production update-type: version-update:semver-patch dependency-group: gh-actions-packages ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Timothée Bavelier <97530782+tbavelier@users.noreply.github.com> Co-authored-by: Fanny Jiang <fanny.jiang@datadoghq.com> * use gci lint + install tools (#1691) * [CECO-1860][DatadogGenericResource] Add monitor support (#1635) * refactor based on #1602 * fix finalizer test following refactor * remove dead code following refactor * move id conversion functions to utils.go from notebooks.go * move synthetics status update function to synthetics.go from utils.go (and associated test) * follow-up to 7b2552e: moving away from specific notebook id conversion to generic * nit: fix update error message * add monitor to supported generic resource controller * move id conversion functions to utils.go from notebooks.go * move synthetics status update function to synthetics.go from utils.go (and associated test) * follow-up to 7b2552e: moving away from specific notebook id conversion to generic * nit: fix update error message * lint --------- Co-authored-by: levan-m <116471169+levan-m@users.noreply.github.com> * (documentation) Update DatadogGenericResource contribute documentation (#1695) * correct jsonSpec + use fake monitor IDs * Update dev doc * Update docs/datadog_generic_resource_dev.md Co-authored-by: Heston Hoffman <hestonhoffman@gmail.com> * doc review --------- Co-authored-by: Heston Hoffman <hestonhoffman@gmail.com> * update default fips-proxy image version to 1.1.7 (#1699) * Fix parsing group resource to allow groups with periods (#1697) * Fix parsing group resource to allow groups with periods * remove GetVerb * Update bundle and manager config from v1.12 (#1701) * Fix some names in common Autoscaler types (#1706) * Add Gitlab job to run redhat preflight check on rcs (#1709) * new job to run preflight check w/o submission * more logging * change log level to debug * remove testing conditions * depend on publish public tag + test * undo testing changes * update podresources mount to only be in agent container (#1716) * feat(error tracking): add core agent and error tracking standalone settings (#1553) * Add core agent and error tracking standalone settings * Simplify bool condition * set up defaults * add tests * add example * fix tests * rework into ErrorTracking.Mode * rework into single errorTrackingStandalone variable * fix typo * update generated files * doc fixes --------- Co-authored-by: Eloy Toro <eloy.toro@datadoghq.com> Co-authored-by: levan-m <116471169+levan-m@users.noreply.github.com> Co-authored-by: Levan Machablishvili <levan.machablishvili@datadoghq.com> * bump golang to 1.23.6 (#1720) * bump default agent images to 7.63.0 (#1722) * Update OTel agent image (#1728) * Update OTel agent image Use `7.63.0-ot-beta-jmx` instead of nightly image. This will need to be updated once OTel agent is GA (7.64.0), as the ot-beta image will be discontinued. * Update pkg/defaulting/images.go Co-authored-by: Celene <celene@datadoghq.com> --------- Co-authored-by: Celene <celene@datadoghq.com> * Generate fips image compiled with Go boringcrypto (#1731) * checkpoint: builds both with cli arg * fips image for main build * add jobs for generating fips image and publishing main-fips tag * fix main fips job references * fix param naming * fix: set `DD_ADP_ENABLED` to `true` on Core Agent when ADP enabled (#1725) * api/datadoghq/v2alpha1: add support for SSI targets (#1670) * api/datadoghq/v2alpha1: add support for SSI targets * error cleanup * revert example * Update docs/configuration.v2alpha1.md Co-authored-by: Alicia Scott <aliciascott@users.noreply.github.com> * feat(ssi): add tracer config options This commit adds the tracer config options we've just added. * Fix tests * Address PR feedback * Address PR feedback * add log to warn for non-compatible agent version * fix * fix lint * fix tests * update types --------- Co-authored-by: Mark Spicer <mark@markspicer.me> Co-authored-by: Alicia Scott <aliciascott@users.noreply.github.com> Co-authored-by: Mark Spicer <mark.spicer@datadoghq.com> Co-authored-by: Celene <celene@datadoghq.com> * Add gitlab workflows to publish fips images (#1732) * Add gitlab workflows to publish fips images * Add back -w -s ldflags * bump kustomize to 5.6.0 (#1735) * Update check_preflight_redhat_image image tag (#1740) * Remove IsReadOnly from dashboard (#1742) * bump 7.63.2 (#1744) * Pass fips image tag to internal fips template (#1748) * Support agent sidecar securityContext (#1733) * add doc page for slos (#1757) * bump 7.63.3 (#1760) * update default fips-proxy image version to 1.1.8 (#1763) * small fix for error handling (#1768) * Fix internal fips image tag (#1770) * [CECO-2004] Always run e2e tests on release branches (#1764) * always run e2e tests on rc branches (test) * testing * remove testing rules * use default provenance and oci media type (#1772) * Gate profile canary waits behind annotation (#1758) * use partof label to cleanup only owned ds/deployments (#1767) * Handle Daemonset notFound when deleting Agent DS (#1779) * Handle Daemonset notFound when deleting Agent DS * Update internal/controller/datadogagent/controller_v2_test.go Co-authored-by: Celene <celene@datadoghq.com> --------- Co-authored-by: Celene <celene@datadoghq.com> * Pass TMPL_RELEASE_TAG in internal image build workflow (#1782) * Clean up integration tests (#1715) * Revert "Pass TMPL_RELEASE_TAG in internal image build workflow (#1782)" (#1788) This reverts commit 780f696. * DOCS-10284: editing operator docs (#1755) * initial pass at docs edits * finishing edit * Apply suggestions from code review Co-authored-by: Alicia Scott <aliciascott@users.noreply.github.com> Co-authored-by: Celene <celene@datadoghq.com> * edits * Apply suggestions from code review Co-authored-by: Celene <celene@datadoghq.com> * edits --------- Co-authored-by: Alicia Scott <aliciascott@users.noreply.github.com> Co-authored-by: Celene <celene@datadoghq.com> * [feature/eventcollection] Don't set anything for the node agent (#1781) Co-authored-by: fanny-jiang <fanny.jiang@datadoghq.com> * [component/agent/default] Don't set DD_LEADER_ELECTION (#1787) Co-authored-by: fanny-jiang <fanny.jiang@datadoghq.com> * fix typo in license dir on operator image (#1793) * fix typo * remove un-necessary mkdir * enhancement: per-container image override support (#1730) * add support for Service Discovery network stats collection (#1780) * add config option for Service Discovery network stats collection * fix default value * Update internal/controller/datadogagent/feature/servicediscovery/feature.go Co-authored-by: Celene <celene@datadoghq.com> * fix CR --------- Co-authored-by: Celene <celene@datadoghq.com> * [tooling] use latest preflight version (#1797) * fixing links (#1799) * [CECO-2084] Handle custom versions (not following semver) as always above minVersion (#1786) * handle main/latest as always above minVersion * return true when unable to convert to semver * Change Operator base image from ubi-minimal to ubi-micro (#1798) * Change Operator base image from ubi-minimal to ubi-micro * switch check image to ubi-micro * Update correct file * update bundles following 1.13.0 release (#1806) * [tooling][gitlab] separate publishing latest images, tweak community operators job (#1803) * separate publishing latest images, tweak community operators job * update from review * sort git tag by semver (#1807) * servicediscovery: add mounts of module and src volumes (#1804) * [documentation] add example for configuring extra confd (#1811) * [documentation] add example for configuring extra confd * address feedback * small edit * Add backport PR GHA (#1809) * testing backport pr * testing conditions run without merge * more testing conditions * trying app token * test on branch * add workflow dispatch * switch to pull_request for testing * cleaning up * trigger workflow in 2 scenarios 1. pr labeled after merge, merge action 2. pr merged but label is already present * copy ca certs from ubi minimal (#1820) * [autoscaling] Make objectives required CRD v1alpha2 (#1819) * Support evaluation window option for monitors (#1702) Co-authored-by: levan-m <116471169+levan-m@users.noreply.github.com> * [CECO-2004] Run e2e tests in more conditions (#1777) * reorder e2e stage jobs * reorder stages * update conditions for e2e * change conditional for conductor triggered job * always run e2e tests otherwise * add logging, cleanup * remove debugging lines * nit * extend ksmcheck waitFor duration * extend check time more * add error tracking standalone var to the core agent (#1818) * Allow to configure SlowStartAdditiveIncrease (#1821) * Update backport PR conditions (#1826) * update run action conditions * noop change for testing (#1822) * remove create app token step * update to only run when labeling a merged pr * noop to test backport pr (#1824) * testing (#1825) * change test-id to integer string id (#1828) * Add validations to DatadogMonitorSpec (#1694) Co-authored-by: levan-m <116471169+levan-m@users.noreply.github.com> * [e2e] Disable e2e tests on nightly build (#1829) * disable e2e on nightly * Update .gitlab-ci.yml Co-authored-by: Timothée Bavelier <97530782+tbavelier@users.noreply.github.com> --------- Co-authored-by: Timothée Bavelier <97530782+tbavelier@users.noreply.github.com> * [CECO-2005] Configure additional k8s versions for e2e CI (#1769) * always run e2e tests on rc branches (test) * testing * remove testing rules * add k8s versions and testing rules * add tags for runner type * run tests on ubuntu 2004 * change order of VMOption * remove ubuntu 20.04 vm and old versions * mistake with merge conflict --------- Co-authored-by: levan-m <116471169+levan-m@users.noreply.github.com> * Enable pod-resources mount only with GPU monitoring enabled (#1801) * Enable podResources socket only with GPU monitoring feature * Add unit tests * Move env var * Update internal/controller/datadogagent/feature/gpu/feature_test.go Co-authored-by: Celene <celene@datadoghq.com> * fix linter --------- Co-authored-by: Celene <celene@datadoghq.com> Co-authored-by: levan-m <116471169+levan-m@users.noreply.github.com> * (chore) E2E: use m5.xlarge instead of default t3.medium (#1831) * use m5.xlarge instead of default t3.medium * enable gitlab timestamps * modify aws provisioner * update default fips-proxy image version to 1.1.9 (#1830) Co-authored-by: levan-m <116471169+levan-m@users.noreply.github.com> * Add checksd volume to ccr init-config (#1823) Co-authored-by: levan-m <116471169+levan-m@users.noreply.github.com> * Add validations to DatadogDashboardSpec (#1704) Co-authored-by: Sarah Wang <sarah.wang@datadoghq.com> * [kubectl plugin] Fallback to configmap leader attempt for `clusteragent` if lease failed (#1833) * add force-configmap flag * Revert "add force-configmap flag" This reverts commit b1b2cd4. * fallback instead of using flag * Bump Agent to 7.64.1 (#1834) * [defaulting] clean up unused image methods (#1839) * [defaulting] use jmx images for agent and cluster checks runner * clean up jmx methods instead * Add permission for PDB (#1841) Orchestrator needs it since 7.64.1 * [autoscaling] Move to v1alpha2 as only supported version for Cluster Agent 7.64+ (#1845) * Add flag (#1840) * sign with githubops containers key (#1850) * Bump Agent to 7.64.3 (#1847) * Bump Agent to 7.64.2 * Bump Agent to 7.64.3 * [tooling] Add milestone to automated backport PR (#1856) * automatically add milestone to backport pr * pin action by hash * [datadogpodautoscalers] Add local fallback policy (#1759) * Fix missing apostrophe in dpa json * Add fallback policy and types * Generate files * Fix typo in apply policy name * Use new fallback policy type * Update fallback policy to only expose necessary options * Update comment to reflect how pod resource objectives are defined * Use bool for enabling fallback to reflect binary option * fixup! Use bool for enabling fallback to reflect binary option * Use fallback as top level for flexibility to add other fallback modes in future * Fix SlowStartAdditiveIncrease (#1857) * update seccomp profile to fix k3s (#1862) Fixes #1726 * Add external as a valid recommendation source (#1867) * [CECO-2114] Fix backport automated milestone (#1860) * testing backport milestone addition * copy backport pr * pin to hash * remove some debug lines * Include golangci-lint in fmt Make target (#1714) * Include golangci-lint in fmt Make target * fix formatting issues --------- Co-authored-by: Sarah Wang <sarah.wang@datadoghq.com> Co-authored-by: Sarah Wang <sarah.wang2009@gmail.com> * Add seccomp changes from #1862 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Guillermo Julián <gjulianm@users.noreply.github.com> Co-authored-by: Timothée Bavelier <timothee.bavelier@datadoghq.com> Co-authored-by: Vincent Boulineau <58430298+vboulineau@users.noreply.github.com> Co-authored-by: Timothée Bavelier <97530782+tbavelier@users.noreply.github.com> Co-authored-by: Celene <celene@datadoghq.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Fanny Jiang <fanny.jiang@datadoghq.com> Co-authored-by: levan-m <116471169+levan-m@users.noreply.github.com> Co-authored-by: Heston Hoffman <hestonhoffman@gmail.com> Co-authored-by: louis-cqrl <93274433+louis-cqrl@users.noreply.github.com> Co-authored-by: Adel Haj Hassan <41540817+adel121@users.noreply.github.com> Co-authored-by: Sarah Wang <sarah.wang@datadoghq.com> Co-authored-by: Gianluca Bortoli <giallogiallo93@gmail.com> Co-authored-by: Eloy Toro <eloy.toro@datadoghq.com> Co-authored-by: Levan Machablishvili <levan.machablishvili@datadoghq.com> Co-authored-by: Mackenzie <63265430+mackjmr@users.noreply.github.com> Co-authored-by: Toby Lawrence <tobz@users.noreply.github.com> Co-authored-by: Kyle Nusbaum <kjn@9project.net> Co-authored-by: Mark Spicer <mark@markspicer.me> Co-authored-by: Alicia Scott <aliciascott@users.noreply.github.com> Co-authored-by: Mark Spicer <mark.spicer@datadoghq.com> Co-authored-by: Keisuke Umegaki <41987730+keisku@users.noreply.github.com> Co-authored-by: Shuhei Kitagawa <shuheiktgw@users.noreply.github.com> Co-authored-by: cecilia saixue watt <cecilia.watt@datadoghq.com> Co-authored-by: David Ortiz <david.ortiz@datadoghq.com> Co-authored-by: Guillaume Pagnoux <Yumasi@users.noreply.github.com> Co-authored-by: Eloy Toro <eloytoro@gmail.com> Co-authored-by: AliDatadog <125997632+AliDatadog@users.noreply.github.com> Co-authored-by: Joachim <jbartosik@gmail.com> Co-authored-by: Jennifer Chen <32009013+jennchenn@users.noreply.github.com> Co-authored-by: Bryce Kahle <bryce.kahle@datadoghq.com> Co-authored-by: Sarah Wang <sarah.wang2009@gmail.com>
1 parent a4ba296 commit cf217ea

File tree

24 files changed

+332
-88
lines changed

24 files changed

+332
-88
lines changed

.github/workflows/backport-pr.yml

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,63 @@ jobs:
1010
name: Backport PR
1111
runs-on: ubuntu-latest
1212
if: >
13-
github.event.action == 'labeled'
14-
&& github.event.pull_request.merged_at != null
15-
&& contains(github.event.label.name, 'backport/')
13+
(github.event_name == 'workflow_dispatch' ||
14+
(github.event.action == 'labeled'
15+
&& contains(github.event.label.name, 'backport/')))
1616
permissions:
1717
contents: write
1818
pull-requests: write
19-
steps:
20-
- uses: tibdex/backport@9565281eda0731b1d20c4025c43339fb0a23812e # v2.0.4
19+
issues: write
20+
steps:
21+
- name: Create app token
22+
uses: actions/create-github-app-token@21cfef2b496dd8ef5b904c159339626a10ad380e # v1.11.6
23+
id: app-token
24+
with:
25+
app-id: ${{ secrets.DD_GITHUBOPS_TOKEN_APP_ID }}
26+
private-key: ${{ secrets.DD_GITHUBOPS_TOKEN_PRIVATE_KEY }}
27+
28+
- name: Create backport PR
29+
uses: tibdex/backport@9565281eda0731b1d20c4025c43339fb0a23812e # v2.0.4
30+
id: backport
2131
with:
2232
label_pattern: "^backport/(?<base>([^ ]+))$"
2333
labels_template: "<%= JSON.stringify([...labels, 'backport', 'bot']) %>"
24-
github_token: ${{ secrets.GITHUB_TOKEN }}
25-
title_template: "[ Backport <%- base %> ] <%- title %>"
34+
github_token: ${{ steps.app-token.outputs.token }}
35+
title_template: "[Backport <%- base %>] <%- title %>"
2636
body_template: |
2737
Backport <%- mergeCommitSha %> from #<%- number %>.
2838
2939
___
3040
3141
<%- body %>
42+
43+
- name: Copy milestone to backport PR
44+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
45+
env:
46+
BACKPORT_PR: ${{ steps.backport.outputs.created_pull_requests }}
47+
with:
48+
github-token: ${{ steps.app-token.outputs.token }}
49+
script: |
50+
console.log('Raw backport output:', process.env.BACKPORT_PR);
51+
52+
const orig = context.payload.pull_request;
53+
if (!orig.milestone) {
54+
console.log('No milestone to copy.');
55+
return;
56+
}
57+
// Get the milestone number
58+
const milestoneNumber = orig.milestone.number;
59+
console.log('Milestone number:', milestoneNumber);
60+
61+
// Parse the backport PR number from the JSON output
62+
const backportData = JSON.parse(process.env.BACKPORT_PR);
63+
const prNumber = backportData.backport;
64+
console.log('Parsed PR number:', prNumber);
65+
console.log(`Copying milestone ${milestoneNumber} to PR ${prNumber}`);
66+
67+
await github.rest.issues.update({
68+
owner: context.repo.owner,
69+
repo: context.repo.repo,
70+
issue_number: prNumber,
71+
milestone: milestoneNumber
72+
});

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ all: build test ## Build test
6969
build: manager kubectl-datadog ## Builds manager + kubectl plugin
7070

7171
.PHONY: fmt
72-
fmt: ## Run go fmt against code
72+
fmt: bin/$(PLATFORM)/golangci-lint ## Run formatters against code
7373
go fmt ./...
74+
bin/$(PLATFORM)/golangci-lint run ./... --fix
7475

7576
.PHONY: vet
7677
vet: ## Run go vet against code
@@ -303,7 +304,7 @@ patch-crds: bin/$(PLATFORM)/yq ## Patch-crds
303304
hack/patch-crds.sh
304305

305306
.PHONY: lint
306-
lint: bin/$(PLATFORM)/golangci-lint fmt vet ## Lint
307+
lint: bin/$(PLATFORM)/golangci-lint vet ## Lint
307308
bin/$(PLATFORM)/golangci-lint run ./...
308309

309310
.PHONY: licenses

api/datadoghq/common/datadogpodautoscaler_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,9 @@ const (
264264

265265
// DatadogPodAutoscalerLocalValueSource is a recommendation that comes from the local fallback.
266266
DatadogPodAutoscalerLocalValueSource DatadogPodAutoscalerValueSource = "Local"
267+
268+
// DatadogPodAutoscalerExternalValueSource is a recommendation that comes from an external source.
269+
DatadogPodAutoscalerExternalValueSource DatadogPodAutoscalerValueSource = "External"
267270
)
268271

269272
// DatadogPodAutoscalerHorizontalStatus defines the status of the horizontal scaling

api/datadoghq/v1alpha1/datadogpodautoscaler_types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ type DatadogPodAutoscalerPolicy struct {
142142
// +kubebuilder:printcolumn:name="Generated",type="date",JSONPath=".status.vertical.target.generatedAt"
143143
// +kubebuilder:printcolumn:name="Able to Apply",type="string",JSONPath=".status.conditions[?(@.type=='VerticalAbleToApply')].status"
144144
// +kubebuilder:printcolumn:name="Last Trigger",type="date",JSONPath=".status.vertical.lastAction.time"
145-
// +kubebuilder:storageversion
146145
// DatadogPodAutoscaler is the Schema for the datadogpodautoscalers API
147146
type DatadogPodAutoscaler struct {
148147
metav1.TypeMeta `json:",inline"`

api/datadoghq/v1alpha2/datadogpodautoscaler_types.go

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import (
3636
// periodSeconds: 60
3737
// objectives:
3838
// - type: PodResource
39-
// resource:
39+
// podResource:
4040
// name: cpu
4141
// value:
4242
// type: Absolute|Utilization
@@ -49,6 +49,11 @@ import (
4949
// type: Absolute|Utilization
5050
// absolute: 500m
5151
// utilization: 80
52+
// fallback:
53+
// horizontal:
54+
// enabled: true
55+
// triggers:
56+
// staleRecommendationThresholdSeconds: 600
5257
// constraints:
5358
// minReplicas: 1
5459
// maxReplicas: 10
@@ -83,6 +88,11 @@ type DatadogPodAutoscalerSpec struct {
8388
// +kubebuilder:validation:MinItems=1
8489
Objectives []common.DatadogPodAutoscalerObjective `json:"objectives,omitempty"`
8590

91+
// Fallback defines how recommendations should be applied when in fallback mode.
92+
// +optional
93+
// +kubebuilder:default={}
94+
Fallback *DatadogFallbackPolicy `json:"fallback,omitempty"`
95+
8696
// Constraints defines constraints that should always be respected.
8797
Constraints *common.DatadogPodAutoscalerConstraints `json:"constraints,omitempty"`
8898
}
@@ -119,6 +129,37 @@ type DatadogPodAutoscalerApplyPolicy struct {
119129
ScaleDown *common.DatadogPodAutoscalerScalingPolicy `json:"scaleDown,omitempty"`
120130
}
121131

132+
// DatadogFallbackPolicy configures the behavior during fallback mode.
133+
type DatadogFallbackPolicy struct {
134+
// Horizontal configures the behavior during horizontal fallback mode.
135+
// +optional
136+
// +kubebuilder:default={}
137+
Horizontal DatadogPodAutoscalerHorizontalFallbackPolicy `json:"horizontal,omitempty"`
138+
}
139+
140+
// DatadogPodAutoscalerHorizontalFallbackPolicy defines how recommendations should be applied in fallback mode.
141+
type DatadogPodAutoscalerHorizontalFallbackPolicy struct {
142+
// Enabled determines whether recommendations should be applied by the controller:
143+
// +optional
144+
// +kubebuilder:default=true
145+
Enabled bool `json:"enabled"`
146+
147+
// Triggers defines the triggers that will generate recommendations.
148+
// +optional
149+
// +kubebuilder:default={}
150+
Triggers HorizontalFallbackTriggers `json:"triggers,omitempty"`
151+
}
152+
153+
// HorizontalFallbackTriggers defines the triggers that will cause local fallback to be enabled.
154+
type HorizontalFallbackTriggers struct {
155+
// StaleRecommendationThresholdSeconds defines the time window the controller will wait after detecting an error before applying recommendations.
156+
// +optional
157+
// +kubebuilder:default=600
158+
// +kubebuilder:validation:Minimum=100
159+
// +kubebuilder:validation:Maximum=1200
160+
StaleRecommendationThresholdSeconds int32 `json:"staleRecommendationThresholdSeconds,omitempty"`
161+
}
162+
122163
// +kubebuilder:object:root=true
123164
// +kubebuilder:resource:shortName=dpa
124165
// +kubebuilder:subresource:status
@@ -134,6 +175,7 @@ type DatadogPodAutoscalerApplyPolicy struct {
134175
// +kubebuilder:printcolumn:name="Generated",type="date",JSONPath=".status.vertical.target.generatedAt"
135176
// +kubebuilder:printcolumn:name="Able to Apply",type="string",JSONPath=".status.conditions[?(@.type=='VerticalAbleToApply')].status"
136177
// +kubebuilder:printcolumn:name="Last Trigger",type="date",JSONPath=".status.vertical.lastAction.time"
178+
// +kubebuilder:storageversion
137179
// DatadogPodAutoscaler is the Schema for the datadogpodautoscalers API
138180
type DatadogPodAutoscaler struct {
139181
metav1.TypeMeta `json:",inline"`

api/datadoghq/v1alpha2/zz_generated.deepcopy.go

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

cmd/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ type options struct {
114114
edsCanaryAutoFailEnabled bool
115115
edsCanaryAutoFailMaxRestarts int
116116
edsCanaryAutoPauseMaxSlowStartDuration time.Duration
117+
edsSlowStartAdditiveIncrease string
117118
supportCilium bool
118119
datadogAgentEnabled bool
119120
datadogMonitorEnabled bool
@@ -164,6 +165,7 @@ func (opts *options) Parse() {
164165
// ExtendedDaemonset configuration
165166
flag.BoolVar(&opts.supportExtendedDaemonset, "supportExtendedDaemonset", false, "Support usage of Datadog ExtendedDaemonset CRD.")
166167
flag.StringVar(&opts.edsMaxPodUnavailable, "edsMaxPodUnavailable", "", "ExtendedDaemonset number of max unavailable pods during the rolling update")
168+
flag.StringVar(&opts.edsSlowStartAdditiveIncrease, "edsSlowStartAdditiveIncrease", "", "ExtendedDaemonset slow start additive increase")
167169
flag.StringVar(&opts.edsMaxPodSchedulerFailure, "edsMaxPodSchedulerFailure", "", "ExtendedDaemonset number of max pod scheduler failures")
168170
flag.DurationVar(&opts.edsCanaryDuration, "edsCanaryDuration", 10*time.Minute, "ExtendedDaemonset canary duration")
169171
flag.StringVar(&opts.edsCanaryReplicas, "edsCanaryReplicas", "", "ExtendedDaemonset number of canary pods")
@@ -295,6 +297,7 @@ func run(opts *options) error {
295297
SupportExtendedDaemonset: controller.ExtendedDaemonsetOptions{
296298
Enabled: opts.supportExtendedDaemonset,
297299
MaxPodUnavailable: opts.edsMaxPodUnavailable,
300+
SlowStartAdditiveIncrease: opts.edsSlowStartAdditiveIncrease,
298301
CanaryDuration: opts.edsCanaryDuration,
299302
CanaryReplicas: opts.edsCanaryReplicas,
300303
CanaryAutoPauseEnabled: opts.edsCanaryAutoPauseEnabled,

config/crd/bases/v1/datadoghq.com_datadogpodautoscalers.yaml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ spec:
562562
type: object
563563
type: object
564564
served: true
565-
storage: true
565+
storage: false
566566
subresources:
567567
status: {}
568568
- additionalPrinterColumns:
@@ -819,6 +819,32 @@ spec:
819819
required:
820820
- maxReplicas
821821
type: object
822+
fallback:
823+
default: {}
824+
description: Fallback defines how recommendations should be applied when in fallback mode.
825+
properties:
826+
horizontal:
827+
default: {}
828+
description: Horizontal configures the behavior during horizontal fallback mode.
829+
properties:
830+
enabled:
831+
default: true
832+
description: 'Enabled determines whether recommendations should be applied by the controller:'
833+
type: boolean
834+
triggers:
835+
default: {}
836+
description: Triggers defines the triggers that will generate recommendations.
837+
properties:
838+
staleRecommendationThresholdSeconds:
839+
default: 600
840+
description: StaleRecommendationThresholdSeconds defines the time window the controller will wait after detecting an error before applying recommendations.
841+
format: int32
842+
maximum: 1200
843+
minimum: 100
844+
type: integer
845+
type: object
846+
type: object
847+
type: object
822848
objectives:
823849
description: |-
824850
Objectives are the objectives to reach and maintain for the target resource.
@@ -1110,6 +1136,6 @@ spec:
11101136
type: object
11111137
type: object
11121138
served: true
1113-
storage: false
1139+
storage: true
11141140
subresources:
11151141
status: {}

config/crd/bases/v1/datadoghq.com_datadogpodautoscalers_v1alpha2.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,43 @@
279279
],
280280
"type": "object"
281281
},
282+
"fallback": {
283+
"additionalProperties": false,
284+
"default": {},
285+
"description": "Fallback defines how recommendations should be applied when in fallback mode.",
286+
"properties": {
287+
"horizontal": {
288+
"additionalProperties": false,
289+
"default": {},
290+
"description": "Horizontal configures the behavior during horizontal fallback mode.",
291+
"properties": {
292+
"enabled": {
293+
"default": true,
294+
"description": "Enabled determines whether recommendations should be applied by the controller:",
295+
"type": "boolean"
296+
},
297+
"triggers": {
298+
"additionalProperties": false,
299+
"default": {},
300+
"description": "Triggers defines the triggers that will generate recommendations.",
301+
"properties": {
302+
"staleRecommendationThresholdSeconds": {
303+
"default": 600,
304+
"description": "StaleRecommendationThresholdSeconds defines the time window the controller will wait after detecting an error before applying recommendations.",
305+
"format": "int32",
306+
"maximum": 1200,
307+
"minimum": 100,
308+
"type": "integer"
309+
}
310+
},
311+
"type": "object"
312+
}
313+
},
314+
"type": "object"
315+
}
316+
},
317+
"type": "object"
318+
},
282319
"objectives": {
283320
"description": "Objectives are the objectives to reach and maintain for the target resource.\nDefault to a single objective to maintain 80% POD CPU utilization.",
284321
"items": {

config/crd/bases/v1/datadoghq.com_datadogpodautoscalers_v2alpha1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
description": "DatadogPodAutoscaler is the Schema for the datadogpodautoscalers API",
2+
"description": "DatadogPodAutoscaler is the Schema for the datadogpodautoscalers API",
33
"properties": {
44
"apiVersion": {
55
"description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",

0 commit comments

Comments
 (0)