-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Don't render Token if it already exists #604
Comments
Hi @DanielWozniak94, Thanks for opening this issue, we have provided in #364 a workaround to avoid having this issue: #364 (comment) We will evaluate the solution that you propose with the lookup function. |
Thanks for the suggestion. However using that workaround would require placing the token as plaintext in the values file, which we version control with Git. |
To avoid plain text secret, we propose a feature in the agent call secret-backend that can be use for the token too. We provide a default secret-backend implementation that allow a reference to a token/password stored in a Kubernetes Secret. it will be something like Also I have investigated how to use lookup function. Indeed we can check if the secret already exist, and we can trigger it if we see the Please let me know if you see another approach to use the lookup function. |
Secret-backend looks promising. Our current version is 7.31.1 so I won't really be able to try the helper script until we get that upgraded. As for lookup function, thanks for checking that out. I'll see if anything comes to mind of how to get it to work. |
Hello, For reference, it's not possible to use |
Helloo @DanielWozniak94, i tried to use this code below on a new secret file, but i got some errors described in this issue #1059. At first time it worked but after some deploys i got errors. data:
{{- $secret := (lookup "v1" "Secret" "datadog" "datadog-cluster-agent-secret") | default (dict "data" (dict "token" "")) }}
{{- $token := empty $secret.data.token | ternary ((default (randAlphaNum 32) .Values.clusterAgent.token) | b64enc | quote) $secret.data.token }}
token: {{ $token }} |
The
Deploying the chart with the above patch:
And then running
NOTE: Theres still a |
Describe what happened:
When using ArgoCD together with this helm chart, whenever ArgoCD refreshes, it triggers the template to get rendered. This causes the cluster agent token secret to generate a new random token. This is fine as it doesn't break anything however it does show the Argo App to be out of sync. Would be nice to use the lookup function so that if the secret already exists it doesn't regenerate a new token.
Describe what you expected:
If the secret already exists there should be no changes to the token.
Steps to reproduce the issue:
Using the chart as is and not specifying a token in the values file.
Additional environment details (Operating System, Cloud provider, etc):
The text was updated successfully, but these errors were encountered: