We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently, in OpenBao's Helm chart, extraEnvironmentVars are evaluated before extraSecretEnvironmentVars as seen in the StatefulSet template:
extraEnvironmentVars
extraSecretEnvironmentVars
https://github.com/openbao/openbao-helm/blob/main/charts/openbao/templates/server-statefulset.yaml#L141-L142
{{- include "openbao.extraEnvironmentVars" .Values.server | nindent 12 }} {{- include "openbao.extraSecretEnvironmentVars" .Values.server | nindent 12 }}
However, it would be better to include extraSecretEnvironmentVars first, allowing extraEnvironmentVars to reference them for variable substitution.
If the following configuration is defined in values.yaml openbao.server section:
values.yaml
openbao.server
extraSecretEnvironmentVars: - envName: PG_OB_USERNAME secretName: openbao-pg-secret secretKey: username - envName: PG_OB_PASSWORD secretName: openbao-pg-secret secretKey: password - envName: PG_OB_DATABASE secretName: openbao-pg-secret secretKey: dbname extraEnvironmentVars: BAO_PG_CONNECTION_URL: "postgresql://$(PG_OB_USERNAME):$(PG_OB_PASSWORD)@postgres.$(BAO_K8S_NAMESPACE).svc.cluster.local:5432/$(PG_OB_DATABASE)?sslmode=disable"
Since extraEnvironmentVars are evaluated before extraSecretEnvironmentVars, variable substitution does not occur for BAO_PG_CONNECTION_URL.
BAO_PG_CONNECTION_URL
Reversing the order of inclusion in the StatefulSet template:
{{- include "openbao.extraSecretEnvironmentVars" .Values.server | nindent 12 }} {{- include "openbao.extraEnvironmentVars" .Values.server | nindent 12 }}
This change provides greater flexibility, allowing extraEnvironmentVars to reference environment variables derived from secrets.
for my use-case i know we can directly have postgresql connection-string in the secret instead to make it work.
However, modifying the order of evaluation offers a more general and flexible approach, benefiting other use cases as well.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Currently, in OpenBao's Helm chart,
extraEnvironmentVars
are evaluated beforeextraSecretEnvironmentVars
as seen in the StatefulSet template:https://github.com/openbao/openbao-helm/blob/main/charts/openbao/templates/server-statefulset.yaml#L141-L142
However, it would be better to include
extraSecretEnvironmentVars
first, allowingextraEnvironmentVars
to reference them for variable substitution.Example Problem:
If the following configuration is defined in
values.yaml
openbao.server
section:Since
extraEnvironmentVars
are evaluated beforeextraSecretEnvironmentVars
, variable substitution does not occur forBAO_PG_CONNECTION_URL
.Suggested Improvement:
Reversing the order of inclusion in the StatefulSet template:
This change provides greater flexibility, allowing
extraEnvironmentVars
to reference environment variables derived from secrets.for my use-case i know we can directly have postgresql connection-string in the secret instead to make it work.
However, modifying the order of evaluation offers a more general and flexible approach, benefiting other use cases as well.
The text was updated successfully, but these errors were encountered: