-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MGMT-8571: Deploy the image service as a stateful set (#3067)
* MGMT-8571: add optional image storage to agent service config * MGMT-8571: add image storage to operator deploy script and docs * 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. * 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
- Loading branch information
Showing
13 changed files
with
1,239 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.