Statefulset image upgrade forbidden?


I was trying to upgrade a statefulset workload and its giving the following error. Arent we able to upgrade images of all set of objects ? Or is it normal?

Validation failed in API: StatefulSet.apps “elasticsearch-0” is invalid: spec: Forbidden: updates to statefulset spec for fields other than ‘replicas’, ‘template’, and ‘updateStrategy’ are forbidden.


@Listener_me, Are you still working with this. If so I’d be happy to help. That error you’re getting is coming from Kubernetes. Apparently we’re violating the statefulset API spec. I’ll look into this, you may have found a bug.

I am still trying to figure out the issue. If I change it to depoyment instead of statefulset, it will work. But I want to use the advantage of having statefulset including the names of pods and stuffs. It would be great if you can help. I am using rancher version 2.1.1

How are you doing this update?

I get this error for example when I run 'kubectl edit ’ because those fields cannot be modified ‘dynamically’ like this.

I usually just update the original yaml file (or exported copy), run ‘kubectl apply -f’ and it updates fine.

@Marc_Matthys, rancher is there to do everything through UI right? So is there a way to do an image upgrade(using rancher) for an existing statefulset, that is the question

@JasonvanBrackel, any idea?

@vincent , do you have some comment on this?

Any updates on this? how is everyone doing it at the moment?

@JasonvanBrackel this seems like a bug to me. I am both able to “patch” using the command line and also “edit the YAML” and both ways i can edit the statefulset (image, env) etc… even when a volumeClaimTemplate is involved, so i’m guessing when rancher is saving via the normal GUI fields is trying also to change something on volumeClaimTemplate and therefore not letting you edit anything else. I would expect just the volumeClaimTemplate part to not be editable but still be able to edit anything else like image and env etc…

I’ll look into it. Thanks for the feedback. Must be something we’re doing in the API that’s different than what kubectl is doing.