As mentioned in this article: Service Fabric: Best Practices to preserve disk space in Image Store ImageStore keeps copied packages and provisioned packages.
In this article, we will discuss how can you configure cleaning up the copied application package for Service Fabric Managed Cluster 'SFMC'.
The mitigation is to set "AllowRuntimeCleanupUnusedApplicationTypesPolicy": "true".
For properties, specify the following tags:
...
"applicationTypeVersionsCleanupPolicy": {
"maxUnusedVersionsToKeep": 3
}
Let me show you a step-by-step guide to automatically remove the unwanted application versions in your Service Fabric Managed cluster below:
Scenario:
- I have deployed 4 versions of my app (1 InUse - 3 UnUsed) to my managed cluster as the following:
Symptom:
I need Service Fabric to do automatic cleanup for the Application Unused Versions and keep only the last 3 so as not to fill the disk space.
Mitigation Steps:
Note: The automatic clean-up should be effective after 24 hours of making those changes.
Then I tried to deploy a new version, and I could see that the oldest version was also cleaned up.
For manual cleanup of the ImageStoreService:
You can use PowerShell commands to delete copied packages and unregister application types as needed.
This includes using Get-ServiceFabricImageStoreContent to retrieve content and Remove-ServiceFabricApplicationPackage to delete it, as well as Unregister-ServiceFabricApplicationType to remove application packages from the image store and image cache on nodes.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.