influxdata / influxdata/helm-charts
[Telegraf] Proper way to use envFromSecret
- Dominant language
- Mustache
- Stars
- 257
- Forks
- 347
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 9
Description
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!
Contributor guide
Research direction
Start by reproducing the reported `envFromSecret` configuration with a Kubernetes secret key containing a dash, using the examples in the issue. Check how the Helm chart renders the Telegraf configuration and how Telegraf expands the resulting variable; done means determining whether dashed secret keys are supported and documenting or correcting the supported configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- helm, kubernetes
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100