kubernetes / website

Kubernetes website and documentation repo:
https://kubernetes.io
Creative Commons Attribution 4.0 International
4.47k stars 14.4k forks source link

Please enhance the section description at `tutorials/stateful-application/basic-stateful-set/#on-delete` #44713

Open drakee1990 opened 9 months ago

drakee1990 commented 9 months ago

This is a Feature Request

What would you like to be added At this section, it introduces using OnDelete by the command below.

kubectl patch statefulset web -p '{"spec":{"updateStrategy":{"type":"OnDelete"}}}'

But in the case of a server like minikube, where defaulting spec.updateStrategy.rollingUpdate field in the create step, it shows an error like this.

➜  minikube kubectl patch statefulset web -p '{"spec":{"updateStrategy":{"type":"OnDelete"}}}'
The StatefulSet "web" is invalid: spec.updateStrategy.rollingUpdate: Invalid value: apps.RollingUpdateStatefulSetStrategy{Partition:0, MaxUnavailable:(*intstr.IntOrString)(nil)}: only allowed for updateStrategy 'RollingUpdate'

Therefore I recommend to change this part like this.

//As-is
kubectl patch statefulset web -p '{"spec":{"updateStrategy":{"type":"OnDelete"}}}'
//To-be
kubectl patch statefulset web -p '{"spec":{"updateStrategy":{"type":"OnDelete","rollingUpdate":null}}}'

I think it is important because most newbie of k8s will use minikube and they can suffer from similar issues.

Comments

I referred this page for debugging this error.

AmarNathChary commented 9 months ago

/language en

AmarNathChary commented 9 months ago

Page related to the issue : https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/

sftim commented 9 months ago

Hi @drakee1990

How can we check if the change you're proposing is appropriate?

(I wonder if a different kubectl apply or kubectl patch command could leave the rollingUpdate field unspecified, in all cases).

Ritikaa96 commented 8 months ago

/triage accepted

sftim commented 8 months ago

Hi @Ritikaa96

How did you decide that the page needs a fix? I wasn't sure that it does.

Ritikaa96 commented 8 months ago

Hi @sftim , As per https://github.com/kubernetes/website/pull/42767 indicating need to revise the page and review discussion on Pr: https://github.com/kubernetes/website/pull/44730#issuecomment-1890983853 i accepted the Triage

I can definitely be wrong in case there was some pending discussion for acceptance of this issue. My great apologies in that case.

Ritikaa96 commented 8 months ago

Also when I use minikube i can replicate this and as per https://github.com/kubernetes/kubernetes/issues/100151#issuecomment-801073848 this behavior is noticed earlier, if this create confusion maybe a small note for this behaviour or the same as author mentioned can clarify this.

moralok commented 8 months ago

I encountered the same problem when I learned the tutorial using k3s.