Hazelcast maps are used to distribute data across a cluster and make it easy to scale your applications while protecting data against member failures. You can create and configure maps using the Map resource.
Configuring the Map Resource
Below are the configuration options for the Map resource. You can find more detailed information in API Reference page.
| Field | Description | ||
|---|---|---|---|
|
Name of the map config to be created. If empty, the CR name will be used. It cannot be updated after the map config is created successfully. |
||
|
Count of synchronous backups. |
||
|
Maximum time in seconds for each entry to stay in the map. |
||
|
Maximum time in seconds for each entry to stay idle in the map. |
||
|
Configuration for removing data from the map when it reaches its max size.
|
||
|
Indexes to be created for the map data. |
||
|
When enabled, map data will be persisted.
|
||
|
HazelcastResourceName defines the name of the Hazelcast resource. |
Example Configuration
The following Map resource creates a map configuration for the Hazelcast custom resource that is defined in the hazelcastResourceName field.
apiVersion: hazelcast.com/v1alpha1
kind: Map
metadata:
name: map-sample
spec:
hazelcastResourceName: hazelcast-sample
backupCount: 1
timeToLiveSeconds: 0
maxIdleSeconds: 0
eviction:
evictionPolicy: NONE
maxSize: 0
maxSizePolicy: PER_NODE
indexes:
- type: HASH
name: index1
attributes:
- "name"
- "age"
- type: BITMAP
attributes:
- "name"
bitMapIndexOptions:
uniqueKey: id
uniqueKeyTransition: RAW
persistenceEnabled: true
After creating the Map resource, you can learn about its status with the following command
kubectl get map map-sample -o wide
NAME STATUS MESSAGE
map Success