-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add DD_AGENT_IPC_* env vars #1661
base: main
Are you sure you want to change the base?
Conversation
This PR adds DD_AGENT_IPC_PORT and DD_AGENT_IPC_CONFIG_REFRESH_INTERVAL env vars in otel agent and core agent. It does not override them if they are added by the user. This is necessary for the otel-agent to pull the api key from core config in the case where backend secrets are used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please consider adding test like this to make sure chart doesn't break and it works as intended.
@@ -59,6 +59,38 @@ | |||
{{- include "containers-common-env" . | nindent 4 }} | |||
{{- include "fips-envvar" . | nindent 4 }} | |||
{{- include "processes-common-envs" . | nindent 4 }} | |||
{{- if eq (include "should-enable-otel-agent" .) "true" }} | |||
{{- $found := false }} | |||
{{- range .Values.agents.containers.agent.env }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you extract the $found
computation to _helpers.tpl
? like this e.g.:
helm-charts/charts/datadog/templates/_helpers.tpl
Lines 992 to 1001 in 788d28d
{{/* | |
Return value of "DD_PROCESS_CONFIG_RUN_IN_CORE_AGENT_ENABLED" env var in core agent container. | |
*/}} | |
{{- define "get-process-checks-in-core-agent-envvar" -}} | |
{{- range .Values.agents.containers.agent.env -}} | |
{{- if eq .name "DD_PROCESS_CONFIG_RUN_IN_CORE_AGENT_ENABLED" -}} | |
{{- .value -}} | |
{{- end -}} | |
{{- end -}} | |
{{- end -}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved logic to helpers in: 267473a.
{{- end }} | ||
{{- $found := false }} | ||
{{- range .Values.agents.containers.agent.env }} | ||
{{- if eq .name "DD_AGENT_IPC_CONFIG_REFRESH_INTERVAL" }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see this or DD_AGENT_IPC_PORT
used elsewhere in the chart, do we expect them to be added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Youre right, we dont set this in helm charts. This is to make sure we don't override it if the user sets it in datadog.env
, Values.agents.containers.agent.env
or Values.agents.containers.otelAgent.env
.
Thanks for the review @levan-m, I've addressed the feedback and added a test in: a20b97c. Unfortunately, it seems like I am unable to test the option to not override user provided env vars, as setting something like:
in the test cases does not reflect these env vars in the test results, so I am guessing this gets done at another stage ? I've tested this manually in a test k8s cluster, and the not override logic is taken into account, I'm just not able to test this programatically. I was getting the same issue in not being able to test that we don't override in the operator PR: DataDog/datadog-operator#1604 (comment). |
What this PR does / why we need it:
This PR adds DD_AGENT_IPC_PORT and DD_AGENT_IPC_CONFIG_REFRESH_INTERVAL env vars in otel agent and core agent. It does not override them if they are added by the user. This is necessary for the otel-agent to pull the api key from core config in the case where backend secrets are used.
This PR also adds flag
--sync-delay=30s
to otel agent.Which issue this PR fixes
OTEL-2323
Special notes for your reviewer:
Checklist
[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]
.github/helm-docs.sh
)CHANGELOG.md
has been updatedREADME.md
make update-test-baselines
)