You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use an agent Service Account so hook has appropriate permissions to update the Node object.
Use shell + kubectl to be able to write some simple logic for annotating nodes. Something like this should be possible: while true; do kubectl annotate node $NODENAME --overwrite=true has-attached-volumes=$(if [ $(kubectl get volumeattachment | grep $NODENAME | wc -l) -gt 0 ]; then echo true; else echo false; fi); sleep 30; done (to workaround Ensure update-agent waits for all volumes to be detached before rebooting #30).
The text was updated successfully, but these errors were encountered:
We have e.g. https://github.com/flatcar-linux/flatcar-linux-update-operator/blob/53f08043e320c853940ed7b4c126c7b72af1af00/examples/reboot-annotations/after-reboot-daemonset.yaml right now, but it only annotates the node right away, which is not very useful, as it does not allow implementing any logic.
We should change those to:
while true; do kubectl annotate node $NODENAME --overwrite=true has-attached-volumes=$(if [ $(kubectl get volumeattachment | grep $NODENAME | wc -l) -gt 0 ]; then echo true; else echo false; fi); sleep 30; done
(to workaround Ensure update-agent waits for all volumes to be detached before rebooting #30).The text was updated successfully, but these errors were encountered: