influxdata / telegraf-operator

telegraf-operator helps monitor application on Kubernetes with Telegraf
Apache License 2.0
80 stars 37 forks source link

InfluxDBv2 authorization fails if docker secrets are used #135

Open alexander-zimmermann opened 9 months ago

alexander-zimmermann commented 9 months ago

Hi folks,

as soon as I switch to docker secrets (file), telegraf authorization to influx fails. If I hardcode the token into the config file, it works.

Bind-mount of docker secret is (IMO) correct:

alexander@ubuntu:~/home-automation$ docker exec -it telegraf sh
# telegraf --version
Telegraf 1.29.2 (git: HEAD@d92d7073)
# cat /run/secrets/telegraf_influxdb_token
jCSA****Ong==
# 

Relevant parts of telegraf config:

# Secret-store to access Docker Secrets
[[secretstores.docker]]
  ## Unique identifier for the secretstore.
  ## This id can later be used in plugins to reference the secrets
  ## in this secret-store via @{<id>:<secret_key>} (mandatory)
  id = "docker_secretstore"

and

# Configuration for sending metrics to InfluxDB 2.0
[[outputs.influxdb_v2]]
  urls = ["http://influx.zimmermann.XXX:8086"]
  token = "@{docker_secretstore:telegraf_influxdb_token}"
  #token = "jCSA****Ong=="
  organization = "zimmermann.XXX"
  bucket = "telegraf/autogen"

Any idea?

alexander-zimmermann commented 9 months ago

Please close the issue. I didn't realize that I was in the wrong repo