Skip to content
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

[Telegraf] Proper way to use envFromSecret #629

Open
SpontaneousDuck opened this issue Mar 9, 2024 · 0 comments
Open

[Telegraf] Proper way to use envFromSecret #629

SpontaneousDuck opened this issue Mar 9, 2024 · 0 comments

Comments

@SpontaneousDuck
Copy link

I am trying to use the envFromSecret to pass K8s secrets that are shared with InfluxDB to allow Telegraf to push to InfluxDB. The secrets have dashes in them which does not seem to parse properly in the config file. For example, my secret key is named user-token. I use the below output:

outputs:
  - influxdb_v2:
    urls:
      - "http://influxdb-influxdb2:80"
    bucket: "default"
    organization: "influxdata"
    token: $user-token

It appears that $admin-token does not parse correctly and I get 401 errors in Telegraf. I can hach=k around this by passing the secret as an env variable:

- name: INFLUXDB_USER_TOKEN
    valueFrom:
      secretKeyRef:
        name: influxdb-influxdb2-auth
        key: user-token 

Is this the expected way to do this or is there some other way I can use the envFromSecret to get a secret in the config with a dash?

Thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant