Repository navigation
#763: cluster-onboard's preflight checks the Thanos retention and the root Application - #795
Open
ephico2real2 wants to merge 3 commits into
Open
ephico2real2 wants to merge 3 commits into
ephico2real2 wants to merge 3 commits into
Conversation
… root Application docs/02, "Onboarding becomes shorter", step 2: "the Thanos Route answers, retention is at least 15 days, and the root Application exists and is Synced". After the import's checks, preflight now reads the platform Prometheus's gauge prometheus_tsdb_retention_limit_seconds of job prometheus-k8s in openshift-monitoring through the usage path's ThanosQuerier (capacity/retention.py; the shortest replica counts, 0 is no time limit, under 15 days or unreadable is a finding), and the root Application of delivery.argocd with ArgoCdSignal (only status.sync.status Synced passes; missing, forbidden or unreadable is a finding). Each check passes, is a finding, or is not applicable with its reason: retention when usage.source is none, the root Application in apply mode, in gitops mode without delivery.signal argocd, or with a per-namespace name template. notChecked is gone. Tests: test_onboard_preflight_763.py (19; 14 fail with main's preflight); test_operations_26's onboarding test asserts notApplicable. Docs: docs/02 as built, docs/21 (the new reads, citations recorded), the template comment, and the decisions with their sources in docs/reviews/2026-12-01-issue-763/README.md. Written by Opus 5.5 (high), the implementer.
…s a retention finding, not a check that does not apply; rulings recorded
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #763
Part of #26
What
cluster-onboard's
preflightstep now does what docs/02, "Onboarding becomes shorter", step 2 says: "the Thanos Routeanswers, retention is at least 15 days, and the root Application exists and is Synced", after the import's own checks.
cmapi/src/cmapi/capacity/retention.py(new):platform_retention_secondsreads Prometheus's gaugeprometheus_tsdb_retention_limit_seconds{namespace="openshift-monitoring", job="prometheus-k8s"}through the sameThanosQuerier(Route, token, trust, Baseline reader: bind cluster-monitoring-metrics-api in openshift-monitoring, not cluster-monitoring-view cluster-wide #724 grants,partial_response=false,dedup=true) as the usage reads. The shortestreplica counts; 0 is no time limit; no series or a value that is not seconds is
MetricsUnavailable.MIN_RETENTION_DAYS = 15(docs/02; no configuration key exists for it).cmapi/src/cmapi/ops/__init__.py,preflight:_retentionand_root_application. Each check is a pass (checks), afinding (
findings; the step is Failed and its note names every finding), or not applicable with its reason(
notApplicable). The outputnotCheckedis gone.capacity.yamlusage.sourceisthanos.delivery.argocd.rootApplicationindelivery.argocd.namespace, read withArgoCdSignal; itapplies in
argocdmode and ingitopsmode withdelivery.signal: argocd, not inapplymode or with another signal,nor when the name template has
{namespace}. Onlystatus.sync.status: Syncedpasses; 404, 403, an unreadable clusteror status are findings.
Decisions and sources:
docs/reviews/2026-12-01-issue-763/README.md(D1 to D6).Measured (CRC, OpenShift 4.22.14, 2026-12-01 21:47Z, read-only)
GET /api/v1/query?query=prometheus_tsdb_retention_limit_secondson CRC's thanos-querier Route answered three series:prometheus-k8s1296000 (15 days),prometheus-user-workload86400,thanos-ruler86400. With the matchers, onlyprometheus-k8s-0. Thanos Query's/api/v1/status/flagsanswered 81 flags, none on retention (option rejected, D1). CRC hasno
applications.argoproj.ioCRD and runsdelivery.mode: apply, so the root Application check is not applicable there.Tests (PostgreSQL 16 on 127.0.0.1:55432, the suite's fakes; no cluster)
cmapi/tests/service/test_onboard_preflight_763.py: 19 tests. Run with main'sops/__init__.pyin place: 14 failed, 5passed (the five test the new gauge module alone). With this change: 19 passed.
test_operations_26.py: 21 passed, itsonboarding test now asserts
notApplicable.test_doc_citations.pypassed;scripts/doc-citations.py --check0 problems(4 new citations read, then
--write).Not tested: a cluster running Argo CD (none is available without a cluster write); the reader's own token on CRC's Route for
this query (the measurement used an administrator's token; the reader's grant for
/api/v1/queryis #724's).Found
#794 (sev:low, Backlog): the example cluster folder's root Application
ocp-gf15-namespacesdiffers fromdelivery.argocd.rootApplication's defaultcluster-configs-{clusterId}.Who wrote what
Every commit and file of this PR: the implementer, Opus 5.5 at
high. Design: one design (the implementer's), no secondmodel family yet; the review is the coordinator's to run. The live Claude Doc of docs/02 still needs the same as-built
sentence as the export.