Skip to content

fix: nextcloud-dev の Valkey チャートを 1.0.0 に更新 - #2326

Merged
Kentaro1043 merged 2 commits into
mainfrom
codex/valkey-chart-1-dev
Nov 17, 2026
Merged

Kentaro1043 merged 2 commits into
mainfrom
codex/valkey-chart-1-dev

Conversation

@Kentaro1043

@Kentaro1043 Kentaro1043 commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Why

nextcloud-dev の Valkey チャートを 1.0.0 に更新する。
従来の networkPolicy.ingress は廃止され、マニフェストの生成に失敗する。

What Changed

  • nextcloud-dev の Valkey チャートを 1.0.0 に更新
  • NetworkPolicy を有効にし、Nextcloud の Pod に valkey-client: "true" ラベルを付与

チャートが生成する NetworkPolicy は、 valkey-client: "true" の Pod と Valkey Pod から 6379 番ポートへの通信を許可する。

Verification

  • nextcloud-dev の kustomize build が成功し、生成された NetworkPolicy の許可ルールを確認
  • 上流の移行ガイドによると、Deployment の更新時に短時間の停止が発生する

関連: #2292、#2325

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one): 1

  • renovate-auto-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Diff

@@ metadata.labels.helm.sh/chart @@
# v1/ServiceAccount/nextcloud-dev/valkey
! ± value change
- valkey-0.12.1
+ valkey-1.0.0

@@ data.init.sh @@
# v1/ConfigMap/nextcloud-dev/valkey-init-scripts
! ± value change in multiline text (ten inserts, ten deletions)
  #!/bin/sh
  set -eu
  
  # Default config paths
- VALKEY_CONFIG=${VALKEY_CONFIG_PATH:-/data/conf/valkey.conf}
+ # The config lives on a memory backed emptyDir, not on the data volume: it
+ # carries the replication credentials in plain text, and CONFIG REWRITE puts
+ # them back on every failover even if this script never wrote them, so the
+ # file itself has to stay off persistent storage.
+ VALKEY_CONFIG=${VALKEY_CONFIG_PATH:-/valkey-conf/valkey.conf}
+ # The config is assembled in a temporary file and moved into place at the
+ # very end, so that an interrupted run can never leave a half written config
+ # behind. The restart logic below reads the previous config to decide the
+ # replication role, and a truncated file would make it read the wrong one.
+ VALKEY_CONFIG_TMP="${VALKEY_CONFIG}.tmp"
  
  LOGFILE="/data/init.log"
- DATA_DIR="/data/conf"
+ DATA_DIR="$(dirname "$VALKEY_CONFIG")"
  
  # Logging function (outputs to stderr and file)
  log() {
    echo "$(date) $1" | tee -a "$LOGFILE" >&2
  
  [17 lines unchanged)]
  
      log "ERROR: No password found for user $username"
      return 1
    fi
  
-   echo "$password"
+   # An empty value in the secret would otherwise be hashed into the ACL,
+   # and the hash of an empty password is the same everywhere, so the user
+   # would be open to anyone who can reach the port.
+   if [ -z "$password" ]; then
+     log "ERROR: The password for user $username is empty"
+     return 1
+   fi
+ 
+   printf '%s' "$password"
+ }
+ 
+ escape_config_arg() {
+   printf '%s' "$1" | sed 's/\\/\\\\/g; s/"/\\"/g'
  }
  
  # Clean old log if requested
  if [ "${KEEP_OLD_LOGS:-false}" != "true" ]; then
  
  [five lines unchanged)]
  
  fi
  
  log "Creating configuration in $DATA_DIR..."
  mkdir -p "$DATA_DIR"
- rm -f "$VALKEY_CONFIG"
+ rm -f "$VALKEY_CONFIG_TMP"
  
  
  # Base valkey.conf
  log "Generating base valkey.conf"
  
  [one line unchanged)]
  
    echo "port 6379"
    echo "protected-mode no"
    echo "bind * -::*"
    echo "dir /data"
- } >>"$VALKEY_CONFIG"
- # Create secure directory for ACL file
- log "Creating /etc/valkey directory for ACL file"
- mkdir -p /etc/valkey
+   echo "loglevel notice"
+ } >>"$VALKEY_CONFIG_TMP"
+ # The ACL file sits next to valkey.conf, on the same memory backed volume.
+ # It only holds password hashes, but it is still kept to its owner.
+ # File modes cannot keep Valkey from rewriting it (ACL SAVE replaces the
+ # file through a rename in this writable directory): restricting that is
+ # left to the ACL permissions of the users.
+ ACL_FILE="$(dirname "$VALKEY_CONFIG")/users.acl"
+ echo "aclfile $ACL_FILE" >>"$VALKEY_CONFIG_TMP"
  
- # Set aclfile path in valkey.conf
- echo "aclfile /etc/valkey/users.acl" >>"$VALKEY_CONFIG"
- 
- # Remove or reset existing ACL file if present (it may be read-only from previous run)
- log "Preparing ACL file at /etc/valkey/users.acl"
- if [ -f /etc/valkey/users.acl ]; then
-   log "Removing existing read-only users.acl file"
-   chmod 0600 /etc/valkey/users.acl
-   rm -f /etc/valkey/users.acl
- fi
- 
- # Create ACL file with secure permissions
- touch /etc/valkey/users.acl
- chmod 0600 /etc/valkey/users.acl
+ # A rerun of this init container in the same pod finds the previous file
+ log "Preparing ACL file at $ACL_FILE"
+ rm -f "$ACL_FILE"
+ (umask 077 && : >"$ACL_FILE")
  # Generate ACL entries for each user
  log "Generating ACL entries for users"
  
  # User: default
  PASSWORD=$(get_user_password "default" "default") || exit 1
  
  # Hash the password and write ACL entry
- PASSHASH=$(echo -n "$PASSWORD" | sha256sum | cut -f 1 -d " ")
- echo "user default on #$PASSHASH ~* &* +@all" >> /etc/valkey/users.acl
+ PASSHASH=$(printf '%s' "$PASSWORD" | sha256sum | cut -f 1 -d " ")
+ printf '%s\n' "user default on #$PASSHASH ~* &* +@all" >> "$ACL_FILE"
  
- # Set final permissions
- chmod 0400 /etc/valkey/users.acl
- log "ACL file created with 0400 permissions"
+ log "ACL file created"
  
  # Append extra configs if present
  if [ -f /usr/local/etc/valkey/valkey.conf ]; then
    log "Appending /usr/local/etc/valkey/valkey.conf"
-   cat /usr/local/etc/valkey/valkey.conf >>"$VALKEY_CONFIG"
+   cat /usr/local/etc/valkey/valkey.conf >>"$VALKEY_CONFIG_TMP"
  fi
- if [ -d /extravalkeyconfigs ]; then
-   log "Appending files in /extravalkeyconfigs/"
-   cat /extravalkeyconfigs/* >>"$VALKEY_CONFIG"
- fi
+ 
+ # Publish the finished config atomically.
+ mv "$VALKEY_CONFIG_TMP" "$VALKEY_CONFIG"

@@ metadata.labels.helm.sh/chart @@
# v1/ConfigMap/nextcloud-dev/valkey-init-scripts
! ± value change
- valkey-0.12.1
+ valkey-1.0.0

@@ metadata.labels.helm.sh/chart @@
# v1/Service/nextcloud-dev/valkey
! ± value change
- valkey-0.12.1
+ valkey-1.0.0

@@ spec.template.metadata.labels @@
# apps/v1/Deployment/nextcloud-dev/nextcloud
! + one map entry added:
+ valkey-client: "true"

@@ metadata.labels @@
# apps/v1/Deployment/nextcloud-dev/valkey
! + one map entry added:
+ app.kubernetes.io/component: valkey

@@ metadata.labels.helm.sh/chart @@
# apps/v1/Deployment/nextcloud-dev/valkey
! ± value change
- valkey-0.12.1
+ valkey-1.0.0

@@ spec.strategy.type @@
# apps/v1/Deployment/nextcloud-dev/valkey
! ± value change
- RollingUpdate
+ Recreate

@@ spec.template.metadata.annotations.checksum/initconfig @@
# apps/v1/Deployment/nextcloud-dev/valkey
! ± value change
- fadcadbcf9291cf43e4682d6a756ce20
+ 0bf713cec823a1720d9c8cb3c7e115b9

@@ spec.template.metadata.labels @@
# apps/v1/Deployment/nextcloud-dev/valkey
! + one map entry added:
+ app.kubernetes.io/component: valkey

@@ spec.template.spec @@
# apps/v1/Deployment/nextcloud-dev/valkey
! + one map entry added:
+ terminationGracePeriodSeconds: 30

@@ spec.template.spec.containers.valkey @@
# apps/v1/Deployment/nextcloud-dev/valkey
! + one map entry added:
+ readinessProbe:
+   exec:
+     command:
+     - sh
+     - "-c"
+     - "VALKEYCLI_AUTH=\"${VALKEY_PROBE_PASSWORD:-${VALKEY_PROBE_PASSWORD_INLINE:-}}\"; export VALKEYCLI_AUTH; r=$('valkey-cli' '-p' '6379' 'ping' 2>&1); case \"$r\" in PONG) exit 0;; esac; echo \"$r\"; exit 1"
+   failureThreshold: 3
+   initialDelaySeconds: 0
+   periodSeconds: 10
+   successThreshold: 1
+   timeoutSeconds: 1

@@ spec.template.spec.containers.valkey.args.0 @@
# apps/v1/Deployment/nextcloud-dev/valkey
! ± value change
- /data/conf/valkey.conf
+ /valkey-conf/valkey.conf

@@ spec.template.spec.containers.valkey.env @@
# apps/v1/Deployment/nextcloud-dev/valkey
! - one list entry removed:
- - name: VALKEY_LOG_LEVEL
-   value: notice
! + one list entry added:
+ - name: VALKEY_PROBE_PASSWORD
+   valueFrom:
+     secretKeyRef:
+       name: valkey
+       key: default

@@ spec.template.spec.containers.valkey.livenessProbe.exec.command @@
# apps/v1/Deployment/nextcloud-dev/valkey
! - two list entries removed:
- - valkey-cli
- - ping
! + three list entries added:
+ - sh
+ - "-c"
+ - "VALKEYCLI_AUTH=\"${VALKEY_PROBE_PASSWORD:-${VALKEY_PROBE_PASSWORD_INLINE:-}}\"; export VALKEYCLI_AUTH; r=$('valkey-cli' '-p' '6379' 'ping' 2>&1); case \"$r\" in PONG|LOADING*) exit 0;; esac; echo \"$r\"; exit 1"

@@ spec.template.spec.containers.valkey.startupProbe.exec.command @@
# apps/v1/Deployment/nextcloud-dev/valkey
! - two list entries removed:
- - valkey-cli
- - ping
! + three list entries added:
+ - sh
+ - "-c"
+ - "VALKEYCLI_AUTH=\"${VALKEY_PROBE_PASSWORD:-${VALKEY_PROBE_PASSWORD_INLINE:-}}\"; export VALKEYCLI_AUTH; r=$('valkey-cli' '-p' '6379' 'ping' 2>&1); case \"$r\" in PONG|LOADING*) exit 0;; esac; echo \"$r\"; exit 1"

@@ spec.template.spec.containers.valkey.volumeMounts @@
# apps/v1/Deployment/nextcloud-dev/valkey
! - one list entry removed:
- - name: valkey-acl
-   mountPath: /etc/valkey
! + one list entry added:
+ - name: valkey-conf
+   mountPath: /valkey-conf

@@ spec.template.spec.initContainers @@
# apps/v1/Deployment/nextcloud-dev/valkey
! - one list entry removed:
- - name: valkey-init
-   image: "docker.io/valkey/valkey:9.1.3"
-   imagePullPolicy: IfNotPresent
-   command:
-   - /scripts/init.sh
-   volumeMounts:
-   - name: valkey-data
-     mountPath: /data
-   - name: scripts
-     mountPath: /scripts
-   - name: valkey-acl
-     mountPath: /etc/valkey
-   - name: valkey-users-secret
-     mountPath: /valkey-users-secret
-     readOnly: true
-   securityContext:
-     allowPrivilegeEscalation: false
-     capabilities:
-       drop:
-       - ALL
-     readOnlyRootFilesystem: true
-     runAsNonRoot: true
-     runAsUser: 1000
! + one list entry added:
+ - name: init
+   image: "docker.io/valkey/valkey:9.1.3"
+   imagePullPolicy: IfNotPresent
+   command:
+   - /scripts/init.sh
+   volumeMounts:
+   - name: valkey-data
+     mountPath: /data
+   - name: valkey-conf
+     mountPath: /valkey-conf
+   - name: scripts
+     mountPath: /scripts
+   - name: valkey-users-secret
+     mountPath: /valkey-users-secret
+     readOnly: true
+   securityContext:
+     allowPrivilegeEscalation: false
+     capabilities:
+       drop:
+       - ALL
+     readOnlyRootFilesystem: true
+     runAsNonRoot: true
+     runAsUser: 1000

@@ spec.template.spec.volumes @@
# apps/v1/Deployment/nextcloud-dev/valkey
! - one list entry removed:
- - name: valkey-acl
-   emptyDir:
-     medium: Memory
! + one list entry added:
+ - name: valkey-conf
+   emptyDir:
+     medium: Memory

@@ metadata @@
# networking.k8s.io/v1/NetworkPolicy/nextcloud-dev/valkey
! + one map entry added:
+ labels:
+   app.kubernetes.io/instance: valkey
+   app.kubernetes.io/managed-by: Helm
+   app.kubernetes.io/name: valkey
+   app.kubernetes.io/version: "9.1.3"
+   helm.sh/chart: valkey-1.0.0

@@ spec @@
# networking.k8s.io/v1/NetworkPolicy/nextcloud-dev/valkey
! + one map entry added:
+ egress:
+ -

@@ spec.ingress.0 @@
# networking.k8s.io/v1/NetworkPolicy/nextcloud-dev/valkey
! + one map entry added:
+ ports:
+ - port: 6379

@@ spec.ingress.0.from @@
# networking.k8s.io/v1/NetworkPolicy/nextcloud-dev/valkey
! - one list entry removed:
- - podSelector:
-     matchLabels:
-       app.kubernetes.io/name: nextcloud
! + two list entries added:
+ - podSelector:
+     matchLabels:
+       valkey-client: "true"
+ - podSelector:
+     matchLabels:
+       app.kubernetes.io/instance: valkey
+       app.kubernetes.io/name: valkey

@@ spec.policyTypes @@
# networking.k8s.io/v1/NetworkPolicy/nextcloud-dev/valkey
! + one list entry added:
+ - Egress

@@ metadata.labels.helm.sh/chart @@
# v1/Pod/nextcloud-dev/valkey-test-auth-existing
! ± value change
- valkey-0.12.1
+ valkey-1.0.0

@@ spec @@
# v1/Pod/nextcloud-dev/valkey-test-auth-existing
! + two map entries added:
+ automountServiceAccountToken: false
+ securityContext:
+   fsGroup: 1000
+   runAsGroup: 1000
+   runAsUser: 1000
+   seccompProfile:
+     type: RuntimeDefault

@@ spec.containers.test-auth @@
# v1/Pod/nextcloud-dev/valkey-test-auth-existing
! + two map entries added:
+ imagePullPolicy: IfNotPresent
+ securityContext:
+   allowPrivilegeEscalation: false
+   capabilities:
+     drop:
+     - ALL
+   readOnlyRootFilesystem: true
+   runAsNonRoot: true
+   runAsUser: 1000

@Kentaro1043 Kentaro1043 changed the title fix: 開発環境の Valkey チャートを 1.0.0 に更新 fix: nextcloud-dev の Valkey チャートを 1.0.0 に更新 Nov 17, 2026
@Kentaro1043
Kentaro1043 marked this pull request as ready for review November 17, 2026 08:52

@blancnoir256 blancnoir256 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

公式案内の通りになっている事を確認しました。
https://github.com/valkey-io/valkey-helm/blob/valkey-1.0.0/valkey/UPGRADE.md#networkpolicy-is-a-structured-block

可能性として下記の対応を取る必要がある可能性がありますが、一旦良さそうです。
https://github.com/valkey-io/valkey-helm/blob/valkey-1.0.0/valkey/UPGRADE.md#standalone-deploymentstrategy-defaults-to-recreate

@Kentaro1043
Kentaro1043 merged commit 3dbb023 into main Nov 17, 2026
9 checks passed
@Kentaro1043
Kentaro1043 deleted the codex/valkey-chart-1-dev branch November 17, 2026 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants