Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions kubernetes/apps/default/nextcloud/app/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,13 @@ spec:
cronjob:
enabled: true
type: cronjob
resources:

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.

Minor (question): The new resources block at the cronjob level duplicates the existing resources inside the nested cronjob key with identical values (100m/500Mi requests, 1/2Gi limits); this is either redundant or ignored by the chart, and it is unrelated to the PR's stated Ceph purpose.

Automated finding from AI PR review.

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.

⚠️ Major (question): This PR is titled feat(ceph) and its body only discusses the Ceph crash auto-archive change, yet it also adds a Nextcloud cronjob resources block — an unrelated change that should be split into its own PR per the repo convention to keep changes small and focused.

Automated finding from AI PR review.

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.

Minor (style): The new cronjob.resources block duplicates the existing cronjob.cronjob.resources block with identical values; one of the two is dead config depending on the chart schema — reconcile to a single block and remove the dead one.

Automated finding from AI PR review.

requests:
cpu: 100m
memory: 500Mi
limits:
cpu: 1
memory: 2Gi
Comment on lines +441 to +447

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- target lines ---'
sed -n '425,485p' kubernetes/apps/default/nextcloud/app/helmrelease.yaml

printf '%s\n' '--- chart/version references ---'
rg -n -C 3 'nextcloud|9\.2\.5|cronjob:' kubernetes/apps/default/nextcloud/app/helmrelease.yaml kubernetes/apps/default/nextcloud -g '*.yaml' -g '*.yml' || true

printf '%s\n' '--- cronjob resource keys in repository ---'
rg -n -C 2 'cronjob(\.cronjob)?\.resources|resources:' kubernetes/apps/default/nextcloud/app/helmrelease.yaml

Repository: Tanguille/cluster

Length of output: 40475


🏁 Script executed (no clone):

#!/bin/bash
set -eu

base='https://raw.githubusercontent.com/nextcloud/helm/nextcloud-9.2.5/charts/nextcloud'

printf '%s\n' '--- chart values ---'
curl -fsSL "$base/values.yaml" | sed -n '/^cronjob:/,/^[^ ]/p'

printf '%s\n' '--- chart templates containing cronjob resources ---'
for file in templates/cronjob.yaml templates/_helpers.tpl templates/deployment.yaml; do
  content="$(curl -fsSL "$base/$file" || true)"
  if [ -n "$content" ]; then
    printf '%s\n' "--- $file ---"
    printf '%s\n' "$content" | rg -n -C 4 'cronjob|resources' || true
  fi
done

printf '%s\n' '--- repository chart source metadata ---'
curl -fsSL 'https://api.github.com/repos/nextcloud/helm/contents/charts/nextcloud?ref=nextcloud-9.2.5' |
  jq -r '.[].name'

Length of output: 10902


🏁 Script executed:

#!/bin/bash
set -eu

python3 - <<'PY'
from pathlib import Path
from urllib.request import urlopen

release = Path("kubernetes/apps/default/nextcloud/app/helmrelease.yaml").read_text()
oci = Path("kubernetes/apps/default/nextcloud/app/ocirepository.yaml").read_text()
assert "tag: 9.2.5" in oci

base = "https://raw.githubusercontent.com/nextcloud/helm/nextcloud-9.2.5/charts/nextcloud/"
values = urlopen(base + "values.yaml").read().decode()
cronjob_template = urlopen(base + "templates/cronjob.yaml").read().decode()
deployment_template = urlopen(base + "templates/deployment.yaml").read().decode()

assert "cronjob:\n      resources:" in release
assert "cronjob:\n        failedJobsHistoryLimit:" in release
assert "resources:\n          requests:" in release

# The CronJob template enters .Values.cronjob.cronjob before resolving .resources.
assert "{{- with .Values.cronjob.cronjob }}" in cronjob_template
assert "{{- toYaml .resources | nindent 16 }}" in cronjob_template
assert ".Values.cronjob.resources" not in cronjob_template

# The sidecar uses a different, explicit path.
assert "{{- with .Values.cronjob.sidecar }}" in deployment_template
assert "{{- toYaml .resources | nindent 12 }}" in deployment_template

print("chart=9.2.5")
print("cronjob_resources_path=cronjob.cronjob.resources")
print("sidecar_resources_path=cronjob.sidecar.resources")
print("top_level_cronjob_resources_consumed=false")
PY

Repository: Tanguille/cluster

Length of output: 2441


Remove the unused cronjob.resources block.

Chart 9.2.5 reads CronJob resources from cronjob.cronjob.resources. The existing block already configures them. Use cronjob.sidecar.resources only for sidecar resources.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@kubernetes/apps/default/nextcloud/app/helmrelease.yaml` around lines 441 -
447, Remove the unused resources block under the cronjob configuration,
preserving the existing cronjob.cronjob.resources settings and using
cronjob.sidecar.resources exclusively for sidecar resource limits and requests.

Source: MCP tools

cronjob:
failedJobsHistoryLimit: 1
successfulJobsHistoryLimit: 2
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/apps/rook-ceph/rook-ceph/cluster/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ spec:
# Network optimization for 2.5Gbps
ms_osd_compress_min_size: "1024"
ms_osd_compression_algorithm: snappy
# Auto-archive Ceph crashes after 1 day (86400 seconds)
mgr/crash/warn_recent_interval: "86400"
Comment on lines +54 to +55

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.

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- target file ---'
nl -ba kubernetes/apps/rook-ceph/rook-ceph/cluster/helmrelease.yaml | sed -n '35,70p'
printf '%s\n' '--- related crash settings and issue references ---'
rg -n -C 3 'warn_recent_interval|crash archive|crash.*archive|18088|archive.*crash' kubernetes .github README.md 2>/dev/null || true
printf '%s\n' '--- recent file history summary ---'
git log -5 --oneline -- kubernetes/apps/rook-ceph/rook-ceph/cluster/helmrelease.yaml

Repository: Tanguille/cluster

Length of output: 1540


🌐 Web query:

Ceph mgr/crash/warn_recent_interval RECENT_CRASH archive semantics official documentation

💡 Result:

The Ceph configuration option mgr/crash/warn_recent_interval defines the time threshold used to determine whether a crash is considered "recent" [1][2]. By default, this interval is set to 2 weeks [1][3]. When a Ceph daemon crashes, the cluster reports a RECENT_CRASH health warning if there are unacknowledged crash reports that occurred within this interval [4][5]. To clear this warning and acknowledge a crash, an administrator can use the command ceph crash archive <crash-id> [5][3]. The semantics of archiving a crash report are as follows: - The crash report is no longer considered for the RECENT_CRASH health check [5][3]. - The crash report is removed from the list of new crashes (viewable via ceph crash ls-new) [5][3]. - The crash report remains in the system and is still accessible via the ceph crash ls command [5][3]. Crash reports are automatically purged from the cluster after the duration specified by the mgr/crash/retain_interval option, which defaults to 1 year [1][3].

Citations:


🌐 Web query:

Rook issue 18088 automatic archive Ceph crashes

💡 Result:

The issue referred to as Rook PR #18011, titled "osd: archive crash on OSD removal," addresses a bug in the Rook-Ceph crash management logic where the automatic archiving of crash reports for removed OSDs was failing [1]. In Ceph, the RECENT_CRASH health warning persists until crash reports are acknowledged (archived), even if the daemon causing the crash has been removed [2]. Rook is designed to automatically archive these crashes when an OSD is removed to prevent stale health warnings [1][3]. The bug in issue #18011 involved an inverted guard condition in the code responsible for this process [1]: 1. The code incorrectly attempted to archive crashes only if the crash list was nil, which is the opposite of the intended logic [1]. 2. Because ceph crash ls typically returns a non-nil slice, the archiving loop was effectively unreachable, causing the RECENT_CRASH warning to persist indefinitely after OSD removals [1]. 3. The PR also addressed latent issues where attempts to archive an empty crash ID (or crashes that did not match the removed OSD) could lead to spurious errors from the Ceph manager [1]. To resolve this, the fix implemented a corrected guard (len(crash) == 0) and improved the robustness of the archive loop to ensure that all matching crash entries are correctly processed and acknowledged [1]. This ensures that once an OSD is removed, the associated RECENT_CRASH warning is cleared as expected [1].

Citations:


🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- target file ---'
awk '{printf "%5d %s\n", NR, $0}' kubernetes/apps/rook-ceph/rook-ceph/cluster/helmrelease.yaml | sed -n '35,75p'
printf '%s\n' '--- commit introducing the setting ---'
git show --format=fuller --stat --no-renames b7913a4
git show --format= --no-ext-diff b7913a4 -- kubernetes/apps/rook-ceph/rook-ceph/cluster/helmrelease.yaml
printf '%s\n' '--- Rook version and CephCluster references ---'
rg -n -C 3 'rook-ceph|v1\.20\.3|CephCluster|config:|mgr/crash' kubernetes/apps/rook-ceph

Repository: Tanguille/cluster

Length of output: 18961


🏁 Script executed (no clone):

#!/bin/bash
set -eu
for endpoint in \
  'https://api.github.com/repos/rook/rook/issues/18088' \
  'https://api.github.com/repos/rook/rook/pulls/18088' \
  'https://api.github.com/repos/rook/rook/issues/18011' \
  'https://api.github.com/repos/rook/rook/pulls/18011'
do
  printf '\n--- %s ---\n' "$endpoint"
  curl -fsSL "$endpoint" | jq '{number,title,state,html_url,body}'
done

Length of output: 7983


🏁 Script executed (no clone):

#!/bin/bash
set -eu
curl -fsSL 'https://docs.ceph.com/en/latest/mgr/crash/' |
  sed -n '/warn_recent_interval/,+8p;/retain_interval/,+5p' |
  head -80

Length of output: 1027


Do not describe this setting as automatic crash archival.

mgr/crash/warn_recent_interval only controls the RECENT_CRASH warning window. It does not invoke ceph crash archive or move crash reports to the archived set. This change does not implement issue #18088. Use a mechanism that invokes ceph crash archive, or update the comment and objective to describe the warning interval only.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@kubernetes/apps/rook-ceph/rook-ceph/cluster/helmrelease.yaml` around lines 54
- 55, Correct the comment for the mgr/crash/warn_recent_interval setting so it
describes only the RECENT_CRASH warning interval, not automatic crash archival.
Do not claim this configuration archives crashes or resolves issue `#18088`;
either implement a mechanism that invokes ceph crash archive or limit this
change to the accurate warning-window description.

Source: MCP tools

mon:
# Suppress pgmap/audit debug spam; keeps INF/WRN/ERR (was debug).
mon_cluster_log_level: info
Expand Down