thanos-io / kube-thanos

Kubernetes specific configuration for deploying Thanos.
Apache License 2.0
520 stars 177 forks source link

Add HOST_IP_ADDRESS env to all containers #219

Closed brancz closed 3 years ago

brancz commented 3 years ago

It is not uncommon to deploy tracing agents as daemonsets on every node. The way the tracing libraries are then configured is typically by configuring an environment variable via the Kubernetes downward API. It seems paradox to force this onto downstream users, when the tracing config is already available.

Since it is not harmful to users that don't use this environment variable, I propose we automatically add the HOST_IP_ADDRESS environment variable to each Thanos component container, so that for example for tracing purposes the environment variable can be used directly.

cc @metalmatze @kakkoyun

metalmatze commented 3 years ago

Yup, sounds good as it doesn't hurt, might be slightly confusing but whatever... Do you have an example on what we need to add? Or are you asking for consensus to simply add it?

brancz commented 3 years ago

Yeah it's pretty straight forward, just:

    env:                 
    - name: HOST_IP_ADDRESS
      valueFrom:         
        fieldRef:         
          apiVersion: v1                                                                                               
          fieldPath: status.hostIP  

in each container

brancz commented 3 years ago

Alright, seems like there is no strong objection. I'll make sure to leave a comment in the code that explains why it's there.

kakkoyun commented 3 years ago

Yes, sounds good to me. There's no harm in having this.