Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support KSMCore in DCA #330

Merged
merged 2 commits into from
Jul 5, 2021
Merged

Support KSMCore in DCA #330

merged 2 commits into from
Jul 5, 2021

Conversation

ahmed-mez
Copy link
Contributor

@ahmed-mez ahmed-mez commented Jul 5, 2021

What does this PR do?

  • Support running KSM core in the Cluster Agent (default mode).
  • Fixed KSM RBACs
  • Refactored the KSM code cluster-check mode

Motivation

The default mode should only require deploying the Cluster Agent

Describe your test plan

  • Configure the kubeStateMetricsCore feature section in the DatadogAgent spec
  features:
    kubeStateMetricsCore:
      enabled: true

Case 1: undefined kubeStateMetricsCore.clusterCheck + cluster check runners enabled, the ksm check runs as a clustercheck
Case 2: undefined kubeStateMetricsCore.clusterCheck + cluster check runners disabled, the cluster agent runs the ksm check
Case 3: kubeStateMetricsCore.clusterCheck is true: the ksm check runs as a clustercheck
Case 4:kubeStateMetricsCore.clusterCheck is false: the cluster agent runs the ksm check

Important: Make sure this PR solves the bug reported in #307

@ahmed-mez ahmed-mez added enhancement New feature or request component/controller labels Jul 5, 2021
@ahmed-mez ahmed-mez added this to the v0.7 milestone Jul 5, 2021
@ahmed-mez ahmed-mez requested review from a team as code owners July 5, 2021 09:48
@codecov-commenter
Copy link

codecov-commenter commented Jul 5, 2021

Codecov Report

Merging #330 (409265d) into main (2b31269) will increase coverage by 25.80%.
The diff coverage is 64.10%.

Impacted file tree graph

@@             Coverage Diff             @@
##             main     #330       +/-   ##
===========================================
+ Coverage   37.41%   63.22%   +25.80%     
===========================================
  Files          62       60        -2     
  Lines       11053     6602     -4451     
===========================================
+ Hits         4136     4174       +38     
+ Misses       6620     2125     -4495     
- Partials      297      303        +6     
Flag Coverage Δ
unittests 63.22% <64.10%> (+25.80%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
api/v1alpha1/datadogagent_types.go 100.00% <ø> (ø)
controllers/datadogagent_controller.go 60.60% <ø> (ø)
controllers/datadogagent/clusteragent.go 69.76% <28.57%> (-0.29%) ⬇️
api/v1alpha1/datadogagent_default.go 79.26% <60.00%> (-0.26%) ⬇️
...ntrollers/datadogagent/clusterchecksrunner_rbac.go 64.10% <60.00%> (+8.54%) ⬆️
controllers/datadogagent/kubestatemetrics.go 85.39% <68.33%> (-8.52%) ⬇️
controllers/datadogagent/utils.go 82.73% <100.00%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2b31269...409265d. Read the comment docs.

@ahmed-mez ahmed-mez merged commit 5a31233 into main Jul 5, 2021
@ahmed-mez ahmed-mez deleted the ahmed/ksm-core-dca branch July 5, 2021 12:57
@ahmed-mez ahmed-mez linked an issue Jul 9, 2021 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enabling kubeStateMetricsCore disables other clusterAgent checks
3 participants