Automated Manifest Update (#4490)
This PR contains newly rendered Kubernetes manifests automatically generated by the CI workflow. Reviewed-on: #4490 Co-authored-by: gitea-bot <gitea-bot@alexlebens.net> Co-committed-by: gitea-bot <gitea-bot@alexlebens.net>
This commit was merged in pull request #4490.
This commit is contained in:
@@ -46,6 +46,35 @@ data:
|
||||
echo "bind * -::*"
|
||||
echo "dir /data"
|
||||
} >>"$VALKEY_CONFIG"
|
||||
# Replica mode configuration
|
||||
log "Configuring replication mode"
|
||||
|
||||
# Use POD_INDEX from Kubernetes metadata
|
||||
POD_INDEX=${POD_INDEX:-0}
|
||||
IS_MASTER=false
|
||||
|
||||
# Check if this is pod-0 (master)
|
||||
if [ "$POD_INDEX" = "0" ]; then
|
||||
IS_MASTER=true
|
||||
log "This pod (index $POD_INDEX) is configured as MASTER"
|
||||
else
|
||||
log "This pod (index $POD_INDEX) is configured as REPLICA"
|
||||
fi
|
||||
|
||||
# Configure replica settings
|
||||
if [ "$IS_MASTER" = "false" ]; then
|
||||
MASTER_HOST="blocky-valkey-0.blocky-valkey-headless.blocky.svc.cluster.local"
|
||||
MASTER_PORT="6379"
|
||||
|
||||
log "Configuring replica to follow master at $MASTER_HOST:$MASTER_PORT"
|
||||
|
||||
{
|
||||
echo ""
|
||||
echo "# Replica Configuration"
|
||||
echo "replicaof $MASTER_HOST $MASTER_PORT"
|
||||
echo "replica-announce-ip blocky-valkey-$POD_INDEX.blocky-valkey-headless.blocky.svc.cluster.local"
|
||||
} >>"$VALKEY_CONFIG"
|
||||
fi
|
||||
|
||||
# Append extra configs if present
|
||||
if [ -f /usr/local/etc/valkey/valkey.conf ]; then
|
||||
|
||||
Reference in New Issue
Block a user