Create a Redis service

Apply the following object on your namespace, as specified by its YAML description.

Example to create a Redis instance
apiVersion: exoscale.appcat.vshn.io/v1
kind: ExoscaleRedis
metadata:
  name: my-redis-example (1)
  namespace: my-namespace (2)
spec:
  parameters:
    service:
      redisSettings:
        maxmemory_policy: noeviction (3)
      zone: ch-dk-2 (4)
    size:
      plan: hobbyist-2 (5)
  writeConnectionSecretToRef:
    name: redis-creds (6)
1 Instance name
2 The namespace where the object will be created.
3 Specify custom Redis settings [optional]
4 The Exoscale zone to use, see list of regions
5 See reference for a list of plans
6 Secret where the connection details are provisioned. This secret shouldn’t exist before creation.
To get more information about all available configuration options, please see the API Reference

Inspect your new Redis service

$ oc get exoscaleredis
NAMESPACE      NAME               PLAN         ZONE      READY   CONNECTION-SECRET   AGE
my-namespace   my-redis-example   hobbyist-2   ch-dk-2   True    redis-creds         2m

When you see True in the READY column, it means the instance is provisioned and ready to use.

Please note that creating a new service can take up to 5 minutes to become ready. Meanwhile, you can get more details using oc describe exoscaleredis where you see the provisioning progressing from "ReconcileSuccess" (service provisioning started) to "Available" (service provisioning finished).

Find the connection details

The connection details are stored in a secret. You can retrieve them with the following command:

$ oc get secrets redis-creds -o yaml

The output of the command above is a secret specification with the following structure:

apiVersion: v1
kind: Secret
metadata:
  name: redis-creds
stringData:
  REDIS_HOST: my-redis-example.my-cloud.com (1)
  REDIS_PASSWORD: my-secret (2)
  REDIS_PORT: 21700 (3)
  REDIS_URL: rediss://default:my-secret@my-redis-example.my-cloud.com:21700 (4)
  REDIS_USERNAME: default (5)
  ca.crt: base64encoded(data) (6)
  tls.crt: base64encoded(data) (7)
  tls.key: base64encoded(data) (8)
1 Host to connect to
2 Password
3 Port to use
4 URL containing all necessary information to connect to the instance
5 Username
6 CA certificate to use when TLS is enabled
7 Certificate to use when TLS is enabled
8 Key to use when TLS is enabled
Not all fields apply to all providers
Exoscale Redis supports connection via TLS. The certificates are signed by Let’s Encrypt, so no ca.crt file required.