Skip to content

Commit

Permalink
Add some details in Redis documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mortenlj committed Nov 26, 2024
1 parent 4810e45 commit fd82bb8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/persistence/redis/how-to/create-application.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@ a read-only user for the `lookup` instance. See the [manifest
reference][app-spec-redis] for other
options for `access`.

The default Redis created by NAIS looks like this:

```yaml
apiVersion: aiven.io/v1alpha1
kind: Redis
metadata:
labels:
app: redis-tester
team: myteam
name: redis-myteam-sessions
namespace: myteam
spec:
plan: startup-4
project: nav-dev
```
If all you need is a Redis instance for one application using just the
default settings, this is all you need. If you want to share a Redis
instance across applications, or want to change configuration away
Expand Down
3 changes: 3 additions & 0 deletions docs/persistence/redis/how-to/create-explicit.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ tags: [redis, how-to]

# Create a Redis instance explicitly

## Prerequisites
- [Member of a NAIS team](../../../explanations/team.md)

We recommend creating your Redis instances in their own workflow for more control over configuration, especially if you intend for multiple applications using the same Redis instance, or if you need to change configuration.

Creating a Redis instance is done by adding a Redis resource to your namespace with detailed configuration.
Expand Down
8 changes: 8 additions & 0 deletions docs/persistence/redis/reference/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ spec:
access: readwrite | read | write | admin
```
## Environment variables
Every `<RedisInstanceName>` will give three environment variables for the applications to use:

| Key | Value |
Expand All @@ -25,3 +27,9 @@ Every `<RedisInstanceName>` will give three environment variables for the applic
| `REDIS_PORT_<RedisInstanceName>` | The port for the Redis instance. <br/>Example: `26483` |
| `REDIS_USERNAME_<RedisInstanceName>` | The username to use when connecting. |
| `REDIS_PASSWORD_<RedisInstanceName>` | The password to use when connecting. |

## Advanced configuration

For advanced configuration, we recommend [creating your Redis instances explicitly](../how-to/create-explicit.md), especially if you intend for multiple applications using the same Redis instance.

We use Aivens operator, so the Redis resource is [documented in detail](https://aiven.github.io/aiven-operator/api-reference/redis.html) in the Aiven documentation.

0 comments on commit fd82bb8

Please sign in to comment.