-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from tegridy-io/feat/refine-redis
Support redis for file locking
- Loading branch information
Showing
29 changed files
with
1,652 additions
and
13 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
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
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
31 changes: 31 additions & 0 deletions
31
tests/golden/defaults/defaults/defaults/10_helmchart/redis/templates/configmap.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,31 @@ | ||
apiVersion: v1 | ||
data: | ||
master.conf: |- | ||
dir /data | ||
# User-supplied master configuration: | ||
rename-command FLUSHDB "" | ||
rename-command FLUSHALL "" | ||
# End of master configuration | ||
redis.conf: |- | ||
# User-supplied common configuration: | ||
# Enable AOF https://redis.io/topics/persistence#append-only-file | ||
appendonly yes | ||
# Disable RDB persistence, AOF persistence already enabled. | ||
save "" | ||
# End of common configuration | ||
replica.conf: |- | ||
dir /data | ||
# User-supplied replica configuration: | ||
rename-command FLUSHDB "" | ||
rename-command FLUSHALL "" | ||
# End of replica configuration | ||
kind: ConfigMap | ||
metadata: | ||
labels: | ||
app.kubernetes.io/instance: redis | ||
app.kubernetes.io/managed-by: commodore | ||
app.kubernetes.io/name: redis | ||
app.kubernetes.io/version: 7.2.4 | ||
helm.sh/chart: redis-18.9.0 | ||
name: redis-configuration | ||
namespace: app-defaults |
22 changes: 22 additions & 0 deletions
22
tests/golden/defaults/defaults/defaults/10_helmchart/redis/templates/headless-svc.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,22 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
annotations: null | ||
labels: | ||
app.kubernetes.io/instance: redis | ||
app.kubernetes.io/managed-by: commodore | ||
app.kubernetes.io/name: redis | ||
app.kubernetes.io/version: 7.2.4 | ||
helm.sh/chart: redis-18.9.0 | ||
name: redis-headless | ||
namespace: app-defaults | ||
spec: | ||
clusterIP: None | ||
ports: | ||
- name: tcp-redis | ||
port: 6379 | ||
targetPort: redis | ||
selector: | ||
app.kubernetes.io/instance: redis | ||
app.kubernetes.io/name: redis | ||
type: ClusterIP |
106 changes: 106 additions & 0 deletions
106
tests/golden/defaults/defaults/defaults/10_helmchart/redis/templates/health-configmap.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,106 @@ | ||
apiVersion: v1 | ||
data: | ||
ping_liveness_local.sh: |- | ||
#!/bin/bash | ||
[[ -f $REDIS_PASSWORD_FILE ]] && export REDIS_PASSWORD="$(< "${REDIS_PASSWORD_FILE}")" | ||
[[ -n "$REDIS_PASSWORD" ]] && export REDISCLI_AUTH="$REDIS_PASSWORD" | ||
response=$( | ||
timeout -s 15 $1 \ | ||
redis-cli \ | ||
-h localhost \ | ||
-p $REDIS_PORT \ | ||
ping | ||
) | ||
if [ "$?" -eq "124" ]; then | ||
echo "Timed out" | ||
exit 1 | ||
fi | ||
responseFirstWord=$(echo $response | head -n1 | awk '{print $1;}') | ||
if [ "$response" != "PONG" ] && [ "$responseFirstWord" != "LOADING" ] && [ "$responseFirstWord" != "MASTERDOWN" ]; then | ||
echo "$response" | ||
exit 1 | ||
fi | ||
ping_liveness_local_and_master.sh: |- | ||
script_dir="$(dirname "$0")" | ||
exit_status=0 | ||
"$script_dir/ping_liveness_local.sh" $1 || exit_status=$? | ||
"$script_dir/ping_liveness_master.sh" $1 || exit_status=$? | ||
exit $exit_status | ||
ping_liveness_master.sh: |- | ||
#!/bin/bash | ||
[[ -f $REDIS_MASTER_PASSWORD_FILE ]] && export REDIS_MASTER_PASSWORD="$(< "${REDIS_MASTER_PASSWORD_FILE}")" | ||
[[ -n "$REDIS_MASTER_PASSWORD" ]] && export REDISCLI_AUTH="$REDIS_MASTER_PASSWORD" | ||
response=$( | ||
timeout -s 15 $1 \ | ||
redis-cli \ | ||
-h $REDIS_MASTER_HOST \ | ||
-p $REDIS_MASTER_PORT_NUMBER \ | ||
ping | ||
) | ||
if [ "$?" -eq "124" ]; then | ||
echo "Timed out" | ||
exit 1 | ||
fi | ||
responseFirstWord=$(echo $response | head -n1 | awk '{print $1;}') | ||
if [ "$response" != "PONG" ] && [ "$responseFirstWord" != "LOADING" ]; then | ||
echo "$response" | ||
exit 1 | ||
fi | ||
ping_readiness_local.sh: |- | ||
#!/bin/bash | ||
[[ -f $REDIS_PASSWORD_FILE ]] && export REDIS_PASSWORD="$(< "${REDIS_PASSWORD_FILE}")" | ||
[[ -n "$REDIS_PASSWORD" ]] && export REDISCLI_AUTH="$REDIS_PASSWORD" | ||
response=$( | ||
timeout -s 15 $1 \ | ||
redis-cli \ | ||
-h localhost \ | ||
-p $REDIS_PORT \ | ||
ping | ||
) | ||
if [ "$?" -eq "124" ]; then | ||
echo "Timed out" | ||
exit 1 | ||
fi | ||
if [ "$response" != "PONG" ]; then | ||
echo "$response" | ||
exit 1 | ||
fi | ||
ping_readiness_local_and_master.sh: |- | ||
script_dir="$(dirname "$0")" | ||
exit_status=0 | ||
"$script_dir/ping_readiness_local.sh" $1 || exit_status=$? | ||
"$script_dir/ping_readiness_master.sh" $1 || exit_status=$? | ||
exit $exit_status | ||
ping_readiness_master.sh: |- | ||
#!/bin/bash | ||
[[ -f $REDIS_MASTER_PASSWORD_FILE ]] && export REDIS_MASTER_PASSWORD="$(< "${REDIS_MASTER_PASSWORD_FILE}")" | ||
[[ -n "$REDIS_MASTER_PASSWORD" ]] && export REDISCLI_AUTH="$REDIS_MASTER_PASSWORD" | ||
response=$( | ||
timeout -s 15 $1 \ | ||
redis-cli \ | ||
-h $REDIS_MASTER_HOST \ | ||
-p $REDIS_MASTER_PORT_NUMBER \ | ||
ping | ||
) | ||
if [ "$?" -eq "124" ]; then | ||
echo "Timed out" | ||
exit 1 | ||
fi | ||
if [ "$response" != "PONG" ]; then | ||
echo "$response" | ||
exit 1 | ||
fi | ||
kind: ConfigMap | ||
metadata: | ||
labels: | ||
app.kubernetes.io/instance: redis | ||
app.kubernetes.io/managed-by: commodore | ||
app.kubernetes.io/name: redis | ||
app.kubernetes.io/version: 7.2.4 | ||
helm.sh/chart: redis-18.9.0 | ||
name: redis-health | ||
namespace: app-defaults |
Oops, something went wrong.