-
Notifications
You must be signed in to change notification settings - Fork 116
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
Support restart task for StatefulSet with updateStrategy: OnDelete #840
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to bump krane version as as well.
def delete_statefulset_pods(record) | ||
pods = kubeclient.get_pods(namespace: record.metadata.namespace) | ||
pods.select! do |pod| | ||
pod.metadata.ownerReferences.find { |ref| ref.uid == record.metadata.uid } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is record.metadata.uid
something that identifies individual statefulsets?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It uniquely identifies the resource throughout the lifetime of the cluster. That is, no 2 resources in a cluster will ever have the same UID
CI is showing a flaky error that I want to get to the bottom of before merging this. It appears it can treat the restart as successful even if multiple replicas of the statefulset have not yet reached the desired level |
Hey @timothysmith0609! Any updates on this PR? |
abd2e52
to
2719707
Compare
I completely forgot this PR existed. I just rebased on latest master and will see what the state of that CI flakiness is |
This is flaky due to transparently returning |
@peiranliushop are you ok with the change I made in c8cea8d? |
Definitely 👍. We expect pods to come up healthy shortly after they're deleted in this particular deploy strategy |
This is a little nuanced, actually. When deploying, |
Ah yes. In our case, the way we plan to use the feature is to run a |
🤦 I forgot the pods would be named the same even after being deleted. I'll fix this tomorrow and get the tests passing before merging |
Ah true. You can probably just swap name for UID; that ought to fix it. |
Builds on #836 by handling the special case of a StatefulSet having
updatStrategy: OnDelete
. In this case, we need to find all pods with an owner reference to the targeted StatefulSet: this is accomplished using the UID of the StatefulSet.More info on owner references can be found here.