Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(helm): update redis ( 19.0.2 → 19.1.3 ) #1182

Merged
merged 1 commit into from
Apr 28, 2024
Merged

Conversation

ergho-bot[bot]
Copy link
Contributor

@ergho-bot ergho-bot bot commented Apr 8, 2024

This PR contains the following updates:

Package Update Change
redis (source) minor 19.0.2 -> 19.1.3

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

@ergho-bot
Copy link
Contributor Author

ergho-bot bot commented Apr 8, 2024

--- cluster/apps/databases/redis/app Kustomization: flux-system/cluster-apps-redis HelmRelease: databases/redis

+++ cluster/apps/databases/redis/app Kustomization: flux-system/cluster-apps-redis HelmRelease: databases/redis

@@ -12,13 +12,13 @@

     spec:
       chart: redis
       sourceRef:
         kind: HelmRepository
         name: bitnami-charts
         namespace: flux-system
-      version: 19.0.2
+      version: 19.1.3
   install:
     createNamespace: true
     remediation:
       retries: 3
   interval: 15m
   maxHistory: 3

@ergho-bot
Copy link
Contributor Author

ergho-bot bot commented Apr 8, 2024

--- HelmRelease: databases/redis ConfigMap: databases/redis-scripts

+++ HelmRelease: databases/redis ConfigMap: databases/redis-scripts

@@ -92,12 +92,19 @@

     # 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 [[ -f /opt/bitnami/redis-sentinel/etc/sentinel.conf ]]; then
+        master_in_persisted_conf="$(awk '/monitor/ {print $4}' /opt/bitnami/redis-sentinel/etc/sentinel.conf)"
+        master_port_in_persisted_conf="$(awk '/monitor/ {print $5}' /opt/bitnami/redis-sentinel/etc/sentinel.conf)"
+        info "Found previous master ${master_in_persisted_conf}:${master_port_in_persisted_conf} in /opt/bitnami/redis-sentinel/etc/sentinel.conf"
+        debug "$(cat /opt/bitnami/redis-sentinel/etc/sentinel.conf | grep monitor)"
+    fi
+
     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
@@ -147,148 +154,82 @@

         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="redis-headless.databases.svc.cluster.local"
-    REDIS_SERVICE="redis.databases.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"
-        full_hostname="${hostname}.${HEADLESS_SERVICE}"
-        echo "${full_hostname}"
-    }
-
-    SERVPORT=$(get_port "$HOSTNAME" "SENTINEL")
-    REDISPORT=$(get_port "$HOSTNAME" "REDIS")
-    SENTINEL_SERVICE_PORT=$(get_port "redis" "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 20 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 redis-master"
-        else
-            sentinel_info_command="timeout 20 redis-cli -h $REDIS_SERVICE -p $SENTINEL_SERVICE_PORT sentinel get-master-addr-by-name redis-master"
-        fi
-        info "about to run the command: $sentinel_info_command"
-        retry_while "eval $sentinel_info_command" 2 5
-    }
-
-    [[ -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" "redis-master "$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 redis-master $(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 redis-master $(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="redis-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
+  start-sentinel.sh: "#!/bin/bash\n\n. /opt/bitnami/scripts/libos.sh\n. /opt/bitnami/scripts/libvalidations.sh\n\
+    . /opt/bitnami/scripts/libfile.sh\n\nHEADLESS_SERVICE=\"redis-headless.databases.svc.cluster.local\"\
+    \nREDIS_SERVICE=\"redis.databases.svc.cluster.local\"\n\nget_port() {\n    hostname=\"\
+    $1\"\n    type=\"$2\"\n\n    port_var=$(echo \"${hostname^^}_SERVICE_PORT_$type\"\
+    \ | sed \"s/-/_/g\")\n    port=${!port_var}\n\n    if [ -z \"$port\" ]; then\n\
+    \        case $type in\n            \"SENTINEL\")\n                echo 26379\n\
+    \                ;;\n            \"REDIS\")\n                echo 6379\n     \
+    \           ;;\n        esac\n    else\n        echo $port\n    fi\n}\n\nget_full_hostname()\
+    \ {\n    hostname=\"$1\"\n    full_hostname=\"${hostname}.${HEADLESS_SERVICE}\"\
+    \n    echo \"${full_hostname}\"\n}\n\nSERVPORT=$(get_port \"$HOSTNAME\" \"SENTINEL\"\
+    )\nREDISPORT=$(get_port \"$HOSTNAME\" \"REDIS\")\nSENTINEL_SERVICE_PORT=$(get_port\
+    \ \"redis\" \"SENTINEL\")\n\nsentinel_conf_set() {\n    local -r key=\"${1:?missing\
+    \ key}\"\n    local value=\"${2:-}\"\n\n    # Sanitize inputs\n    value=\"${value//\\\
+    \\/\\\\\\\\}\"\n    value=\"${value//&/\\\\&}\"\n    value=\"${value//\\?/\\\\\
+    ?}\"\n    [[ \"$value\" = \"\" ]] && value=\"\\\"$value\\\"\"\n\n    replace_in_file\
+    \ \"/opt/bitnami/redis-sentinel/etc/prepare-sentinel.conf\" \"^#*\\s*${key} .*\"\
+    \ \"${key} ${value}\" false\n}\nsentinel_conf_add() {\n    echo $'\\n'\"$@\" >>\
+    \ \"/opt/bitnami/redis-sentinel/etc/prepare-sentinel.conf\"\n}\nhost_id() {\n\
+    \    echo \"$1\" | openssl sha1 | awk '{print $2}'\n}\nget_sentinel_master_info()\
+    \ {\n    if is_boolean_yes \"$REDIS_SENTINEL_TLS_ENABLED\"; then\n        sentinel_info_command=\"\
+    timeout 20 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 redis-master\"\
+    \n    else\n        sentinel_info_command=\"timeout 20 redis-cli -h $REDIS_SERVICE\
+    \ -p $SENTINEL_SERVICE_PORT sentinel get-master-addr-by-name redis-master\"\n\
+    \    fi\n    info \"about to run the command: $sentinel_info_command\"\n    retry_while\
+    \ \"eval $sentinel_info_command\" 2 5\n}\n\n[[ -f $REDIS_PASSWORD_FILE ]] && export\
+    \ REDIS_PASSWORD=\"$(< \"${REDIS_PASSWORD_FILE}\")\"\n\nmaster_in_persisted_conf=\"\
+    $(get_full_hostname \"$HOSTNAME\")\"\n\nif [[ -f /opt/bitnami/redis-sentinel/etc/sentinel.conf\
+    \ ]]; then\n    master_in_persisted_conf=\"$(awk '/monitor/ {print $4}' /opt/bitnami/redis-sentinel/etc/sentinel.conf)\"\
+    \n    info \"Found previous master $master_in_persisted_conf in /opt/bitnami/redis-sentinel/etc/sentinel.conf\"\
+    \n    debug \"$(cat /opt/bitnami/redis-sentinel/etc/sentinel.conf | grep monitor)\"\
+    \nfi\nREDIS_SENTINEL_INFO=($(get_sentinel_master_info))\nif [ \"$?\" -eq \"0\"\
[Diff truncated by flux-local]
--- HelmRelease: databases/redis StatefulSet: databases/redis-node

+++ HelmRelease: databases/redis StatefulSet: databases/redis-node

@@ -26,13 +26,13 @@

         app.kubernetes.io/managed-by: Helm
         app.kubernetes.io/name: redis
         app.kubernetes.io/component: node
       annotations:
         checksum/configmap: 9e55324034f751858c14344bf39d071d4953f93d596ae6d0eebea19c662f9662
         checksum/health: 07a9e9f1ff08347b0d2cd65e962feb94d6390f5b64a77ed1346867af2559df4a
-        checksum/scripts: 1801193d55679295f41b8a9583e0fd3a534d6f1dd2bee5fac147f15b6d72543a
+        checksum/scripts: ced5d46f89fec69ceda1f690fe6bb37770ef8f8b43fd059a75e41b9c56231662
         checksum/secret: 44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a
         prometheus.io/port: '9121'
         prometheus.io/scrape: 'true'
     spec:
       automountServiceAccountToken: false
       securityContext:
@@ -55,13 +55,13 @@

             weight: 1
         nodeAffinity: null
       enableServiceLinks: true
       terminationGracePeriodSeconds: 30
       containers:
       - name: redis
-        image: docker.io/bitnami/redis:7.2.4-debian-12-r9
+        image: docker.io/bitnami/redis:7.2.4-debian-12-r12
         imagePullPolicy: IfNotPresent
         lifecycle:
           preStop:
             exec:
               command:
               - /bin/bash
@@ -148,24 +148,26 @@

             memory: 128Mi
         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/mounted-etc
         - name: empty-dir
           mountPath: /opt/bitnami/redis/etc
           subPath: app-conf-dir
         - name: empty-dir
           mountPath: /tmp
           subPath: tmp-dir
       - name: sentinel
-        image: docker.io/bitnami/redis-sentinel:7.2.4-debian-12-r7
+        image: docker.io/bitnami/redis-sentinel:7.2.4-debian-12-r9
         imagePullPolicy: IfNotPresent
         lifecycle:
           preStop:
             exec:
               command:
               - /bin/bash
@@ -243,13 +245,13 @@

           mountPath: /opt/bitnami/redis-sentinel/etc
         - name: redis-data
           mountPath: /data
         - name: config
           mountPath: /opt/bitnami/redis-sentinel/mounted-etc
       - name: metrics
-        image: docker.io/bitnami/redis-exporter:1.58.0-debian-12-r4
+        image: docker.io/bitnami/redis-exporter:1.58.0-debian-12-r7
         imagePullPolicy: IfNotPresent
         securityContext:
           allowPrivilegeEscalation: false
           capabilities:
             drop:
             - ALL

@ergho-bot ergho-bot bot removed the area/cluster label Apr 9, 2024
@ergho-bot ergho-bot bot changed the title feat(helm): update redis ( 19.0.2 → 19.1.0 ) feat(helm): update redis ( 19.0.2 → 19.1.1 ) Apr 17, 2024
@ergho-bot ergho-bot bot changed the title feat(helm): update redis ( 19.0.2 → 19.1.1 ) feat(helm): update redis ( 19.0.2 → 19.1.2 ) Apr 18, 2024
@ergho-bot ergho-bot bot changed the title feat(helm): update redis ( 19.0.2 → 19.1.2 ) feat(helm): update redis ( 19.0.2 → 19.1.3 ) Apr 23, 2024
@ergho-bot ergho-bot bot force-pushed the renovate/redis-19.x branch 3 times, most recently from 8cefb3d to 4a76bf1 Compare April 28, 2024 16:10
@ergho ergho merged commit 50d232e into main Apr 28, 2024
10 checks passed
@ergho ergho deleted the renovate/redis-19.x branch April 28, 2024 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant