[CONTP-1569] Add KSM CollectSecretMetrics and CollectConfigMaps to CRD#2948
[CONTP-1569] Add KSM CollectSecretMetrics and CollectConfigMaps to CRD#2948
Conversation
b7540e5 to
ed6ca34
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2948 +/- ##
==========================================
+ Coverage 40.91% 41.12% +0.21%
==========================================
Files 324 324
Lines 28743 28940 +197
==========================================
+ Hits 11760 11902 +142
- Misses 16129 16175 +46
- Partials 854 863 +9
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 3 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
🎯 Code Coverage (details) 🔗 Commit SHA: d4c8573 | Docs | Datadog PR Page | Give us feedback! |
ed6ca34 to
8cd5a40
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8cd5a40bb8
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
6582164 to
35375e4
Compare
Second split-out of CONTP-1569 (Operator <-> Helm chart parity). Adds two KubeStateMetricsCoreFeatureConfig boolean toggles: - CollectSecretMetrics (*bool, default true): when false, drops the secrets collector from the rendered KSM check instance and drops the SecretsResource permission from the ClusterRole core-API rule. - CollectConfigMaps (*bool, default true): same shape for ConfigMaps. Both fields default to nil/true, preserving today's behavior. Existing users who don't set either field see no change in the rendered ConfigMap (collector list byte-identical), no change in the ClusterRole, and no change in the KSM checksum annotation (the new keys are added to the change-detection hash input only when the CR explicitly sets the field), so an operator upgrade does not trigger a Cluster Agent pod rotation. Sub-task of CONTP-1446. Independent of the parallel labels_as_tags / annotations_as_tags / tags PR.
35375e4 to
d4c8573
Compare
Adds two additive boolean toggles to
KubeStateMetricsCoreFeatureConfigthat gate one entry each in the KSM check-instance collector list and one resource each in the ClusterRole's core-API rule.collectSecretMetrics*booltruefalse, drops thesecretscollector from the rendered KSM check instance and dropsSecretsResourcefrom the ClusterRole core-API rulecollectConfigMaps*booltruefalse, drops theconfigmapscollector and dropsConfigMapsResourcefrom the ClusterRoleExample
DatadogAgent CR opting out of both collectors:
Rendered KSM check instance (
datadog-kube-state-metrics-core-configConfigMap, relevant excerpt —secretsandconfigmapsare absent from the collectors list):Rendered ClusterRole (
datadog-datadog-ksm-core-ccr, core-API rule — 11 resources instead of the default 13):Notes
Shape of
collectSecretMetrics/collectConfigMapsmatches the Helm chartdatadog.kubeStateMetricsCore.collectSecretMetricsanddatadog.kubeStateMetricsCore.collectConfigMaps(both default totruein Helm).Independent of #2937 (parallel
labelsAsTags/annotationsAsTags/tagsPR). Both PRs touchfeature.goandconfigmap.goin differentfunctions; whichever lands first will require the other to do a small mechanical rebase (regenerate codegen).