Closed andyy5 closed 4 years ago
/set title: Feature request: Expose Node IP within function container
Thanks for your suggestion. This does seem like an edge-case, but would you like to spend some time looking into possible solutions and report back?
@alexellis some options:
YAML
pod_info:
my_env1: status.podIP
my_env2: status.hostIP
my_env3: spec.serviceAccountName
my_env4: spec.nodeName
REST API
"podInfo": {
"my_env1": "status.hostIP"
...
}
YAML
environment:
my_env: status.hostIP
REST API
"envVars": {
"my_env": "status.hostIP"
}
The setup sounds like the Data dog agent is running as a daemon set and you want to specify that it talk to the replica on the same host.
The simplest fastest fix is to define a Service for your daemon set and then reference it by name instead of the node ip. I have done this with Jaeger tracing and haven't had any issues with it so far.
The idea of adding special env values is interesting, it seems like something we could even partially standardize between k8s, faas-swarm, and faasd
I would agree with @LucasRoesler here, adding a service would make more sense, or some kind of proxy that you can deploy and use instead.
Thanks for the help
Expected Behaviour
I'm trying to send datadog traces from my function to my datadog agent.
For the function, I need to set the environment variable
DD_AGENT_HOST
to the node's IP, like this:But based on the docs and code, it seems like this is not supported?
I'm wondering if there is any workaround that can help me here.
Current Behaviour
Not implemented
Possible Solution
Steps to Reproduce (for bugs)
1. 2. 3. 4.
Context
I'm trying to send datadog traces from my function to my datadog agent and need to set the function's environment variable
DD_AGENT_HOST
to the node's IP.Your Environment
FaaS-CLI version ( Full output from:
faas-cli version
): latestDocker version
docker version
(e.g. Docker 17.0.05 ): latestWhat version and distriubtion of Kubernetes are you using?
kubectl version
latestOperating System and version (e.g. Linux, Windows, MacOS): linux, 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