-
Notifications
You must be signed in to change notification settings - Fork 115
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 draining DaemonSet pods using sriov devices #840
base: master
Are you sure you want to change the base?
Conversation
Thanks for your PR,
To skip the vendors CIs, Maintainers can use one of:
|
Pull Request Test Coverage Report for Build 13370907002Details
💛 - Coveralls |
pkg/drain/drainer.go
Outdated
// remove pods that are owned by a DaemonSet and use SR-IOV devices | ||
dsPodsList := getDsPodsToRemove(podList) | ||
for _, pod := range dsPodsList { | ||
err = d.kubeClient.CoreV1().Pods(pod.Namespace).Delete(ctx, pod.Name, metav1.DeleteOptions{}) |
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.
Shouldn't we block? Waiting to ensure that the pod is fully removed before continuing? A pod that's slow to delete might cause a race condition
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.
yes I switch to use the drain from the kubernetes drain helper it does that :)
2140f89
to
c20fba0
Compare
pkg/drain/drainer.go
Outdated
|
||
// on full drain there is no need to try and remove pods that are owned by DaemonSets | ||
// as we are going to reboot the node in any case. | ||
if fullNodeDrain { |
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.
do we care ? (just thinking how to simplify) why not always remove DS pods from node IF they have sriov resources ?
with this commit we also take care of removing daemonset owned pods using sriov devices. we only do it when drain is requested we don't do it for reboot requests Signed-off-by: Sebastian Sch <[email protected]>
c20fba0
to
cd2fb78
Compare
@@ -2376,6 +2538,18 @@ func waitForPodRunning(p *corev1.Pod) *corev1.Pod { | |||
return ret | |||
} | |||
|
|||
func waitForDaemonReady(d *appsv1.DaemonSet) *appsv1.DaemonSet { |
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.
nit: waitForDaemonSetReady
reqLogger.Info("drainNode(): Draining failed, retrying", "error", err) | ||
return false, nil | ||
|
||
err = d.removeDaemonSetsFromNode(ctx, node.Name) |
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.
I'm not entirely clear on how this works. I understand the process of selecting and removing DS pods, but I'm unsure how we prevent the DS controller from restarting pods on the node we intend to drain. Could you clarify?
with this commit we also take care of removing DaemonSet owned pods using sriov devices.
we only do it when drain is requested we don't do it for reboot requests