-
Notifications
You must be signed in to change notification settings - Fork 88
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
Allow basicAuth username/password to be sourced from secrets #81
Comments
I second this feature request, seems like a trivial thing to do any updates? Basically the implementation can look similar to how this opencost helm-chart handles it: https://github.com/opencost/opencost-helm-chart/blob/main/charts/opencost/values.yaml#L147 So by referencing "secret_name", "username_key", "password_key" |
Would #47 help? |
I dont think so #47 seems to only make secret creation optional, how would we pass the reference to the pre-existing secret than, but maybe I am missing something? |
Yes, I see. #47 I assumes that you would create the secret named as |
#47 does help. Its fine for me if the names are mandated, though some flexibility would be nice. The only quibble I would have is that in most charts I have seen "createX" means "create this resource as part of installing helm and generate the values for me randomly". For charts using "existing" secrets, conf names tend to be more along the lines of "existingSecret", etc... As @skl says though, other parts of the chart that are conditional based on username/password being non-empty do need to be addressed. |
Yes , this will be a useful feature. Our use case is -terraform to deploy helm charts in kubernetes and we use CSI driver secrets in kubernetes. With the current approach the only way we can pass the secret is using the data source in terraform. |
In addition to this change, can this chart be updated to support extraObjects? This would enable SealedSecrets or ExternalSecrets to be created with the Helm deployment. |
As a workaround, I have created a new secret that is in the format of
We are using ExternalSecrets and AWS SSM Parameters, so I create the secret with this:
An easier way to do this would be welcome. |
Hello everybody! I really would love to get a user-friendly and intuitive approach for this in the chart. It really is top of mind. I am waiting for the Grafana Agent squad to merge in this: grafana/agent#4854 When that makes it to an official release, this is going to be the plan: In the default case:
The values file adds these options:
And likewise for Loki and Tempo services. That would allow for:
|
The grafana agent issue has been fixed and a release has been created. @petewall can this be implemented now? |
Nearly there. I'm polishing up the PR and waiting for a new Helm chart release from the Agent team. |
Hello @petewall , is there any update on this? We would love to start using this chart but we are currently hindered because of the need of checking in credentials to our code. |
Yes! This is coming. While implementing the change, I ran into an issue with the way that the Grafana Agent accesses elements in the secrets or configmaps. Thank you for your patience! |
Sounds good @petewall , thank you for your efforts! |
This is now released in https://github.com/grafana/k8s-monitoring-helm/releases/tag/v0.5.0! |
Tried it and my first experiences:
The final solution I went with is to disable secrets creation in the helm chart completely and opt for the three fields being sourced, the only downside I can see from this is I've had to put an inline comment on the values file that the hostname in the chart values isn't used, but is necessary to pass the checks in the helm template. Other than these niggles caused by ArgoCD and External Secrets operator, it's all working as expected now! I can just source one set of secrets from a single source of truth and spawn multiple clusters inconsequentially. |
Thank you @petewall, this is working well! Can we also get support for extraObjects? This would help to create the secrets using ExternalSecrets or SealedSecrets. I can submit a PR for it if you like. |
Thank you very much @petewall , it works well! I'm deploying this to AKS synching secrets from Azure Key Vaults using akv2k8s. I wrote a post about how I did it here: https://mischavandenburg.com/zet/grafana-agent-with-custom-secrets-akv2k8s/ Although this might have been a slight bug during the first iterations of this chart, I did run into the following error in my first attempts. The logs of the Grafana Agent showed: unsupported protocol scheme \"\"" After a lot of debugging I decided to completely rebuild the deployment from scratch, and then I found out that I had put the externalServices.prometheus and externalServices.secret objects in a different order which maybe interfered with the rest of the values file somehow. |
This is complete now, so closing this issue. |
This change added a bug where if the This sends the grafana-agent pods in a crashloop:
I managed to work around this by adding a |
We use terraform to control the configuration of this helm chart and it means that we have to check the raw username and password values into our terraform source code, which is a very bad practice. It would be much safer and cleaner if we had the option of using values from regular kubernetes secrets which can be managed in a much more secure way.
The text was updated successfully, but these errors were encountered: