kubernetes / website

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

[Unclear] example: Deploying Cassandra with a StatefulSet #47039

Closed brianjester closed 2 months ago

brianjester commented 3 months ago

When running this command:

grace=$(kubectl get pod cassandra-0 -o=jsonpath='{.spec.terminationGracePeriodSeconds}') \
  && kubectl delete statefulset -l app=cassandra \
  && echo "Sleeping ${grace} seconds" 1>&2 \
  && sleep $grace \
  && kubectl delete persistentvolumeclaim -l app=cassandra

The grace period it was going to sleep was 1800s (30m), so after all resources were deleted (about 5-6s), I hit Ctrl-C, then manually ran the line after the sleep:

kubectl delete persistentvolumeclaim -l app=cassandra

Recommend adding a note to avoid having the student wait 30m for a command to finish that might only take a few seconds.

T-Lakshmi commented 3 months ago

Related page: https://kubernetes.io/docs/tutorials/stateful-application/cassandra/#cleaning-up /language en

sftim commented 3 months ago

I think we can improve the advice, or change the grace period to be quite a bit shorter. Not sure which is better.

sftim commented 3 months ago

/triage accepted either way

sftim commented 3 months ago

/retitle [Unclear] example: Deploying Cassandra with a StatefulSet

thisisharrsh commented 3 months ago

change the grace period to be quite a bit shorter

I have tried to reproduce the issue with a grace period of 300 seconds. And I observed that all my related resources were deleted in under 10 seconds.
It will be better if we reduce the terminationGracePeriodSeconds: 1800 to some shorter value like 300 or 500.

thisisharrsh commented 3 months ago

I would like to work on this issue.

/assign /sig apps /sig storage

abhilasha2418 commented 3 months ago

/assign