-
Notifications
You must be signed in to change notification settings - Fork 476
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
How to get DD_AGENT_HOST for functions for the Datadog agent? #913
Comments
Yes, I think these are basically the same issue, however it looked like it was discussing different ways to solve this issue than what k8s would say to do in the first place. To me, this is a simple API issue; it's opt-in on my end, OpenFaaS just doesn't support the feature. I use the I don't see any real reason why something that's completely opt-in would be omitted, outside of "nobody has asked for it yet". If you look up this issue in k8s docs, there is basically 1 question and exactly 1 answer, and |
We talked about this on the office hours call today. Under "Enabling DogStatsD and APM" on this blog post https://blog.porter.run/datadog-and-kubernetes/ - there seems to be a an admissions controller that can automate this. It would be worth trying that out and seeing if the openfaas operator would fight with it? Another option may be for openfaas pro users to have an additional option to only populate host_ip into one or more environment variables |
I enabled the admission controller in the DataDog helm chart, and this environment variable is now being injected into function pods. Function pods definitions do not appear to be being fought over with these injections. |
I'm going to close this issue because it was more about a specific way to get DD_AGENT_HOST working with Datadog, than a generic need for secrets in environment variables. |
/lock: resolved |
/set title: How to get DD_AGENT_HOST for functions for the Datadog agent? |
The function CRD has a flatmap of strings for environment variables, but for certain things like needing the host IP, you need to use
valueFrom
, not justvalue
.Expected Behaviour
You should be able to set environment variables that can use
valueFrom
, like any other pod.Current Behaviour
You can't use it.
Are you a GitHub Sponsor (Yes/No?)
Check at: https://github.com/sponsors/openfaas
List All Possible Solutions and Workarounds
Either change the existing API to support
valueFrom
, or make a newenvironmentFrom
which looks something like:Alternatively, you could just bake this environment variable in by default (with a different name, obviously). Seems brittle though.
Which Solution Do You Recommend?
I don't use the environment variable references like this very often, and I mostly just care that it works.
Steps to Reproduce (for bugs)
Context
Trying to tell my datadog tracer & profiler on my function pod where the datadog agent lives, and can't easily because OF does not support the use case with their CRD.
Your Environment
FaaS-CLI version ( Full output from:
faas-cli version
):Docker version
docker version
(e.g. Docker 17.0.05 ):What version and distriubtion of Kubernetes are you using?
kubectl version
Operating System and version (e.g. Linux, Windows, MacOS):
Link to your project or a code example to reproduce issue:
What network driver are you using and what CIDR? i.e. Weave net / Flannel
The text was updated successfully, but these errors were encountered: