Skip to content

Add simple example of before/after reboot annotations #168

@invidian

Description

@invidian

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:

  • 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions