Skip to content
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

operator v1: store NodePoolSpec in STS annotations & refactor nodePool deletion slightly #323

Merged
merged 1 commit into from
Nov 21, 2024

Commits on Nov 21, 2024

  1. operator v1: store NodePoolSpec in STS annotations

    we encountered corner cases, where it becomes extremely difficult to
    synthesize a NodePoolSpec just by looking at the StatefulSet - which is
    our fallback, if a nodePool was removed from the spec.
    AdditionalCommandlineArguments is hard to reconstruct, because we'd need
    to pull out of of the args field in the pod spec of the STS, removing
    all "other default" args - very error prone.
    
    Instead, we now store the NodePoolSpec used to create the STS in the STS
    as an annotation. This way we can always find the NodePoolSpec to create
    the (deleted) STS.
    
    In addition, we take this chance to remove small special cases for
    handling delete nodepools:
    - Do not set replicas=currentReplicas anymore. It was more of a trick.
      Instead, we now set for a deleted nodePool replicas=0, which exactly
      represents what should happen with it (scale down to zero).
    - Add check for Deleted bool in scale-down handler. It prevented
      replicas=currentReplicas being accepted as "do notthing"
      if it's a deleted nodepool. Then, the control flow would proceed and
      downscaling happens. This was not very explicit and very hard to find
      out, why downscale even works in deleted NodePools. With the refactor,
      replicas is 0, and no special case is needed for deleting anymore.
    birdayz committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    6921473 View commit details
    Browse the repository at this point in the history