Migrate to ValkeyΒΆ
If you need to keep the data and your application needs to be available during the migration, reach out to the nais team for assistance.
PrerequisitesΒΆ
- Your app uses Redis for a simple caching store and can handle the data missing at startup.
VariantsΒΆ
The steps to migrate differ depending on how your Redis instance has been created:
- You created the Redis instance implicitly by adding a
redis
block to your application manifest. - You created the Redis instance explicitly by creating a
Redis
resource.
Implicit Redis instanceΒΆ
If you created the Redis instance implicitly by adding a redis
block to your application manifest, follow these steps:
- Copy the
redis
block in your application manifest to usevalkey
instead. The fields are the same. - Deploy the updated application manifest.
Your application is now using Valkey instead of Redis. 3. Prepare Redis for deletion:
kubectl patch redis redis-<TEAM-NAME>-<INSTANCE-NAME> --type json -p='[{"op": "replace", "path": "/spec/terminationProtection", "value": false}]'
- Remove the
redis
block from your application manifest and deploy the updated manifest.
The Redis instance will now be deleted. 5. Congrats! Your application now uses Valkey instead of Redis.
Explicit Redis instanceΒΆ
If you created the Redis instance explicitly by creating a Redis
resource, follow these steps:
- Make a copy of your Redis manifest to hold your Valkey manifest.
- Update
kind
fromRedis
toValkey
. - Change the name from
redis-<TEAM-NAME>-<INSTANCE-NAME>
tovalkey-<TEAM-NAME>-<INSTANCE-NAME>
. - Deploy the manifest.
- For each application that uses this Redis instance:
- Change the
redis
block in the application manifest to usevalkey
instead. The fields are the same. - Deploy the updated application manifest.
- Delete the Redis manifest from source control so it doesn't get recreated.
- Delete the old Redis instance:
kubectl delete redis redis-<TEAM-NAME>-<INSTANCE-NAME>
. - Congrats! Your application now uses Valkey instead of Redis.