CASCL-1077 v1alpha2 datadog pod autoscaler profile CRD#2718
CASCL-1077 v1alpha2 datadog pod autoscaler profile CRD#2718
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5ca062e899
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| metadata: | ||
| annotations: | ||
| controller-gen.kubebuilder.io/version: v0.17.3 | ||
| name: datadogpodautoscalerprofiles.datadoghq.com |
There was a problem hiding this comment.
Include new profile CRD in kustomize resources
This new CRD manifest is generated, but config/crd/kustomization.yaml is unchanged and does not list datadoghq.com_datadogpodautoscalerprofiles.yaml, so kustomize build config/crd (used by make install/make deploy in Makefile) will not ship this resource at all; in clusters installed from these manifests, DatadogPodAutoscalerProfile will be unavailable despite the API type existing in code.
Useful? React with 👍 / 👎.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2718 +/- ##
==========================================
- Coverage 38.80% 38.69% -0.11%
==========================================
Files 308 309 +1
Lines 26703 26900 +197
==========================================
+ Hits 10363 10410 +47
- Misses 15561 15711 +150
Partials 779 779
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
|
||
| const ( | ||
| // DatadogPodAutoscalerProfileReadyCondition indicates whether the profile is ready and all managed autoscalers are up to date. | ||
| DatadogPodAutoscalerProfileReadyCondition DatadogPodAutoscalerProfileConditionType = "Ready" |
There was a problem hiding this comment.
I still don't understand the purpose of this condition. Seems to me like you need more things like Valid, Error and then fields to represent aggregated state and observed object. (managedAutoscalers, updatedAutoscalers, observedGeneration).
| // ApplyPolicy defines how recommendations should be applied. | ||
| // +optional | ||
| // +kubebuilder:default={} | ||
| ApplyPolicy *DatadogPodAutoscalerApplyPolicy `json:"applyPolicy,omitempty"` |
There was a problem hiding this comment.
Did we get a decision on including this?
There was a problem hiding this comment.
Well, I personally see benefits in both scenarios - when we have it only on DPA and when we have it on Profile level as well.
I think it can be useful to be able to disable all managed autoscalers with one change in profile.
For disabling one specific autoscaler - I remember some idea from the past discussions what we should be able to use some cluster-local way to disable autoscaling immediately. If we still want to implement this I think in that case having ApplyPolicy in Profile and be able to put a label/config/annotation on DPA locally to disable this specific one - is a good complimentary pack of features.
@vboulineau what do you think?
There was a problem hiding this comment.
And one more argument is that controlling the final mode = horizontal, vertical or multidimensional - is done through ApplyPolicy. If I want VPA-only I will need to setup this structure.
So I am more convinced now that we need this property on profile side that the other way around.
What does this PR do?
Introduces DatadogPodAutoscalerProfile CRD in v1alpha2 to enable GitOps batch onboarding for workload autoscaling. The Profile contains a template with autoscaling behavior configuration that can be applied to multiple DatadogPodAutoscaler (DPA) objects at once.
Please check this and this document to learn more about this project.
Motivation
Enable users to manage autoscaling configurations centrally via Profiles instead of creating individual DPA objects for each workload. This simplifies GitOps workflows where multiple workloads need the same autoscaling behavior.
Mental model here can be similar to how Kubernetes ReplicaSet manages Pods => DatadogPodAutoscalerProfile will manage DPAs.
Additional Notes
API Design:
v1alpha2packageStatus fields:
Printcolumns:
autoscaling.datadoghq.com/profile-name,autoscaling.datadoghq.com/profile-description)Minimum Agent Versions
Are there minimum versions of the Datadog Agent and/or Cluster Agent required?
Describe your test plan
Check that other repos are still compiling after that change.
Trying to create this object in local k8s cluster.
Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel