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

Support string substitution in Helm charts #1

Open
NiklasRosenstein opened this issue Jul 31, 2024 · 1 comment
Open

Support string substitution in Helm charts #1

NiklasRosenstein opened this issue Jul 31, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@NiklasRosenstein
Copy link
Collaborator

Nyl string substitution currently only works on top-level manifests that are fed directly to Nyl. It would however be quite convenient if a Helm chart referenced by Nyl could benefit from Nyl's string substition, for example to generate random passwords to pass into a nyl.io/StatefulSecret (which can already be generated in a Helm chart).

For example:

apiVersion: nyl.io/v1
kind: StatefulSecret
metadata:
  name: argocd-admin
  namespace: argocd
stringData:
  password: ${{ bcrypt(random_password(length=24)) }}

This resource currently must live outside of any Helm chart because Helm complains about the syntax.

There are two ways to go about this:

  1. Pre-process the chart; this has the disadvantage that it's still in unstructured form so it will be tricky to run through structed-templates
  2. Post-process the chart's generated resources; however this requires escaping for Helm to not complain about the syntax
@NiklasRosenstein NiklasRosenstein added the enhancement New feature or request label Jul 31, 2024
@NiklasRosenstein
Copy link
Collaborator Author

Actually the syntax is not too ugly..

apiVersion: nyl.io/v1
kind: StatefulSecret
metadata:
  name: argocd-admin
  namespace: argocd
stringData:
  password: {{`${{ bcrypt(random_password(length=24)) }}`}}

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

No branches or pull requests

1 participant