Skip to content

Commit

Permalink
πŸ‘· πŸ§‘β€πŸ’» Single Replica Redis Cluster (#1039)
Browse files Browse the repository at this point in the history
* Run Redis Cluster in Single Replica mode
* Set Resources Preset to `none` in NATS, Postgres, and Redis
  • Loading branch information
rblaine95 authored Sep 17, 2024
1 parent 14b423c commit 7e22ac0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tilt/cloudapi/nats/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ nats:
## @param resourcesPreset Set container resources according to one common preset (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge). This is ignored if resources is set (resources is recommended for production).
## More information: https://github.com/bitnami/charts/blob/main/bitnami/common/templates/_resources.tpl#L15
##
resourcesPreset: nano
resourcesPreset: none
## @param resources Set container requests and limits for different resources like CPU or memory (essential for production workloads)
## Example:
## resources:
Expand Down
4 changes: 2 additions & 2 deletions tilt/cloudapi/postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ postgresql:
CREATE USER mediator WITH PASSWORD 'mediator' CREATEDB;
EOSQL
# https://github.com/bitnami/charts/blob/main/bitnami/common/templates/_resources.tpl#L15
resourcesPreset: nano
resourcesPreset: none
persistentVolumeClaimRetentionPolicy:
enabled: true
whenDeleted: Delete
Expand All @@ -39,7 +39,7 @@ pgpool:
adminUsername: admin
adminPassword: admin
# https://github.com/bitnami/charts/blob/main/bitnami/common/templates/_resources.tpl#L15
resourcesPreset: nano
resourcesPreset: none
tls:
enabled: false
autoGenerated: true # use self signed cert
25 changes: 24 additions & 1 deletion tilt/cloudapi/redis.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,40 @@
# https://github.com/bitnami/charts/tree/main/bitnami/redis-cluster
fullnameOverride: redis

redis:
podAnnotations:
sidecar.istio.io/proxyCPU: 10m
# podLabels:
# sidecar.istio.io/inject: "false"
# https://github.com/bitnami/charts/blob/main/bitnami/common/templates/_resources.tpl#L15
resourcesPreset: nano
resourcesPreset: none

lifecycleHooks:
postStart:
exec:
command:
- /bin/sh
- -c
- |-
until redis-cli -h localhost -p 6379 ping; do
echo "Waiting for Redis to be ready..."
sleep 1
done
redis-cli CLUSTER RESET
redis-cli CLUSTER SET-CONFIG-EPOCH 1
redis-cli CLUSTER ADDSLOTS $(seq 0 16383)
cluster:
nodes: 1
replicas: 0

password: redis

tls:
enabled: false
autoGenerated: true # use self signed cert
authClients: false # do not require clients to auth with certs

persistentVolumeClaimRetentionPolicy:
enabled: true
whenDeleted: Delete

0 comments on commit 7e22ac0

Please sign in to comment.