-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[rabbitmq] Don't Regenerate the Password #3094
Comments
1) A persistent rabbitmq secret that is not reset after every deploy (see bitnami/charts#3094 ) 2) Enable rolling pod deployments on upgrades 3) Disable analytics in the sample deployment
1) A persistent rabbitmq secret that is not reset after every deploy (see bitnami/charts#3094 ) 2) Enable rolling pod deployments on upgrades 3) Disable analytics in the sample deployment
Hi @kferrone, Thanks very much for your issue! When upgrading the application, the old values for passwords must be provided to ensure they are not altered. For further details on this, the process is described in the Upgrading section of README.md. We are currently working on improving this behaviour, analysing and evaluating alternatives on what is the best way to tackle this problem. Thank you very much for your proposal, we will take it into account when implementing changes. Thanks! |
I have made plenty of charts where the following works just fine: annotations:
"helm.sh/hook": pre-install
"helm.sh/resource-policy": no-upgrade-existing Then no secrets are changed after an update. If anything at least allow us to add our own annotations to the secret. For example in the values file you could have something like: secretAnnotations: {} Then I can do the following in my values.yaml: secretAnnotations:
annotations:
"helm.sh/hook": pre-install
"helm.sh/resource-policy": no-upgrade-existing This way I can use the built in Helm feature for handling generated secrets. |
Hi @kferrone I am interested in this alternative, but have been investigating about the I might be wrong, but it would be bizarre using an annotation by default that is not officially supported by helm itself. Do you by any chance have more information about it? Thanks! |
Here is what I found for reference: https://github.com/helm/helm/pull/5290/files I can't seem to find much about the Either way, I do know with I agree defaulting any of these annotations without proper testing and discussion is not desired. However, I'm extremely confident in what I need to do, please allow users to add their own arbitrary annotations. Currently rabbitmq chart already supports arbitrary annotations on the following:
In the values simply add a section to add arbitrary annotations to the secret. secretAnnotations: {} In my values.yaml; I'll just overkill it to guarantee the secret won't change. secretAnnotations:
"helm.sh/hook": pre-install
"helm.sh/resource-policy": keep Here is the needed source code in the secrets.yaml in the templates apiVersion: v1
kind: Secret
metadata:
name: {{ include "rabbitmq.fullname" . }}
namespace: {{ .Release.Namespace }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
annotations: {{ toYaml .Values.secretAnnotations | nindent 4 }} |
Hi @kferrone It is true that rabbitmq chart already supports arbitrary annotations on several resources. However, the annotations you plan to use are Thanks for your issue! |
Hi again @kferrone , My apologies for the delay. As I have already mentioned, we are actively discussing on how to overcome this problem and the conversation has veered towards a common implementation for all charts, in which we are currently working on PR #3150 . I think this way we can preserve a common approach in all our solutions and the issue should be gone as well. |
It's my experience that the password cannot be changed, because the PVC seems to store it and not let go unless I uninstall and manually delete the PVC. Is this part of the same issue, do you think? |
Hey @lindhe , That is totally right. The issue comes from the fact that the configuration is persisted in PVC, including credentials for access. Hence, if you were to change the values for them in an already deployed environment, there will be a mismatch between the current and persisted values, resulting in an authentication failure. More on this in #2805 (comment) |
Thanks for the info! For me, that's not a big issue. The big issue in my eyes is that it persists even across deployments. So if I |
You're welcome @lindhe , If you are using helm to perform the installation, you should either provide a release name or generate a random one. There should not be any problems as long as they are different releases. In the case of same-named releases, you should in theory watch out for existing PVCs. I say in theory because I have tried to perform a |
This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback. |
Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary. |
This is still a thing that would be nice to have fixed. All #3150 did was make the upgrade fail-safe if the existing secret's data was not included, but I don't see any discussion there about instead marking such secrets as not modified by Helm upgrades. as they cannot safely be changed be upgrades, per #2805 (comment). Sadly, the I'm unaware of any other way to work-around this in Helm, although there was a suggestion on how to make it work as long as you don't try to change the password during an upgrade (moving from random to specified) which seems to be a failure case here anyway, as the secret ends up in a PVC. |
Hi @TBBle , AFAIK there is no easy or straightforward solution to this. The current implementation does indeed have a similar behaviour to the suggestion you point out. Both approaches allow the Chart to be upgraded with no errors, but our solution also serves as a standardized fail-safe method for all our charts, that informs the user of the situation. Hence, I might be wrong but I think the final objective is achieved anyways. Thanks! |
Which chart:
RabbitMQ 7.5.3
Describe the bug
If you update the chart the the password in the secret will regenerate and cause RabbitMQ to end up in an infinite crashloop.
To Reproduce
Steps to reproduce the behavior:
auth.password
empty in the valuesExpected behavior
Leave the password and erlang cookie alone when updating.
Version of Helm and Kubernetes:
helm version
:kubectl version
:Additional context
All you need to do to solve this issue is add the following annotation to the secret in this file
The text was updated successfully, but these errors were encountered: