Tiered Storage Configuration for Kubernetes
Preparing a Kubernetes Cluster
These instructions also apply for OpenShift.
For a Tiered Storage Automatically assigns data to different categories of storage types based on considerations of cost, performance, availability, and recovery. overview refer to Intelligent Tiering Overview.
-
Make sure worker nodes support the required storage type.
-
Create a new storage
class zrs_sc.yaml
file, for example:kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: name: azure-premium-zrs provisioner: disk.csi.azure.com # replace with "kubernetes.io/azure-file" if AKS version is less than 1.21 allowVolumeExpansion: true parameters: skuName: Premium_ZRS
- Deploy this resource:
-
Once it is deployed, make sure the new storage class is available and it is named azure-premium-zrs.
-
Deploy the space with tiered storage enabled, and specify the required storage class name ('azure-premium-zrs').
kubectl apply -f zrs_sc.yaml
$ kubectl get sc
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUME EXPANSION AGE
azure-premium-zrs file.csi.azure.com Delete Immediate true 4d12h
azurefile-csi file.csi.azure.com Delete Immediate true 11d
managed-csi (default) disk.csi.azure.com Delete WaitForFirstConsumer true 11d
Deploying a Space with Tiered Storage
When deploying with Tiered Storage, Space Where GigaSpaces data is stored. It is the logical cache that holds data objects in memory and might also hold them in layered in tiering. Data is hosted from multiple SoRs, consolidated as a unified data model. needs to be marked to be tiered storage and for every type when it is registered, if you want to cache some data you have to specify a cache rule. In the example below, space-config.engine.cache_policy = 4 is for Tiered Storage.
Run the following Kubernetes An open-source container orchestration system for automating software deployment, scaling, and management of containerized applications. Helm command:
helm install ${SPACE_NAME} ${REPO}/xap-pu --version ${GS_VERSION} --set properties\[0\].name=\"space-config.engine.cache_policy\",properties\[0\].value=\"4\",persistence.enabled=true, persistence.storageClassName=${STORAGE_CLASS},persistence.accessMode=ReadWriteOnce,persistence.size=${STORAGE_SIZE},env\[0\].name=GS_SA_PRAGMA_SYNCHRONOUS,env\[0\].value=\"${SQLITE_PRAGMA_SYNCHRONOUS}\",resources.limits.memory=${MEMORY_SIZE},partitions=${PARTITIONS},ha=${HA}
Parameters
Parameter | Description |
---|---|
STORAGE_CLASS | Corresponds to the storage class name available for on disk data, for example ‘azure-premium-zrs |
SQLITE_PRAGMA_SYNCHRONOUS | Recommended value is 1 (NORMAL). All supported pragma statements: https://www.sqlite.org/pragma.html, search for ‘PRAGMA schema.synchronous’. For any changes to the predefined configuration, please contact our technical support team. |
STORAGE_SIZE | The storage size allocated for Warm (on-disk) data per partition. This will internally create a PersistentVolumeClaim resource with the specified size for each space partition. The cluster must have this amount of storage available for the corresponding storage class, e.g. 10Gi |
MEMORY_SIZE | Space partition memory size, e.g. 12G |
PARTITIONS | The number of space partitions (excluding backup partitions), e.g. 4 |
HA | High Availability true/false, when set to true, append also ,antiAffinity.enabled=true |
Tiered Storage Configuration for Space Types
Registering a Space Type with Tiered Storage Configuration
In the Java example below, take note of the highlighted section.
SpaceTypeDescriptor typeDescriptorDoc1 =
new SpaceTypeDescriptorBuilder("SpaceTypeExample")
.addFixedProperty("id", Integer.class)
.addFixedProperty("field1", String.class)
.addFixedProperty("field2", String.class)
.addFixedProperty("field3", String.class)
.addFixedProperty("expireDate", LocalDateTime.class)
.idProperty("id")
.supportsDynamicProperties(false)
.setTieredStorageTableConfig(
new TieredStorageTableConfig()
>.setName("SpaceTypeExample")// set to space type name
>.setCriteria("field1='1'")// see examples below
)
.create()
Tiered Storage Policies in Type Registration
Example | Hot/Warm Tiers Distribution | ||||
---|---|---|---|---|---|
new TieredStorageTableConfig() .setName("SpaceTypeExample") .setCriteria("field1='1'") Note: Supported operators: = != >= <= and or |
Criteria-Based |
||||
new TieredStorageTableConfig() .setName("SpaceTypeExample") .setTimeColumn("expireDate") .setPeriod(Duration.ofMinutes(60)) |
Time-Based
Note: Only the initial value of the expireDate column will define Hot Tier retention of an object. |
||||
new TieredStorageTableConfig() .setName("SpaceTypeExample") .setTransient(true) |
Memory Only
|
||||
null (*) or no call to: .setTieredStorageTableConfi |
Warm Tier Only
|
||||
new TieredStorageTableConfig() .setName("SpaceTypeExample") .setCriteria("all") |
Hot and Warm
|
Limitations and Recommendations
Supported | Not Supported |
---|---|
|
|