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

Exclude agent pod from admission controller library injection #1309

Merged
merged 3 commits into from
Feb 1, 2024

Conversation

fanny-jiang
Copy link
Contributor

@fanny-jiang fanny-jiang commented Jan 31, 2024

What this PR does / why we need it:

Exclude the agent pod from library injection (receiving new environment variables) when the admission controller is enabled. The agent doesn't send traces and it can be configured to send dogstatsd metrics so it is unnecessary to perform library injection on the agent pod.

This change will also prevent daemonset/agent pod creation problems in GKE Autopilot, which does not allow privileged pod to be mutated.

Which issue this PR fixes

(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged)

  • fixes #

Special notes for your reviewer:

Checklist

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

  • Chart Version bumped
  • Documentation has been updated with helm-docs (run: .github/helm-docs.sh)
  • CHANGELOG.md has been updated
  • Variables are documented in the README.md
  • For Datadog Operator chart or value changes update the test baselines (run: make update-test-baselines)

@fanny-jiang fanny-jiang requested a review from a team as a code owner January 31, 2024 21:53
@fanny-jiang fanny-jiang changed the title Exclude agent container from being labeled by admission controller Exclude agent container from admission controller labels injection Jan 31, 2024
@fanny-jiang fanny-jiang added the chart/datadog This issue or pull request is related to the datadog chart label Jan 31, 2024
Copy link
Collaborator

@clamoriniere clamoriniere left a comment

Choose a reason for hiding this comment

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

that was quick 👏
thanks @fanny-jiang

charts/datadog/templates/daemonset.yaml Outdated Show resolved Hide resolved
@fanny-jiang fanny-jiang changed the title Exclude agent container from admission controller labels injection Exclude agent pod from admission controller labels injection Feb 1, 2024
@fanny-jiang fanny-jiang changed the title Exclude agent pod from admission controller labels injection Exclude agent pod from admission controller library injection Feb 1, 2024
@clamoriniere
Copy link
Collaborator

Copy link
Collaborator

@clamoriniere clamoriniere left a comment

Choose a reason for hiding this comment

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

I forgot about the boolean value issue on yaml

@fanny-jiang fanny-jiang merged commit 3c6bc62 into main Feb 1, 2024
14 checks passed
@fanny-jiang fanny-jiang deleted the fanny/agent--adm-ctrl branch February 1, 2024 19:03
@liliyadd
Copy link
Contributor

Did we add the label in the right place? For the label to be applied to the pods managed by the deployments/daemonset, it needs to be under spec.template.metadata.labels. Setting the label under metadata.labels only applies it to the deployment/daemonset itself.

@liliyadd
Copy link
Contributor

I have created this PR that should set the label on pods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chart/datadog This issue or pull request is related to the datadog chart
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants