Deployment

To deploy a Redis instance on Porter, head to the Community Add-ons tab. You can optionally specify a password for the instance or configure the amount of resources (i.e. CPU and RAM) assigned to the instance.

Redis settingsRedis settings

Connecting to the Database

Redis on Porter is by default only exposed to internal traffic - only applications and add-on's that are deployed in the same Kubernetes cluster can connect to the Redis instance. The DNS name for the instance can be found on the deployment view as shown below. Note that Redis listens on port 6379 by default.

Redis URIRedis URI

The connection URI for the Redis instance follows this format:

redis://${DNS_NAME}:6379

If you've enabled password, the connection string would look like:

redis://${ARBITRARY_USERNAME}:${PASSWORD}@${DNA_NAME}:6379

You can pass in any string as your username (even an empty string). Redis does not support users but implements this behavior to comply with URI RFC standard.

For the example above that does not have password enabled, the connection string would be:

redis://peaches-redis-master.default.svc.cluster.local:6379