-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add examples for using external redis
- Loading branch information
1 parent
3929944
commit 38055af
Showing
4 changed files
with
250 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Using external Redis instances | ||
|
||
Sourcegraph deployment by default ships two separate Redis instances for different purposes | ||
|
||
- [redis-cache.Deployment.yaml](../../templates/redis/redis-cache.Deployment.yaml) | ||
- [redis-store.Deployment.yaml](../../templates/redis/redis-store.Deployment.yaml) | ||
|
||
When using external Redis instances, you’ll need specify the corresponding environment variable for [each of the following deployments](https://docs.sourcegraph.com/admin/install/kubernetes/configure#configure-custom-redis) | ||
|
||
## Optional 1 - One shared external Redis instance | ||
|
||
Example values override [override-shared.yaml](./override-shared.yaml). | ||
|
||
### `REDIS_ENDPOINT` | ||
|
||
The string must either have the format `$HOST:PORT` or follow the [IANA specification for Redis URLs](https://www.iana.org/assignments/uri-schemes/prov/redis) (e.g., redis://:mypassword@host:6379/2) | ||
|
||
## Option 2 - Two separate external Redis instances | ||
|
||
Example values override [override-separate.yaml](./override-separate.yaml). | ||
|
||
### `REDIS_CACHE_ENDPOINT` | ||
|
||
The string must either have the format `$HOST:PORT` or follow the [IANA specification for Redis URLs](https://www.iana.org/assignments/uri-schemes/prov/redis) (e.g., redis://:mypassword@host:6379/2) | ||
|
||
### `REDIS_STORE_ENDPOINT` | ||
|
||
The string must either have the format `$HOST:PORT` or follow the [IANA specification for Redis URLs](https://www.iana.org/assignments/uri-schemes/prov/redis) (e.g., redis://:mypassword@host:6379/2) | ||
|
||
## Notes | ||
|
||
You may store these sensitive environment variables in a [Secret](https://kubernetes.io/docs/concepts/configuration/secret/). | ||
|
||
```yaml | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: sourcegraph-external-redis-credentials | ||
data: | ||
# notes: secrets data has to be base64-encoded | ||
REDIS_ENDPOINT: "" | ||
``` | ||
```yaml | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: sourcegraph-external-redis-credentials | ||
data: | ||
# notes: secrets data has to be base64-encoded | ||
REDIS_CACHE_ENDPOINT: "" | ||
REDIS_STORE_ENDPOINT: "" | ||
``` |
86 changes: 86 additions & 0 deletions
86
charts/sourcegraph/examples/external-redis/override-separate.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# Demonstrate using external redis instance(s) | ||
# Disables deployment of the internal `redis-cache` and `redis-store` deployment | ||
|
||
frontend: | ||
env: | ||
REDIS_CACHE_ENDPOINT: | ||
valueFrom: | ||
secretKeyRef: # Pre-existing secret, not created by this chart | ||
name: sourcegraph-external-redis-credentials | ||
key: REDIS_CACHE_ENDPOINT | ||
REDIS_STORE_ENDPOINT: | ||
valueFrom: | ||
secretKeyRef: # Pre-existing secret, not created by this chart | ||
name: sourcegraph-external-redis-credentials | ||
key: REDIS_STORE_ENDPOINT | ||
|
||
repoUpdater: | ||
env: | ||
REDIS_CACHE_ENDPOINT: | ||
valueFrom: | ||
secretKeyRef: # Pre-existing secret, not created by this chart | ||
name: sourcegraph-external-redis-credentials | ||
key: REDIS_CACHE_ENDPOINT | ||
REDIS_STORE_ENDPOINT: | ||
valueFrom: | ||
secretKeyRef: # Pre-existing secret, not created by this chart | ||
name: sourcegraph-external-redis-credentials | ||
key: REDIS_STORE_ENDPOINT | ||
|
||
gitserver: | ||
env: | ||
REDIS_CACHE_ENDPOINT: | ||
valueFrom: | ||
secretKeyRef: # Pre-existing secret, not created by this chart | ||
name: sourcegraph-external-redis-credentials | ||
key: REDIS_CACHE_ENDPOINT | ||
REDIS_STORE_ENDPOINT: | ||
valueFrom: | ||
secretKeyRef: # Pre-existing secret, not created by this chart | ||
name: sourcegraph-external-redis-credentials | ||
key: REDIS_STORE_ENDPOINT | ||
|
||
searcher: | ||
env: | ||
REDIS_CACHE_ENDPOINT: | ||
valueFrom: | ||
secretKeyRef: # Pre-existing secret, not created by this chart | ||
name: sourcegraph-external-redis-credentials | ||
key: REDIS_CACHE_ENDPOINT | ||
REDIS_STORE_ENDPOINT: | ||
valueFrom: | ||
secretKeyRef: # Pre-existing secret, not created by this chart | ||
name: sourcegraph-external-redis-credentials | ||
key: REDIS_STORE_ENDPOINT | ||
|
||
symbols: | ||
env: | ||
REDIS_CACHE_ENDPOINT: | ||
valueFrom: | ||
secretKeyRef: # Pre-existing secret, not created by this chart | ||
name: sourcegraph-external-redis-credentials | ||
key: REDIS_CACHE_ENDPOINT | ||
REDIS_STORE_ENDPOINT: | ||
valueFrom: | ||
secretKeyRef: # Pre-existing secret, not created by this chart | ||
name: sourcegraph-external-redis-credentials | ||
key: REDIS_STORE_ENDPOINT | ||
|
||
worker: | ||
env: | ||
REDIS_CACHE_ENDPOINT: | ||
valueFrom: | ||
secretKeyRef: # Pre-existing secret, not created by this chart | ||
name: sourcegraph-external-redis-credentials | ||
key: REDIS_CACHE_ENDPOINT | ||
REDIS_STORE_ENDPOINT: | ||
valueFrom: | ||
secretKeyRef: # Pre-existing secret, not created by this chart | ||
name: sourcegraph-external-redis-credentials | ||
key: REDIS_STORE_ENDPOINT | ||
|
||
redisCache: | ||
enabled: false | ||
|
||
redisStore: | ||
enabled: false |
56 changes: 56 additions & 0 deletions
56
charts/sourcegraph/examples/external-redis/override-shared.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Demonstrate using external redis instance(s) | ||
# Disables deployment of the internal `redis-cache` and `redis-store` deployment | ||
|
||
frontend: | ||
env: | ||
REDIS_ENDPOINT: | ||
valueFrom: | ||
secretKeyRef: # Pre-existing secret, not created by this chart | ||
name: sourcegraph-external-redis-credentials | ||
key: REDIS_ENDPOINT | ||
|
||
repoUpdater: | ||
env: | ||
REDIS_ENDPOINT: | ||
valueFrom: | ||
secretKeyRef: # Pre-existing secret, not created by this chart | ||
name: sourcegraph-external-redis-credentials | ||
key: REDIS_ENDPOINT | ||
|
||
gitserver: | ||
env: | ||
REDIS_ENDPOINT: | ||
valueFrom: | ||
secretKeyRef: # Pre-existing secret, not created by this chart | ||
name: sourcegraph-external-redis-credentials | ||
key: REDIS_ENDPOINT | ||
|
||
searcher: | ||
env: | ||
REDIS_ENDPOINT: | ||
valueFrom: | ||
secretKeyRef: # Pre-existing secret, not created by this chart | ||
name: sourcegraph-external-redis-credentials | ||
key: REDIS_ENDPOINT | ||
|
||
symbols: | ||
env: | ||
REDIS_ENDPOINT: | ||
valueFrom: | ||
secretKeyRef: # Pre-existing secret, not created by this chart | ||
name: sourcegraph-external-redis-credentials | ||
key: REDIS_ENDPOINT | ||
|
||
worker: | ||
env: | ||
REDIS_ENDPOINT: | ||
valueFrom: | ||
secretKeyRef: # Pre-existing secret, not created by this chart | ||
name: sourcegraph-external-redis-credentials | ||
key: REDIS_ENDPOINT | ||
|
||
redisCache: | ||
enabled: false | ||
|
||
redisStore: | ||
enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
storageClass: | ||
create: false # Disable if you have your own existing storage class | ||
name: standard | ||
|
||
sourcegraph: | ||
localDevMode: true | ||
|
||
codeInsightsDB: | ||
serviceAccount: | ||
create: true | ||
codeIntelDB: | ||
serviceAccount: | ||
create: true | ||
githubProxy: | ||
serviceAccount: | ||
create: true | ||
gitserver: | ||
serviceAccount: | ||
create: true | ||
indexedSearch: | ||
serviceAccount: | ||
create: true | ||
minio: | ||
serviceAccount: | ||
create: true | ||
pgsql: | ||
serviceAccount: | ||
create: true | ||
preciseCodeIntel: | ||
serviceAccount: | ||
create: true | ||
redisCache: | ||
serviceAccount: | ||
create: true | ||
redisStore: | ||
serviceAccount: | ||
create: true | ||
repoUpdater: | ||
serviceAccount: | ||
create: true | ||
searcher: | ||
serviceAccount: | ||
create: true | ||
symbols: | ||
serviceAccount: | ||
create: true | ||
syntectServer: | ||
serviceAccount: | ||
create: true | ||
tracing: | ||
serviceAccount: | ||
create: true | ||
worker: | ||
serviceAccount: | ||
create: true |