-
Notifications
You must be signed in to change notification settings - Fork 16.7k
[stable/mariadb] stateful sets break with Helm v3 #19231
Comments
I guess you're talking about this tool: https://github.com/helm/helm-2to3
You're 100% right! We need to find a way to support upgrading from releases that were moved from helm2 to helm3. I guess we could use something like this as a workaround: $ kubectl patch statefulset my-release-mariadb-master --type=json -p='[{"op": "remove", "path": "/spec/selector/matchLabels/heritage"}]'
$ kubectl patch statefulset my-release-mariadb-slave --type=json -p='[{"op": "remove", "path": "/spec/selector/matchLabels/heritage"}]'
...
$ helm upgrade my-release ... @carrodher @javsalgar @tompizmor what do you think? |
I was about to submit another ticket when I saw this one. Here are concrete steps to reproduce:
The last step gives the error:
|
Thanks for sharing the exact steps to reproduce the issue @floretan |
I tried the patch above, but the problem is actually the label on the statefulset's volumeClaimTemplates, not the label of the statefulset itself. I updated the path command to match, but the operation is not permitted:
I see two options, both of which are not really ideal:
|
FYI, this issue also affects the redis chart.
|
Oh crap... You're right. Probably you need to use new PVCs and clone the content of the old PVs (https://kubernetes.io/blog/2019/06/21/introducing-volume-cloning-alpha-for-kubernetes/) so you don't lose the data.
This issue affects almost every chart in the stable repo (since they were meant to be installed with Helm 2 when they were created) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any further update will cause the issue/pull request to no longer be considered stale. Thank you for your contributions. |
Do not stale |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any further update will cause the issue/pull request to no longer be considered stale. Thank you for your contributions. |
We have the same problems in all our clusters. isn't there a less painfull way (then cloning hundreds of PVC's) to solve this problem? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any further update will cause the issue/pull request to no longer be considered stale. Thank you for your contributions. |
Hi, Given the In this issue, we tried to explain more carefully the reasons and motivations behind this transition, please don't hesitate to add a comment in this issue if you have any question related to the migration itself. Regards, |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any further update will cause the issue/pull request to no longer be considered stale. Thank you for your contributions. |
This issue is being automatically closed due to inactivity. |
Has anyone found a viable workaround for this issue? |
I wrote a little script that replaced all statefulsets without dropping the pv(c)'s: `# ------------------- README ---------------------- Fix Helm2 statefulsets for Helm3 usage-------------------------------------------------app='app-name' NAMESPACES_RAW="$(kubectl get namespaces --output=custom-columns=HEADER:.metadata.name)" for ns in "${array[@]}" |
Describe the bug
After using helm 2to3 to migrate a release to helm v3 we encountered an issue with the StatefulSets in MariaDB. Labels added to the volumeClaimTemplate include a k-v pair for "Heritage". In Helm v2 this resolved to "Tiller" but in Helm v3 it now resolves to "Helm". This blocks our ability to upgrade because some of these key fields in a StaefulSet are meant to be immutable.
e.g.
charts/stable/mariadb/templates/master-statefulset.yaml
Line 259 in c583863
Version of Helm and Kubernetes:
Kubernetes 1.14.8
Helm 3.0.0
Which chart:
https://github.com/helm/charts/tree/master/stable/mariadb
What happened:
Upgrades now fail because of the Heritage label in the volumeClaimTemplate.
What you expected to happen:
No release name changes occured so it is expected that the Helm release with the Stateful sets can be upgraded.
How to reproduce it (as minimally and precisely as possible):
See above. This may affect other charts using Stateful sets.
Anything else we need to know:
I don't know of a work-around apart from migrating to a new DB.
The text was updated successfully, but these errors were encountered: