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

feat: allow setting service annotations via helm chart #6894

Merged
merged 2 commits into from
Oct 22, 2024

Conversation

jamesduffy
Copy link
Contributor

@jamesduffy jamesduffy commented Aug 28, 2024

Fixes #N/A

Description
Allows setting annotations on the karpenter service. We need this so that we can add annotations to setup datadog to monitor karpenter. There are probably other use cases.

How was this change tested?

Generated a helm chart locally with the additional values:

service:
  annotations:
    ad.datadoghq.com/service.checks: |
      {
        "karpenter": {
          "cluster_check": true,
          "init_config": {},
          "instances": [
            {
              "openmetrics_endpoint": "http://%%host%%:8000/metrics",
              "exclude_metrics": [
                "^karpenter\\.go\\..*$"
              ]
            }
          ]
        }
      }

Does this change impact docs?

  • Yes, PR includes docs updates
  • Yes, issue opened: #
  • No

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@jamesduffy jamesduffy requested a review from a team as a code owner August 28, 2024 21:45
@jamesduffy jamesduffy requested a review from jmdeal August 28, 2024 21:45
Copy link

netlify bot commented Aug 28, 2024

Deploy Preview for karpenter-docs-prod canceled.

Name Link
🔨 Latest commit e8752b6
🔍 Latest deploy log https://app.netlify.com/sites/karpenter-docs-prod/deploys/6716c0bc3445cf000831eac8

@jmdeal
Copy link
Contributor

jmdeal commented Sep 5, 2024

What's preventing you from using the existing additionalAnnotations field? Unless absolutely necessary, we'd like to avoid additional configuration in the helm chart.

@jamesduffy
Copy link
Contributor Author

What's preventing you from using the existing additionalAnnotations field? Unless absolutely necessary, we'd like to avoid additional configuration in the helm chart.

additionalAnnotations adds the annotations to a lot of different things. This would be picked up from the Datadog agent as separate checks and instead of running just one check for Karpenter it would run duplicate checks for each place additionalAnnotations is injected. Therefore, we would need a way to add the annotation in a single place. Datadog annotations are often on the service.

Copy link
Contributor

This PR has been inactive for 14 days. StaleBot will close this stale PR after 14 more days of inactivity.

@jamesduffy
Copy link
Contributor Author

@jmdeal I would like to move forward with this if my explanation makes sense.

@jmdeal
Copy link
Contributor

jmdeal commented Oct 14, 2024

Sorry this has slipped, could you elaborate on what the consequences of this are?

This would be picked up from the Datadog agent as separate checks and instead of running just one check for Karpenter it would run duplicate checks for each place additionalAnnotations is injected.

Unless this is strictly blocking, and no other workarounds exist, we don't want to expand the configuration surface for the helm chart we ship.

@jamesduffy
Copy link
Contributor Author

jamesduffy commented Oct 14, 2024

Sorry this has slipped, could you elaborate on what the consequences of this are?

This would be picked up from the Datadog agent as separate checks and instead of running just one check for Karpenter it would run duplicate checks for each place additionalAnnotations is injected.

Unless this is strictly blocking, and no other workarounds exist, we don't want to expand the configuration surface for the helm chart we ship.

The datadog agent watches for annotations to configure it's checks/metric collection. Using the existing additionalAnnotations would create annotations on more than one resource. This would configure the datadog agent to run multiple collections of the same metrics making it unusable.

If anyone wants to use datadog to collect metrics using datadog's autodiscovery they will also have this problem.

@jmdeal
Copy link
Contributor

jmdeal commented Oct 15, 2024

Got it, I assume for most resources this would be a no-op, but you can get duplicate metrics since it would scrape both the Karpenter pods and the service?

@jamesduffy
Copy link
Contributor Author

jamesduffy commented Oct 15, 2024 via email

Copy link
Contributor

@jmdeal jmdeal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed offline with other team members, the use-case seems strong enough. LGTM 🚀

@coveralls
Copy link

Pull Request Test Coverage Report for Build 11448527366

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 82.883%

Totals Coverage Status
Change from base Build 11445189374: 0.0%
Covered Lines: 5641
Relevant Lines: 6806

💛 - Coveralls

@jmdeal jmdeal merged commit fd2b607 into aws:main Oct 22, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants