Redis
This page provides information on Redis's use and configuration in Cortex Fabric.
Redis Use Cases in Fabric
Redis is a distributed key store that is used for caching data across services and service instances.
Redis is used to track and manage the following:
- Auth flow state
- Job status
- Intervention simulation process states
- Agent runtime state
Redis is a publish/subscribe notification service for local service cache updates, such as:
- Authz grants
- Spark cache
- Websockets
Redis Configuration
Redis is configured during installation in the Fabric Helm chart values.yaml
where the client configuration and optional server install is specified.
The memory-store for Redis is set to work with your cloud platform.
Use Sentinel mode for self-managed install with HA (high availability).
Internal vs External Configuration
By default the Fabric Helm chart provides an internal instance of Redis to get your development environment up and running quickly.
However, an external infrastructure configuration is recommended for production environments.
External configuration requires customers to obtain, install, and maintain an Enterprise Redis license.
An example of the charts configuration for external infrastructure configuration is displayed below:
cortex: redis: password: '' redisUri: 'redis://:$(REDIS_PASSWORD)@cortex-redis-master:6379' env: REDIS_TYPE: 'node' REDIS_MODE: 'standalone' REDIS_DATABASE: '0'redis: enabled: false
Google Memorystore (Redis)
When using Google's Memorystore for Redis with in-transit encryption (TLS) enabled as the externalized Redis service, some additional steps need to be applied:
- Create a DNS record that resolves to the IP for the Memorystore instance.
- Update the following yaml snippet with the DNS name created above:
apiVersion: networking.istio.io/v1beta1kind: ServiceEntrymetadata: name: redisspec: hosts: - ${DNS_NAME} location: MESH_EXTERNAL resolution: DNS ports: - name: redis number: 6379 protocol: REDIS targetPort: 6378 - number: 6378 name: rediss protocol: REDIS---apiVersion: networking.istio.io/v1beta1kind: DestinationRulemetadata: name: redisspec: host: ${DNS_NAME} trafficPolicy: portLevelSettings: - port: number: 6379 tls: mode: SIMPLE
- Submit the yaml file from above to the
cortex
namespace with
kubectl apply -f file.yaml -n cortex
- Update the values yaml passed to the Fabric install to use the expected DNS name according to the "Internal vs External Configuration" section above.
Redis Enterprise
Users may opt to use Redis Enterprise with Cortex.
Keep in mind that Redis Enterprise (or the Redis Cluster Helm Chart) has no support for multiple databases.
REDIS_DATABASE
must be set to 0 (currently also the default) in order to use Redis Enterprise.
Sizing Recommendations
See the Dependencies Table for version requirements for Redis in your Fabric build.
In general CognitiveScale recommends using a SaaS based Redis compliant cache (such as Redis for Google Memorystore), given the needs for scaling, support, upgrades and maintenance, with 8GB per replica PVC.
Specifically for GCP installations, the recommendation is to configure Google Memorystore for Redis Standard M2 service (5-10gb capacity, 10gbps performance) with two read replicas.