--- # Source: redis/templates/serviceaccount.yaml apiVersion: v1 kind: ServiceAccount automountServiceAccountToken: true metadata: name: myredis namespace: "redis-system" labels: app.kubernetes.io/name: redis helm.sh/chart: redis-17.3.11 app.kubernetes.io/instance: myredis app.kubernetes.io/managed-by: Helm --- # Source: redis/templates/configmap.yaml apiVersion: v1 kind: ConfigMap metadata: name: myredis-configuration namespace: "redis-system" labels: app.kubernetes.io/name: redis helm.sh/chart: redis-17.3.11 app.kubernetes.io/instance: myredis app.kubernetes.io/managed-by: Helm data: 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 master.conf: |- dir /data # User-supplied master configuration: rename-command FLUSHDB "" rename-command FLUSHALL "" # End of master configuration replica.conf: |- dir /data # User-supplied replica configuration: rename-command FLUSHDB "" rename-command FLUSHALL "" # End of replica configuration sentinel.conf: |- dir "/tmp" port 26379 sentinel monitor mymaster myredis-node-0.myredis-headless.redis-system.svc.cluster.local 6379 2 sentinel down-after-milliseconds mymaster 60000 sentinel failover-timeout mymaster 180000 sentinel parallel-syncs mymaster 1 # User-supplied sentinel configuration: # End of sentinel configuration --- # Source: redis/templates/health-configmap.yaml apiVersion: v1 kind: ConfigMap metadata: name: myredis-health namespace: "redis-system" labels: app.kubernetes.io/name: redis helm.sh/chart: redis-17.3.11 app.kubernetes.io/instance: myredis app.kubernetes.io/managed-by: Helm data: 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 3 $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_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 3 $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_sentinel.sh: |- #!/bin/bash response=$( timeout -s 3 $1 \ redis-cli \ -h localhost \ -p $REDIS_SENTINEL_PORT \ ping ) if [ "$?" -eq "124" ]; then echo "Timed out" exit 1 fi if [ "$response" != "PONG" ]; then echo "$response" exit 1 fi parse_sentinels.awk: |- /ip/ {FOUND_IP=1} /port/ {FOUND_PORT=1} /runid/ {FOUND_RUNID=1} !/ip|port|runid/ { if (FOUND_IP==1) { IP=$1; FOUND_IP=0; } else if (FOUND_PORT==1) { PORT=$1; FOUND_PORT=0; } else if (FOUND_RUNID==1) { printf "\nsentinel known-sentinel mymaster %s %s %s", IP, PORT, $0; FOUND_RUNID=0; } } 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 3 $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 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 3 $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_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_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 --- # Source: redis/templates/scripts-configmap.yaml apiVersion: v1 kind: ConfigMap metadata: name: myredis-scripts namespace: "redis-system" labels: app.kubernetes.io/name: redis helm.sh/chart: redis-17.3.11 app.kubernetes.io/instance: myredis app.kubernetes.io/managed-by: Helm data: start-node.sh: | #!/bin/bash . /opt/bitnami/scripts/libos.sh . /opt/bitnami/scripts/liblog.sh . /opt/bitnami/scripts/libvalidations.sh get_port() { hostname="$1" type="$2" port_var=$(echo "${hostname^^}_SERVICE_PORT_$type" | sed "s/-/_/g") port=${!port_var} if [ -z "$port" ]; then case $type in "SENTINEL") echo 26379 ;; "REDIS") echo 6379 ;; esac else echo $port fi } get_full_hostname() { hostname="$1" echo "${hostname}.${HEADLESS_SERVICE}" } REDISPORT=$(get_port "$HOSTNAME" "REDIS") HEADLESS_SERVICE="myredis-headless.redis-system.svc.cluster.local" if [ -n "$REDIS_EXTERNAL_MASTER_HOST" ]; then REDIS_SERVICE="$REDIS_EXTERNAL_MASTER_HOST" else REDIS_SERVICE="myredis.redis-system.svc.cluster.local" fi SENTINEL_SERVICE_PORT=$(get_port "myredis" "TCP_SENTINEL") validate_quorum() { if is_boolean_yes "$REDIS_TLS_ENABLED"; then quorum_info_command="redis-cli -h $REDIS_SERVICE -p $SENTINEL_SERVICE_PORT --tls --cert ${REDIS_TLS_CERT_FILE} --key ${REDIS_TLS_KEY_FILE} --cacert ${REDIS_TLS_CA_FILE} sentinel master mymaster" else quorum_info_command="redis-cli -h $REDIS_SERVICE -p $SENTINEL_SERVICE_PORT sentinel master mymaster" fi info "about to run the command: $quorum_info_command" eval $quorum_info_command | grep -Fq "s_down" } trigger_manual_failover() { if is_boolean_yes "$REDIS_TLS_ENABLED"; then failover_command="redis-cli -h $REDIS_SERVICE -p $SENTINEL_SERVICE_PORT --tls --cert ${REDIS_TLS_CERT_FILE} --key ${REDIS_TLS_KEY_FILE} --cacert ${REDIS_TLS_CA_FILE} sentinel failover mymaster" else failover_command="redis-cli -h $REDIS_SERVICE -p $SENTINEL_SERVICE_PORT sentinel failover mymaster" fi info "about to run the command: $failover_command" eval $failover_command } get_sentinel_master_info() { if is_boolean_yes "$REDIS_TLS_ENABLED"; then sentinel_info_command="timeout 220 redis-cli -h $REDIS_SERVICE -p $SENTINEL_SERVICE_PORT --tls --cert ${REDIS_TLS_CERT_FILE} --key ${REDIS_TLS_KEY_FILE} --cacert ${REDIS_TLS_CA_FILE} sentinel get-master-addr-by-name mymaster" else sentinel_info_command="timeout 220 redis-cli -h $REDIS_SERVICE -p $SENTINEL_SERVICE_PORT sentinel get-master-addr-by-name mymaster" fi info "about to run the command: $sentinel_info_command" eval $sentinel_info_command } [[ -f $REDIS_PASSWORD_FILE ]] && export REDIS_PASSWORD="$(< "${REDIS_PASSWORD_FILE}")" [[ -f $REDIS_MASTER_PASSWORD_FILE ]] && export REDIS_MASTER_PASSWORD="$(< "${REDIS_MASTER_PASSWORD_FILE}")" # check if there is a master master_in_persisted_conf="$(get_full_hostname "$HOSTNAME")" master_port_in_persisted_conf="$REDIS_MASTER_PORT_NUMBER" master_in_sentinel="$(get_sentinel_master_info)" redisRetVal=$? if [[ $redisRetVal -ne 0 ]]; then if [[ "$master_in_persisted_conf" == "$(get_full_hostname "$HOSTNAME")" ]]; then # Case 1: No active sentinel and in previous sentinel.conf we were the master --> MASTER info "Configuring the node as master" export REDIS_REPLICATION_MODE="master" else # Case 2: No active sentinel and in previous sentinel.conf we were not master --> REPLICA info "Configuring the node as replica" export REDIS_REPLICATION_MODE="replica" REDIS_MASTER_HOST=${master_in_persisted_conf} REDIS_MASTER_PORT_NUMBER=${master_port_in_persisted_conf} fi else # Fetches current master's host and port REDIS_SENTINEL_INFO=($(get_sentinel_master_info)) info "Current master: REDIS_SENTINEL_INFO=(${REDIS_SENTINEL_INFO[0]},${REDIS_SENTINEL_INFO[1]})" REDIS_MASTER_HOST=${REDIS_SENTINEL_INFO[0]} REDIS_MASTER_PORT_NUMBER=${REDIS_SENTINEL_INFO[1]} if [[ "$REDIS_MASTER_HOST" == "$(get_full_hostname "$HOSTNAME")" ]]; then # Case 3: Active sentinel and master it is this node --> MASTER info "Configuring the node as master" export REDIS_REPLICATION_MODE="master" else # Case 4: Active sentinel and master is not this node --> REPLICA info "Configuring the node as replica" export REDIS_REPLICATION_MODE="replica" fi fi if [[ -n "$REDIS_EXTERNAL_MASTER_HOST" ]]; then REDIS_MASTER_HOST="$REDIS_EXTERNAL_MASTER_HOST" REDIS_MASTER_PORT_NUMBER="${REDIS_EXTERNAL_MASTER_PORT}" fi if [[ -f /opt/bitnami/redis/mounted-etc/replica.conf ]];then cp /opt/bitnami/redis/mounted-etc/replica.conf /opt/bitnami/redis/etc/replica.conf fi if [[ -f /opt/bitnami/redis/mounted-etc/redis.conf ]];then cp /opt/bitnami/redis/mounted-etc/redis.conf /opt/bitnami/redis/etc/redis.conf fi echo "" >> /opt/bitnami/redis/etc/replica.conf echo "replica-announce-port $REDISPORT" >> /opt/bitnami/redis/etc/replica.conf echo "replica-announce-ip $(get_full_hostname "$HOSTNAME")" >> /opt/bitnami/redis/etc/replica.conf ARGS=("--port" "${REDIS_PORT}") if [[ "$REDIS_REPLICATION_MODE" = "slave" ]] || [[ "$REDIS_REPLICATION_MODE" = "replica" ]]; then ARGS+=("--replicaof" "${REDIS_MASTER_HOST}" "${REDIS_MASTER_PORT_NUMBER}") fi ARGS+=("--protected-mode" "no") ARGS+=("--include" "/opt/bitnami/redis/etc/replica.conf") ARGS+=("--include" "/opt/bitnami/redis/etc/redis.conf") exec redis-server "${ARGS[@]}" start-sentinel.sh: | #!/bin/bash . /opt/bitnami/scripts/libos.sh . /opt/bitnami/scripts/libvalidations.sh . /opt/bitnami/scripts/libfile.sh HEADLESS_SERVICE="myredis-headless.redis-system.svc.cluster.local" REDIS_SERVICE="myredis.redis-system.svc.cluster.local" get_port() { hostname="$1" type="$2" port_var=$(echo "${hostname^^}_SERVICE_PORT_$type" | sed "s/-/_/g") port=${!port_var} if [ -z "$port" ]; then case $type in "SENTINEL") echo 26379 ;; "REDIS") echo 6379 ;; esac else echo $port fi } get_full_hostname() { hostname="$1" echo "${hostname}.${HEADLESS_SERVICE}" } SERVPORT=$(get_port "$HOSTNAME" "SENTINEL") REDISPORT=$(get_port "$HOSTNAME" "REDIS") SENTINEL_SERVICE_PORT=$(get_port "myredis" "TCP_SENTINEL") sentinel_conf_set() { local -r key="${1:?missing key}" local value="${2:-}" # Sanitize inputs value="${value//\\/\\\\}" value="${value//&/\\&}" value="${value//\?/\\?}" [[ "$value" = "" ]] && value="\"$value\"" replace_in_file "/opt/bitnami/redis-sentinel/etc/sentinel.conf" "^#*\s*${key} .*" "${key} ${value}" false } sentinel_conf_add() { echo $'\n'"$@" >> "/opt/bitnami/redis-sentinel/etc/sentinel.conf" } host_id() { echo "$1" | openssl sha1 | awk '{print $2}' } get_sentinel_master_info() { if is_boolean_yes "$REDIS_SENTINEL_TLS_ENABLED"; then sentinel_info_command="timeout 220 redis-cli -h $REDIS_SERVICE -p $SENTINEL_SERVICE_PORT --tls --cert ${REDIS_SENTINEL_TLS_CERT_FILE} --key ${REDIS_SENTINEL_TLS_KEY_FILE} --cacert ${REDIS_SENTINEL_TLS_CA_FILE} sentinel get-master-addr-by-name mymaster" else sentinel_info_command="timeout 220 redis-cli -h $REDIS_SERVICE -p $SENTINEL_SERVICE_PORT sentinel get-master-addr-by-name mymaster" fi info "about to run the command: $sentinel_info_command" eval $sentinel_info_command } [[ -f $REDIS_PASSWORD_FILE ]] && export REDIS_PASSWORD="$(< "${REDIS_PASSWORD_FILE}")" master_in_persisted_conf="$(get_full_hostname "$HOSTNAME")" if ! get_sentinel_master_info && [[ "$master_in_persisted_conf" == "$(get_full_hostname "$HOSTNAME")" ]]; then # No master found, lets create a master node export REDIS_REPLICATION_MODE="master" REDIS_MASTER_HOST=$(get_full_hostname "$HOSTNAME") REDIS_MASTER_PORT_NUMBER="$REDISPORT" else export REDIS_REPLICATION_MODE="replica" # Fetches current master's host and port REDIS_SENTINEL_INFO=($(get_sentinel_master_info)) info "printing REDIS_SENTINEL_INFO=(${REDIS_SENTINEL_INFO[0]},${REDIS_SENTINEL_INFO[1]})" REDIS_MASTER_HOST=${REDIS_SENTINEL_INFO[0]} REDIS_MASTER_PORT_NUMBER=${REDIS_SENTINEL_INFO[1]} fi if [[ -n "$REDIS_EXTERNAL_MASTER_HOST" ]]; then REDIS_MASTER_HOST="$REDIS_EXTERNAL_MASTER_HOST" REDIS_MASTER_PORT_NUMBER="${REDIS_EXTERNAL_MASTER_PORT}" fi cp /opt/bitnami/redis-sentinel/mounted-etc/sentinel.conf /opt/bitnami/redis-sentinel/etc/sentinel.conf printf "\nsentinel myid %s" "$(host_id "$HOSTNAME")" >> /opt/bitnami/redis-sentinel/etc/sentinel.conf if [[ -z "$REDIS_MASTER_HOST" ]] || [[ -z "$REDIS_MASTER_PORT_NUMBER" ]] then # Prevent incorrect configuration to be written to sentinel.conf error "Redis master host is configured incorrectly (host: $REDIS_MASTER_HOST, port: $REDIS_MASTER_PORT_NUMBER)" exit 1 fi sentinel_conf_set "sentinel monitor" "mymaster "$REDIS_MASTER_HOST" "$REDIS_MASTER_PORT_NUMBER" 2" add_known_sentinel() { hostname="$1" ip="$2" if [[ -n "$hostname" && -n "$ip" && "$hostname" != "$HOSTNAME" ]]; then sentinel_conf_add "sentinel known-sentinel mymaster $(get_full_hostname "$hostname") $(get_port "$hostname" "SENTINEL") $(host_id "$hostname")" fi } add_known_replica() { hostname="$1" ip="$2" if [[ -n "$ip" && "$(get_full_hostname "$hostname")" != "$REDIS_MASTER_HOST" ]]; then sentinel_conf_add "sentinel known-replica mymaster $(get_full_hostname "$hostname") $(get_port "$hostname" "REDIS")" fi } # Add available hosts on the network as known replicas & sentinels for node in $(seq 0 $((3-1))); do hostname="myredis-node-$node" ip="$(getent hosts "$hostname.$HEADLESS_SERVICE" | awk '{ print $1 }')" add_known_sentinel "$hostname" "$ip" add_known_replica "$hostname" "$ip" done echo "" >> /opt/bitnami/redis-sentinel/etc/sentinel.conf echo "sentinel announce-hostnames yes" >> /opt/bitnami/redis-sentinel/etc/sentinel.conf echo "sentinel resolve-hostnames yes" >> /opt/bitnami/redis-sentinel/etc/sentinel.conf echo "sentinel announce-port $SERVPORT" >> /opt/bitnami/redis-sentinel/etc/sentinel.conf echo "sentinel announce-ip $(get_full_hostname "$HOSTNAME")" >> /opt/bitnami/redis-sentinel/etc/sentinel.conf exec redis-server /opt/bitnami/redis-sentinel/etc/sentinel.conf --sentinel prestop-sentinel.sh: | #!/bin/bash . /opt/bitnami/scripts/libvalidations.sh . /opt/bitnami/scripts/libos.sh HEADLESS_SERVICE="myredis-headless.redis-system.svc.cluster.local" SENTINEL_SERVICE_ENV_NAME=MYREDIS_SERVICE_PORT_TCP_SENTINEL SENTINEL_SERVICE_PORT=${!SENTINEL_SERVICE_ENV_NAME} get_full_hostname() { hostname="$1" echo "${hostname}.${HEADLESS_SERVICE}" } run_sentinel_command() { if is_boolean_yes "$REDIS_SENTINEL_TLS_ENABLED"; then redis-cli -h "$REDIS_SERVICE" -p "$SENTINEL_SERVICE_PORT" --tls --cert "$REDIS_SENTINEL_TLS_CERT_FILE" --key "$REDIS_SENTINEL_TLS_KEY_FILE" --cacert "$REDIS_SENTINEL_TLS_CA_FILE" sentinel "$@" else redis-cli -h "$REDIS_SERVICE" -p "$SENTINEL_SERVICE_PORT" sentinel "$@" fi } failover_finished() { REDIS_SENTINEL_INFO=($(run_sentinel_command get-master-addr-by-name "mymaster")) REDIS_MASTER_HOST="${REDIS_SENTINEL_INFO[0]}" [[ "$REDIS_MASTER_HOST" != "$(get_full_hostname $HOSTNAME)" ]] } REDIS_SERVICE="myredis.redis-system.svc.cluster.local" if ! failover_finished; then echo "I am the master pod and you are stopping me. Starting sentinel failover" # if I am the master, issue a command to failover once and then wait for the failover to finish run_sentinel_command failover "mymaster" if retry_while "failover_finished" "20" 1; then echo "Master has been successfuly failed over to a different pod." exit 0 else echo "Master failover failed" exit 1 fi else exit 0 fi prestop-redis.sh: | #!/bin/bash . /opt/bitnami/scripts/libvalidations.sh . /opt/bitnami/scripts/libos.sh run_redis_command() { if is_boolean_yes "$REDIS_TLS_ENABLED"; then redis-cli -h 127.0.0.1 -p "$REDIS_TLS_PORT" --tls --cert "$REDIS_TLS_CERT_FILE" --key "$REDIS_TLS_KEY_FILE" --cacert "$REDIS_TLS_CA_FILE" "$@" else redis-cli -h 127.0.0.1 -p "$REDIS_PORT" "$@" fi } failover_finished() { REDIS_ROLE=$(run_redis_command role | head -1) [[ "$REDIS_ROLE" != "master" ]] } # redis-cli automatically consumes credentials from the REDISCLI_AUTH variable [[ -n "$REDIS_PASSWORD" ]] && export REDISCLI_AUTH="$REDIS_PASSWORD" [[ -f "$REDIS_PASSWORD_FILE" ]] && export REDISCLI_AUTH="$(< "${REDIS_PASSWORD_FILE}")" if ! failover_finished; then echo "I am the master pod and you are stopping me." # Running failover command echo "Running the FAILOVER command" run_redis_command FAILOVER TIMEOUT "20000" # Waiting for the failover to finish echo "Waiting for the failover to finish up to 20s" if retry_while "failover_finished" "20" 1 echo "Master has been successfuly failed over to a different pod." exit 0 else echo "Master failover failed" exit 1 fi else exit 0 fi --- # Source: redis/templates/headless-svc.yaml apiVersion: v1 kind: Service metadata: name: myredis-headless namespace: "redis-system" labels: app.kubernetes.io/name: redis helm.sh/chart: redis-17.3.11 app.kubernetes.io/instance: myredis app.kubernetes.io/managed-by: Helm annotations: spec: type: ClusterIP clusterIP: None publishNotReadyAddresses: true ports: - name: tcp-redis port: 6379 targetPort: redis - name: tcp-sentinel port: 26379 targetPort: redis-sentinel selector: app.kubernetes.io/name: redis app.kubernetes.io/instance: myredis --- # Source: redis/templates/sentinel/service.yaml apiVersion: v1 kind: Service metadata: name: myredis namespace: "redis-system" labels: app.kubernetes.io/name: redis helm.sh/chart: redis-17.3.11 app.kubernetes.io/instance: myredis app.kubernetes.io/managed-by: Helm app.kubernetes.io/component: node spec: type: ClusterIP sessionAffinity: None ports: - name: tcp-redis port: 6379 targetPort: 6379 nodePort: null - name: tcp-sentinel port: 26379 targetPort: 26379 nodePort: null selector: app.kubernetes.io/name: redis app.kubernetes.io/instance: myredis app.kubernetes.io/component: node --- # Source: redis/templates/sentinel/statefulset.yaml apiVersion: apps/v1 kind: StatefulSet metadata: name: myredis-node namespace: "redis-system" labels: app.kubernetes.io/name: redis helm.sh/chart: redis-17.3.11 app.kubernetes.io/instance: myredis app.kubernetes.io/managed-by: Helm app.kubernetes.io/component: node spec: replicas: 3 selector: matchLabels: app.kubernetes.io/name: redis app.kubernetes.io/instance: myredis app.kubernetes.io/component: node serviceName: myredis-headless updateStrategy: rollingUpdate: {} type: RollingUpdate template: metadata: labels: app.kubernetes.io/name: redis helm.sh/chart: redis-17.3.11 app.kubernetes.io/instance: myredis app.kubernetes.io/managed-by: Helm app.kubernetes.io/component: node annotations: checksum/configmap: e2d22271df3e5fc9d07217b0d4812d0a9bf434403ff46f2d8f3169911e872d74 checksum/health: 07f269afed12a1eca5a7ad62ea09b6fe41f566308d348d73cfaae6709f0e34f5 checksum/scripts: b1f699307500b6d4a4ea9dba546b7fb85e25a0c54459d9207cae2d9e8e9cd6c2 checksum/secret: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 spec: securityContext: fsGroup: 1001 serviceAccountName: myredis affinity: podAffinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - podAffinityTerm: labelSelector: matchLabels: app.kubernetes.io/name: redis app.kubernetes.io/instance: myredis app.kubernetes.io/component: node topologyKey: kubernetes.io/hostname weight: 1 nodeAffinity: terminationGracePeriodSeconds: 30 containers: - name: redis image: docker.io/bitnami/redis:7.0.5-debian-11-r15 imagePullPolicy: "IfNotPresent" lifecycle: preStop: exec: command: - /bin/bash - -c - /opt/bitnami/scripts/start-scripts/prestop-redis.sh securityContext: runAsUser: 1001 command: - /bin/bash args: - -c - /opt/bitnami/scripts/start-scripts/start-node.sh env: - name: BITNAMI_DEBUG value: "false" - name: REDIS_MASTER_PORT_NUMBER value: "6379" - name: ALLOW_EMPTY_PASSWORD value: "yes" - name: REDIS_TLS_ENABLED value: "no" - name: REDIS_PORT value: "6379" - name: REDIS_DATA_DIR value: /data ports: - name: redis containerPort: 6379 startupProbe: failureThreshold: 22 initialDelaySeconds: 10 periodSeconds: 10 successThreshold: 1 timeoutSeconds: 5 exec: command: - sh - -c - /health/ping_liveness_local.sh 5 livenessProbe: initialDelaySeconds: 20 periodSeconds: 5 timeoutSeconds: 5 successThreshold: 1 failureThreshold: 5 exec: command: - sh - -c - /health/ping_liveness_local.sh 5 readinessProbe: initialDelaySeconds: 20 periodSeconds: 5 timeoutSeconds: 1 successThreshold: 1 failureThreshold: 5 exec: command: - sh - -c - /health/ping_readiness_local.sh 1 resources: limits: {} requests: {} volumeMounts: - name: start-scripts mountPath: /opt/bitnami/scripts/start-scripts - name: health mountPath: /health - name: redis-data mountPath: /data - name: config mountPath: /opt/bitnami/redis/mounted-etc - name: redis-tmp-conf mountPath: /opt/bitnami/redis/etc - name: tmp mountPath: /tmp - name: sentinel image: docker.io/bitnami/redis-sentinel:7.0.5-debian-11-r14 imagePullPolicy: "IfNotPresent" lifecycle: preStop: exec: command: - /bin/bash - -c - /opt/bitnami/scripts/start-scripts/prestop-sentinel.sh securityContext: runAsUser: 1001 command: - /bin/bash args: - -c - /opt/bitnami/scripts/start-scripts/start-sentinel.sh env: - name: BITNAMI_DEBUG value: "false" - name: ALLOW_EMPTY_PASSWORD value: "yes" - name: REDIS_SENTINEL_TLS_ENABLED value: "no" - name: REDIS_SENTINEL_PORT value: "26379" ports: - name: redis-sentinel containerPort: 26379 startupProbe: failureThreshold: 22 initialDelaySeconds: 10 periodSeconds: 10 successThreshold: 1 timeoutSeconds: 5 exec: command: - sh - -c - /health/ping_sentinel.sh 5 livenessProbe: initialDelaySeconds: 20 periodSeconds: 5 timeoutSeconds: 5 successThreshold: 1 failureThreshold: 5 exec: command: - sh - -c - /health/ping_sentinel.sh 5 readinessProbe: initialDelaySeconds: 20 periodSeconds: 5 timeoutSeconds: 1 successThreshold: 1 failureThreshold: 5 exec: command: - sh - -c - /health/ping_sentinel.sh 1 resources: limits: {} requests: {} volumeMounts: - name: start-scripts mountPath: /opt/bitnami/scripts/start-scripts - name: health mountPath: /health - name: sentinel-data mountPath: /opt/bitnami/redis-sentinel/etc - name: redis-data mountPath: /data - name: config mountPath: /opt/bitnami/redis-sentinel/mounted-etc volumes: - name: start-scripts configMap: name: myredis-scripts defaultMode: 0755 - name: health configMap: name: myredis-health defaultMode: 0755 - name: config configMap: name: myredis-configuration - name: sentinel-data emptyDir: {} - name: redis-tmp-conf emptyDir: {} - name: tmp emptyDir: {} - name: redis-data emptyDir: {}