Provision a Redis Cache
Create a managed Redis instance (Memorystore) for a cache or for sessions. The instance is in the Shared VPC of the project. Only the private network can reach it.
Prerequisites
- An
Applicationmanifest that uses the cache. - The names of your
organization,organizational-unit,environmentandproject.
Steps
-
Create the
Redismanifest.apiVersion: lowops.manifests.v1
kind: Redis
metadata:
name: session-cache
project: login-svc
environment: production
organizational-unit: retail-banking
organization: fincorp
spec:
description: "In-memory session store for user authentication tokens"
enabled: true # false removes the instance
memorySizeGb: 4 # choose by the size of your working set -
Commit the manifest in a pull request and merge it.
-
Read the connection details from the environment variables that the platform gives to your application. The names depend on your project configuration. If the endpoint starts with
rediss://, the platform configures TLS.
Verify
The run shows the Redis instance as created. The application gets the host, the port and the auth string in its environment.
Next
Redisreference- A Redis instance keeps billing while a project hibernates. See Control Costs.