influxdata / influxdata/helm-charts
Allow templating in `adminUser.existingSecret`.
- Dominant language
- Mustache
- Stars
- 257
- Forks
- 347
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 9
Description
When defining templates I generally prepend the release name to avoid collisions between separate releases. For example, I might store the admin configuration in a `Secret` like so:
```yaml
apiVersion: v1
kind: Secret
metadata:
name: {{ .Release.Name }}-secret
data:
admin-user: {{ "admin" | b64enc }}
admin-password: {{ .Values.adminPassword | b64enc }}
admin-token: {{ .Values.adminToken | b64enc }}
```
If I wanted to use this Secret to configure a Grafana instance, I would be able to use a template string in my `values.yaml` file by setting `grafana.admin.existingSecret` to `"{{ .Release.Name }}-secret"`, which is passed through Helm's `tpl` function[^grafana-impl] to convert it into the name of my secret.
Conversely, InfluxDB2's current `StatefulSet` template interprets the value of `adminUser.existingSecret` as a basic string, preventing this method of configuring secrets from being used[^current-impl]. If no existing secret is specified, the chart automatically creates a value with the release name prepended.
It would be helpful to enable the use of templates in this value. I could create a PR for this feature if is an acceptable change.
[^current-impl]: https://github.com/influxdata/helm-charts/blob/4e72f9d0ec83fec5b9146cf14519affa98831a6c/charts/influxdb2/templates/statefulset.yaml#L75C34-L75C34
[^grafana-impl]: https://github.com/grafana/helm-charts/blob/509110216d813ec4111822192d428624971bbc07/charts/grafana/templates/_pod.tpl#L292
Contributor guide
Assessment
This issue has not been assessed yet.