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

MGMT-8571: Deploy the image service as a stateful set #3067

Merged

Commits on Mar 8, 2022

  1. Configuration menu
    Copy the full SHA
    65716b5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bf8f1a5 View commit details
    Browse the repository at this point in the history
  3. MGMT-8571: Refactor monitoring into a separate method

    This also stops trying to monitor the image service as a deployment and
    reduces the number of `Get` calls by only fetching each deployment once
    per loop rather than re-fetching it for each condition we want to check.
    carbonin committed Mar 8, 2022
    Configuration menu
    Copy the full SHA
    2769682 View commit details
    Browse the repository at this point in the history
  4. MGMT-8571: Deploy the image service as a stateful set

    Previously, when deploying the image service as a deployment, we were
    writing the template images to the pod filesystem. This isn't good for
    performance or the health of the node we're running on.
    
    Because of this the image service now will run as a stateful set and
    request a PV for the data directory. If information for a new PVC has
    been provided in the agentserviceconfig. If no PVC information was
    provided an emptydir volume is used.
    
    Changing the storage template of a stateful set requires that we delete
    and recreate the entire statefulset. This means that, in this case, we
    can't use controllerutil.CreateOrUpdate.
    
    This commit creates a separate function to reconcile just this
    statefulset which has a section very similar to create or update but with
    some additional logic around when we can do a normal update and when we
    need to recreate the statefulset.
    
    This also adds some logic to remove the old image service deployment.
    This is required for upgrade. Note the specific error handling which
    ensures that we only delete the deployment if we successfully
    reconciled (created, most likely) the statefulset to replace it.
    
    A finalizer is added to the statefulset to ensure we remove the PVC as
    we need to support resizing the volume which will mean claiming a new
    PV.
    
    A finalizer is also added to the agentserviceconfig object to ensure we
    clean up the image-service PVCs in the case that the agentserviceconfig
    is deleted directly.
    
    https://issues.redhat.com/browse/MGMT-8571
    carbonin committed Mar 8, 2022
    Configuration menu
    Copy the full SHA
    c4833ad View commit details
    Browse the repository at this point in the history