The ClusterRole that lets the kubevirt-csi controller get
PersistentVolumes, and its ClusterRoleBinding, were named after the
release only. They are cluster-scoped, and a release is named after the
cluster, so two tenants with a cluster of the same name render the same
pair. Installing the second one does not fail: the existing objects are
patched and adopted. Deleting either cluster then deletes the pair, and
the other cluster's CSI controller fails every ControllerExpandVolume
with "persistentvolumes ... is forbidden" until its own release is
upgraded again, so a PVC resize stays in Resizing.
Name both objects after the namespace and the release, the way the
kccm ClusterRole already is. On upgrade Helm creates the new pair before
it deletes the old one, so the driver keeps its access.
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
Assisted-by: LLM
(cherry picked from commit aaedcef7d9)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
The upgrade test from v1.7.1 to v1.7.2-rc.1 on a live cluster found
blockers in this change, so v1.7.2 ships tenant PostgreSQL as v1.7.1
had it, and the change comes back to this line once the fixes are on
main.
This reverts the unit e4b2e99378 that the 2026-11-13 backport batch
carried for #5405 (main 30ce2a3cb1).
CVE-2026-116331 stays open for tenant PostgreSQL on this line until
then: CloudNativePG publishes the fixed minors (18.7, 17.12, 16.16,
15.20, 14.25) only as bookworm and trixie images, with no bare
(bullseye) tag, so the fix needs the image move this reverts.
A cluster that ran v1.7.2-rc.1 is on the standard-trixie images
already. Moving it to this revision puts it back on the bullseye
images without the collation rebuild, so its text indexes on a non-C
collation need a REINDEX afterwards, and a database whose postgis
extension was updated to 3.7.0 does not load with the 3.6.1 image.
No stable 1.7 release carried #5405.
The picks of #5405 stay in this line's history, and backport-batch
counts an original as carried by those picks, so the next batch does not
take #5405 again.
Refs: #5459
Assisted-By: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The v1.11.6-cozystack.3 controller image adds to nginx 1.25.5 the
fixes for the remaining advisories the controller can reach, from
nginx 1.26.3 to 1.30.8.
Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
(cherry picked from commit c873a50c24)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The range over the Cloudflare ranges kept the newlines around its
actions, so the rendered geo block had an empty line between every
entry. nginx accepts either form; the trimmed one is easier to read
when debugging the generated config.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
(cherry picked from commit ed4a378428)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
With cloudflareProxy enabled, HTTPS reaches nginx from the
ssl-passthrough proxy on loopback. Without trusting that proxy, the
whitelist sees 127.0.0.1 instead of the visitor address; trusting it
without checking the PROXY-protocol peer would reopen the spoofing
closed by #4444.
Checking the transport peer before the whitelist preserves that
protection, while port 80 needs its direct peer because no
PROXY-protocol address exists there.
Tested with helm-unittest and an isolated ingress-nginx controller:
trusted PROXY peers pass the whitelist with the restored visitor
address, while spoofed headers on HTTP and HTTPS return 403.
Closes: #5327
Assisted-by: LLM
Signed-off-by: toribru <161638395+toribru@users.noreply.github.com>
(cherry picked from commit 00a540eb62)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
A worker pool rolled out with maxSurge set to its maxReplicas, so CAPI
could create up to maxReplicas replacement VMs before draining any old
one. A pool running 8 workers under a ceiling of 10 could reach 18 VMs
at the peak of an instance type, image or version change.
Those extra VMs run in the tenant's namespace. Today the namespace
ResourceQuota counts them, so a tenant near its quota sees replacement
launchers refused and the rollout stall. Under quotas as reservation
limits, where a pool reserves maxReplicas workers and the namespace
quota goes away, the surge is capacity the platform lends for the
length of a rollout: rollouts are mostly platform-driven, and counting
them against the tenant would block a platform upgrade for any tenant
whose pool sits at its ceiling. That loan has to be bounded, and with
a surge tied to maxReplicas it was as large as the pool itself.
The surge is now one Machine whatever the pool's size. It stays out of
the values: tenants write them, and would then size the platform's
margin. maxUnavailable is unchanged, so a node is still only drained
once its replacement is up; a large pool now rolls one worker at a
time.
Tested with helm unittest on kubernetes-nodes, with the golden renders
updated for the new surge.
Refs: cozystack/community#48
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit fffbb97ac9)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
A ClusterIssuer turns Ready only after cert-manager has registered an
ACME account with the CA. Under the kstatus wait helm-controller applies
by default, an unreachable Let's Encrypt endpoint, staging included,
keeps the cert-manager-issuers upgrade in progress until it times out.
Every package that dependsOn cozystack.cert-manager then waits behind
that release, so one unreachable CA leaves the platform half rolled out
while the issuers that are in use keep issuing.
Report the issuers as current through healthCheckExprs. The release
completes once the manifests are applied, and the issuers recover on
their own when the CA is reachable again.
Assisted-by: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
(cherry picked from commit 13fefcedda)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
The default flavor pinned bare image tags, which are the system variant
on Debian bullseye. Upstream stopped building that variant, so the minors
that fix CVE-2026-116331 (18.7, 17.12, 16.16, 15.20, 14.25) are published
for bookworm and trixie only. The CVE is a type confusion in the min/max
aggregate optimisation that lets a role able to create objects run code
as the operating system user of the server, and tenants hold such roles.
Pin the patched minors on standard-trixie, and move the postgis flavor to
the same minors. The standard variant, because backups go through the
barman-cloud plugin and need none of the barman binaries the system
variant adds. trixie, because the postgis flavor is on it already, so
both image families share one Debian release. PostgreSQL 13 has no
patched release: it keeps 13.22 and moves to trixie with the rest.
For a running default-flavor cluster this changes the Debian release under
the data directory. The init Job rebuilds the indexes that depend on a
collation whose library version changed.
Assisted-by: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
(cherry picked from commit b40be51a6b)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
An operand image built on another Debian release ships another glibc and
ICU. An index ordered by a collation of either library is then ordered by
rules the server no longer applies: lookups through it miss rows, and a
unique index stops seeing duplicates. PostgreSQL only logs a warning.
The init Job compares the library version each collation was created with
against the one the server reports, rebuilds the indexes that depend on a
collation whose version changed, and refreshes the recorded versions once
every rebuild in the database succeeded. A database on the C or POSIX
collation with no explicitly collated index, which is what the chart
creates by default, has nothing to rebuild and is not delayed.
The pass has to hold on a hook that starts while the instances are still
rolling, runs as the superuser in databases tenants own, and is retried
after a failure:
- It runs after the passes that manage roles and databases, so that a
rebuild that fails costs none of them, and it waits for the server to
report the PostgreSQL version and Debian release of its own image when
an index depends on a versioned collation. The rebuild counter of the
package is left out of that comparison, because a tag is rebuilt in
place.
- Every session pins search_path to pg_catalog, so that a function or an
operator a tenant defined in public cannot stand in for a built-in.
- A retry continues where the last run stopped. REINDEX CONCURRENTLY gives
an index a new OID, so the highest OID seen when a repair begins marks
what is left; an index rebuilt in place keeps its OID and is told apart
by its storage file. Both live in a setting of the database.
- A rebuild that cannot finish is not started for ever: after two
attempts the index is left to an operator, the pass says how to clear
it, and the release stays failed until then. Lock waits and in-place
rebuilds are bounded by what is left of the Job.
- A collation that a range partition key depends on keeps its recorded
version, because rebuilding an index moves no row between partitions.
PostgreSQL records a collation for an index only where it orders a key,
so the collations of the columns an index reads in its expressions and
predicate count as well. Before PostgreSQL 15 the server records no
version for a database's default collation, and the libc collation of the
same locale stands in for it.
The e2e suite creates a collation with a stale version and checks that an
upgrade rebuilds a unique index and an exclusion constraint's index on it,
refreshes the version and removes the repair setting.
Assisted-by: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
(cherry picked from commit a10e449a56)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
With tickets on and no fixed ticket key, nginx rotates the keys and,
before 1.30.6 and 1.31.7, leaves one of them uninitialized in the
worker processes, which may let a session be forged. The controller's
nginx 1.25.5 does not have the fix yet. Resumption still works through
the shared session cache, and with no fixed key tickets never resumed
across replicas anyway.
Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
(cherry picked from commit 3002f3183b)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
cozy:tenant:super-admin:base carried '*' on kubevirt.io virtualmachines.
A VirtualMachine written directly is sized outside any application: it
is not a HelmRelease the tenant ordered, so nothing that accounts for
applications sees it, and the same verbs let a super-admin raise the
guest size of a VM a VMInstance release rendered. Nothing in tree needs
the write: power goes through the virtualmachines start/stop/restart
subresources, console and VNC through the VMI subresources, size, disks
and networking through VMInstance values. The grant arrived together
with a '*' on helmreleases that was later removed; this one was missed.
watch stays, because the dashboard watches the VirtualMachine for its
live power state and no other tenant role grants it.
The tenant roles are aggregated from ClusterRoles in several packages,
so a write path can reach a tenant without touching the role that
names it; the install e2e now guards against that.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit ad47521c95)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
tenant-range-limits now defaults cpu, memory and ephemeral-storage
each only when resourceQuotas bounds that resource, and is not
rendered at all under a quota on none of them. Comments in the
operator, the tenant quota controller, the backup controller and the
barman and kafka charts still said every tenant with resourceQuotas
gets a 128Mi memory default, which would mislead the next change made
on that assumption.
The tenant quota controller's gate on limits.cpu or limits.memory
stays: a root rendered by an older chart may still carry a LimitRange
under a quota that bounds no compute.
Assisted-by: LLM
Signed-off-by: Nimesh Kulkarni <167794819+GitNimay@users.noreply.github.com>
(cherry picked from commit 46f03b8748)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The tenant chart rendered tenant-range-limits whenever resourceQuotas
was non-empty. Its 128Mi default memory limit then applied under a
quota on load balancers, storage or GPUs alone, or on cpu or
ephemeral-storage without memory, and refused any pod that requests
more memory without a limit of its own, virt-launcher included, so
VMs could not start in such a tenant.
The LimitRange is there so pods without requests or limits pass a
quota that tracks cpu, memory or ephemeral-storage. Default each of
those three only when the flattened quota bounds that resource, and
render no LimitRange when it bounds none of them. A quota on all
three renders the LimitRange exactly as before, with the same values.
Closes: #4930
Assisted-by: LLM
Signed-off-by: Nimesh Kulkarni <167794819+GitNimay@users.noreply.github.com>
(cherry picked from commit 6014860c93)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The system databases (Keycloak, Harbor, Grafana, Alerta, SeaweedFS) are
pinned to PostgreSQL 17.7, which is affected by CVE-2026-116331: a type
confusion in the min/max aggregate optimisation lets a role that can
create objects run code as the operating system user of the server.
The 17.x line fixes it in 17.12.
Move the pin to 17.12-standard-trixie. The image variant and the Debian
release stay the same, so glibc and ICU do not change under the data
directory. Clusters on another major keep their image, as before.
Assisted-by: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
(cherry picked from commit 8800d0177b)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The WorkloadMonitor controller finds BucketClaims by the monitor's
label selector. The registry BucketClaim carried no labels, so it
never got a Workload and Harbor's object storage was invisible to
billing. Before the registry moved to S3 its PVC carried the vendored
chart's release and component labels and was reported under the
registry monitor; labelling the BucketClaim the same way restores that.
Assisted-by: LLM
Signed-off-by: Ray Low <crossrt@gmail.com>
(cherry picked from commit 732165eebd)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The LinstorCluster set no nfsServer.podTemplate, so the
linstor-wait-node-online init container of the NFS server DaemonSet ran
piraeus-operator's default CSI image. That image follows the operator
release, not linstorCSI.image, so a cluster that pulls only from a
mirror of the platform images still needed quay.io for it, and a client
behaviour change between the two (as with the certificate variables)
would reach this container without the platform choosing it.
Pin it to linstorCSI.image like the CSI node and controller pods.
nfsServer.enabled is set explicitly, because the operator treats an
absent nfsServer as enabled.
Closes: #5307
Assisted-by: LLM
Signed-off-by: Adham Kiwan <adhamkiwan@outlook.com>
(cherry picked from commit 323bd8bd33)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
In DNS-01 mode every inheriting child tenant's apex went into the
parent Gateway's wildcard Certificate. When a wildcard in the same
Certificate already covers that apex one label up, Let's Encrypt
refuses the whole order as redundant and the parent Gateway gets no
certificate at all. Skip such a SAN, matching the single-label check
Boulder runs in wildcardOverlap.
A child may also use a broader custom domain than the gateway. Its
wildcard then covers the gateway apex, so the same check drops the
gateway SAN too.
Closes: #5125
Co-authored-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
Assisted-by: LLM
Signed-off-by: somaz <genius5711@gmail.com>
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit 8382ed1a92)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
linstor-affinity-controller and the linstor-scheduler extender read their
LINSTOR API client certificate from secretKeyRef env vars, which kubelet
resolves only when the container starts. cert-manager renews these 90-day
certificates every 60 days, but neither workload is restarted on rotation,
so a pod that lives longer than the certificate keeps presenting the expired
one. The controller then refuses every new TLS handshake and the Go client
reports a bare EOF.
For the affinity controller this means PV node affinities stop following
replica moves; for the scheduler, once a pod with an expired certificate
holds the leader lease, pods with LINSTOR volumes are no longer placed next
to their replicas.
Add the Reloader auto annotation to linstor-affinity-controller through the
LinstorCluster patches, as already done for the controller and the CSI
workloads, and annotate the linstor-scheduler Deployment with the client
secret it consumes. The scheduler annotation goes on the Deployment rather
than podAnnotations, which the admission Deployment shares and would roll
for a secret it does not use.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit f7c1850017)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
s3-service-name.patch renames the S3 Service to <name>-s3, but the Lance
catalog that arrived with chart 4.45 still builds the name from
seaweedfs.componentName, which gives <fullname>-s3. With the catalog on
and a fullname that differs from the chart name, the Lance ingress
points at a Service that does not exist and the worker gets a Lance URL
that does not resolve. The shipped values hide this because lancePort
is 0 and fullnameOverride makes both names equal.
Carry both consumers in s3-service-name-consumers.patch, the same way
the S3, Iceberg and COSI consumers are, and cover them in the consumer
tests with the catalog turned on.
Closes: #4878
Assisted-by: LLM
Signed-off-by: Adham Kiwan <adhamkiwan@outlook.com>
(cherry picked from commit 2de43d406c)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
CNPG bootstraps an "app" owner role with a generated password stored in
<release>-app, and a declared users.app adopts that role. The init-job
then sets the role's password from <release>-credentials, but CNPG's
instance manager re-applies the owner's password from the bootstrap
secret whenever it meets a secret version it has not applied, which
includes every pod start. Any restart therefore reverts users.app to
CNPG's generated password, and clients holding the advertised one get
"password authentication failed" with nothing changed on their side.
Render the owner's bootstrap secret from the same password the
credentials Secret holds, and point the live bootstrap method at it, so
both writers agree on one value.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit 62dee1d132)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
Since 1.7 cozystack-route-hostname-policy requires spec.hostnames to be
present and non-empty on HTTPRoute, TLSRoute and GRPCRoute in tenant-*
namespaces, so the edge-termination section no longer matches the
platform. The website builds its Gateway reference page from this
README, so the stale sentence would be published as is.
Refs: #4938
Assisted-by: LLM
Signed-off-by: Adham Kiwan <adhamkiwan@outlook.com>
(cherry picked from commit 5c690f96bd)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The failed-job sweep treated a Completed Velero backup as deletable. A
BackupJob can fail after Velero completed, when creating or recording its
Backup fails transiently, and that Velero backup may be the only copy of a
good backup. The sweep now deletes only Failed, PartiallyFailed and
FailedValidation backups, also when several Velero backups reference one
job, and it reads the Backups that may reference them through the uncached
API reader, so a Backup the cache has not seen yet still protects its data.
The Velero strategy no longer requests the deletion before it records the
failure. If that status write failed, Velero removed the backup and the
retried run created a new one, so the failure was lost. The deletion now
comes only from the sweep, which runs on the reconcile that the persisted
Failed phase triggers; the BackupJob watch has no predicate that drops
status updates.
Replacing a request that Velero processed with errors deletes it, and the
backupstrategy-controller ClusterRole only allowed create, get, list and
watch on deletebackuprequests. That Delete failed with 403, and since the
Backup finalizer uses the same helper, a Backup deletion could get stuck
on it. The rule now includes delete.
Nothing watches DeleteBackupRequests, so the sweep did not run again after
Velero processed a request with errors. A Failed job now requeues every
5 minutes while a failed Velero backup of it remains, which replaces such a
request, and every minute while one is still running, instead of every 5
seconds.
Unit tests cover a rejected Failed status write, Completed, Deleting and
FailedValidation backups, a request processed with and without errors, the
UID precondition on the replacement, a Backup visible only to the uncached
reader, and API errors from the helper.
Refs: #5355
Assisted-by: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
(cherry picked from commit 887453c008)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
Since SeaweedFS 4.08 the S3 gateways move every identity from
/etc/iam/identity.json into /etc/iam/identities/<name>.json, and the
COSI driver up to v0.3.1 revokes only from identity.json. Every
BucketAccess deleted on such a filer left its identity file behind,
with its keys still accepted (seaweedfs/seaweedfs-cosi-driver#11). A
driver that deletes the file on revoke does nothing for the files
already left.
A post-install/post-upgrade hook removes a ba-<uid>.json file when no
BucketAccess in any namespace names it, by uid or by
status.accountID. The uid covers a BucketAccess still being granted,
the accountID one restored with its status. The identity directory is
listed before the BucketAccesses: a BucketAccess exists before its
grant writes a file, so a file seen in the first listing whose
BucketAccess still exists is always named by the second. File ages are
not used, because grants and gateway migrations rewrite left-over
files as well. A failed or empty listing removes nothing. Each removal
is logged and recorded as an Event on the HelmRelease. The hook runs
before the Object Lock hook, so in delete mode a left-over identity is
removed before that hook grants it anything.
A filer published for Client-topology clusters holds identities whose
BucketAccesses live in those clusters, so cosi.orphanIdentities
defaults to auto: report there, delete otherwise. An operator can
force either.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
(cherry picked from commit 045f1a9bbc)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
failurePolicy Ignore applies only after the timeout; the Pod CREATE
webhooks are called sequentially within one request, so their waits
accumulate and can pass the request deadline.
Assisted-by: LLM
Signed-off-by: Yasar Rahman <yasar.rehman@gmail.com>
(cherry picked from commit d1b472319a)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The VPA admission controller registers its Pod CREATE webhook in every
namespace with failurePolicy Ignore and a 30s timeout. When its pod is
down and the Service IP blackholes (a cold start after a full cluster
shutdown, before the CNI is back), each Pod creation waits the full 30s
here on top of the other webhooks and fails with "context deadline
exceeded". That includes the CNI's own DaemonSet pods, so the cluster
cannot recover without deleting the webhook configuration by hand.
A mutation takes milliseconds; 5s keeps slow responses working and lets
Ignore actually ignore. Uses the admission controller's documented
--webhook-timeout-seconds flag through the chart's extraArgs.
Refs #3125
Assisted-by: LLM
Signed-off-by: Yasar Rahman <yasar.rehman@gmail.com>
(cherry picked from commit 291b1fa3c0)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The limit that floors to 0MiB is anything under 4/3 Mi, not under 2Mi:
1536Ki still yields 1MiB. The message named the wrong bound and the
tests pinned 2Mi and 1Mi, neither of which sits on the edge.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit 3b893c626a)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
Every SeaweedFS component is a Go binary running under a cgroup memory
limit, and none of them set GOMEMLIMIT. The collector then works from
GOGC alone, a target relative to the live heap with no absolute ceiling,
so a burst of allocation grows the heap past the limit and the kernel
kills the container.
Seen on an S3 gateway holding 6.4 GiB of heap_sys against an 8 GiB limit
while only 389 MiB was actually in use: ten kills in seven days, each one
an interruption of the object store every tenant writes its backups to.
Raising the limit does not help, since nothing bounds the growth; it only
moves the ceiling the heap climbs to.
Derive the value from the limit already computed for each component, at
the same 75% the javaHeap helper uses for the JVM. The remaining quarter
covers what GOMEMLIMIT does not account for, goroutine stacks and mmap'd
regions among them.
Volume pools and zones carry their own value: the subchart merges volume
into every entry of volumes, so a pool would otherwise inherit the value
sized for the default volume's limit, above its own. The lifecycle admin
and worker run the same binary under limits the parent chart does not
set, so their value is pinned next to those limits.
A limit under 2Mi floors to 0MiB, which Go accepts and then collects
almost continuously; the render fails instead.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit e3e2018075)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
A release that already sets backup.schedule to "0 2 * * *" runs hourly
at minute 2 today and daily at 02:00 after this change. The README now
says so and gives "0 2 * * * *" for keeping the hourly run.
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit c0c5f2580f)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The mongodb app and backup Plans take a standard five-field cron, but
the postgres chart hands backup.schedule to a CloudNativePG
ScheduledBackup, which parses it with robfig/cron v1 Parse. That parser
reads the first field as seconds and makes day-of-week optional, so a
five-field value passes admission with only a warning and runs one
field off. 0 2 * * * runs hourly and 5 * * * * every minute.
A five-field schedule now gets a leading 0 seconds field. Six fields
and descriptors pass through, and any other field count fails the
render. A release that already sets five fields gets the standard
meaning on upgrade, so 0 2 * * * goes from hourly to daily.
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit 982db83dd2)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
A backup Pod that loses sight of its upload, by dying or by losing six
polls in a row, is retried while the sidecar finishes that upload. The
retry found it in the action log as a success, took the sidecar for
idle and asked for create_remote with resume again. clickhouse-backup
then rebuilds the local backup and uploads it once more over the
archive already in the bucket, which is left broken if that second
upload dies halfway.
The archive name belongs to one BackupJob, so a success row of exactly
this upload can only be an earlier attempt's, and the retry now takes
it as its result. An error or cancel row still leads to a resumed
upload, and a restore still runs again, since a restore is not named
per RestoreJob.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit d530ca8cf5)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The restore path resolves its archive from list/remote before the start
gate runs, so it carries its own wait for a sidecar that is not up, and
only the backup path had a test for a sidecar that never answers. The
retry comment also miscounted: the limit is attempts, not retries.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit ae1e1830ce)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
restore_remote drops every table it restores before recreating it, so
running it twice discards whatever was written after the first run
finished. The strategy Job retries a failed Pod up to twice, and with
the start gate waiting for an idle sidecar instead of hitting 423, a
retry whose predecessor died after its POST waited for that restore to
finish and then started a second one. A retry now takes over a
restore_remote of the same archive that is still running.
A finished row is not taken over: the sidecar never trims its action
log, so a success row of the archive may belong to an earlier
RestoreJob, and treating it as this one would report a restore that
never ran. A retry that arrives after the restore finished therefore
still runs it again.
Once the operation is accepted, one failed poll no longer ends the
attempt under errexit; six in a row do. An operation that ends
cancelled now fails the Pod instead of being polled forever.
A retried backup still starts a new create_remote, because its archive
name changes on every attempt; taking it over needs a name fixed for
the whole BackupJob.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit 993b79bb37)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The sidecar keeps its action log only in memory, so a sidecar restart
after create_remote was accepted drops the operation's row, and the
strategy kept polling for it forever under a Job with no deadline.
Until now the resumed upload re-added a row ending in the archive name
and ended the loop, but resume is now off so a failed attempt never
reaches the bucket, which leaves nothing to end it. The row is logged
before the POST is acknowledged, so its absence means the operation is
gone and the attempt has to fail.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit d0a73302d9)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The sidecar refuses a new operation with 423 while another one is in
progress, but the strategy only waited for the API to answer, and went
on to start its operation even when it never did. An operation already
running in the sidecar therefore failed the attempt within seconds.
Poll the action log until nothing is in progress, and fail the Pod
instead of proceeding when the sidecar stays busy or unreachable, so
the failure names the cause rather than surfacing as a 423 or a
connection error from the operation itself.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit a25db5aeb6)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
create_remote keeps its local backup when the upload fails, and with
the upstream defaults the sidecar never prunes local backups and
resumes every unfinished upload when it starts. A strategy attempt that
fails mid-upload therefore lands in the bucket on the next sidecar
restart as an archive no Backup refers to, and restore can pick it as
the newest one. The resumed upload also holds the API lock, so the
strategy Pods racing it get 423 and burn the Job's retries.
Turning the resume off keeps a failed attempt out of the bucket, and a
negative local retention leaves at most the newest local backup and
drops it once its upload succeeds, so leftovers no longer accumulate on
the data volume.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit 4f3f1a5cad)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
db.storageClass went unquoted into the values of the database release
and again into its CNPG Cluster. A class name made only of digits,
which Kubernetes allows, became a number that the Cluster rejects, and
a line break in the value could add keys to the database release
values. It is quoted at both steps.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit f5114ae04c)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
Pool and zone storage classes were wrapped in quotes by hand, which
does not escape a quote or a backslash in the value: a quote closes the
string early and the data-plane release values stop parsing, with a
YAML error that does not name the field. They are now quoted like the
volume and admin classes.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit e6eb3345c6)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The master, filer, volume index, log and all-in-one claims of the
upstream chart write storageClassName unquoted, like the data claims
did, so a class name made only of digits renders as a number and the
claim is rejected. None of them is set by Cozystack today, but they
are values of the same chart that a later change can start handing on,
and the patch already exists for the data claims. They follow the same
rule: quoted, and left out when no class is named so that the cluster
default applies. The deprecated filer.enablePVC claim is left alone:
it renders only with filer.data unset, and the template fails earlier on
an unset filer.data, so it cannot be reached.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit f83db514b0)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The upstream admin and volume StatefulSets write storageClassName
unquoted, so a class name made only of digits, which Kubernetes allows
and the parent chart now hands on as a string, turned back into a
number there and the claim was rejected. The field is quoted, and left
out when no class is named: quoting an empty value would set an empty
storageClassName, which disables dynamic provisioning instead of using
the cluster default. Upstream 4.52 and master still write both fields
unquoted, so this is a chart patch, applied with --forward so make
update stops once upstream carries an equivalent change.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit e7b5a5a1a9)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The volume and admin storage classes were written unquoted into the
values of the data-plane release. A class name made only of digits,
which Kubernetes allows, arrived there as a number, and a value with a
line break could add keys next to the field, past the schema that is
the tenant's input gate. Both are now quoted. lifecycle.storageClass,
new in this release, also carries the StorageClass name rules in its
schema, so a value that cannot name a class is refused when the
application is written instead of leaving the admin claim pending.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit 7c9aa2fe10)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
volume.storageClass is picked for volume server data, and in a
MultiZone instance it can name a class whose volumes exist in one zone
or on one node. Reusing it for the admin volume would tie the admin to
that zone or node, so losing it would stop lifecycle enforcement for
the whole instance, a placement nobody chose for the admin. The admin
volume now takes lifecycle.storageClass, and the cluster default when
that is empty.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit 5cbb3a633e)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The daily walk that expires objects sends its deletes without an object
identity, and the s3 server skips its compare-and-swap when none is
given (walker_dispatcher.go and identityMatches, unchanged from 4.45
through 4.52). It does not re-check the object's age either, so a key
overwritten between the walk's listing and the delete loses its new
content. Backup buckets write unique keys and barely meet that window;
a tenant bucket that rewrites a fixed key does.
Turning enforcement on by default would also start applying, on
upgrade, every rule that was stored and ignored until now. Both are
retention changes an operator should choose, so the admin server and
the worker now run only where lifecycle.enabled is set. On by default
can return once the walk carries identity.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit 62b4213784)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The worker is a one-replica Deployment, so a rollout surges a second
pod before stopping the first, and the subchart pins worker pods apart
with a hard hostname anti-affinity. On a single-node cluster the surge
pod never schedules and the release waits out its timeout on every
change to the worker template. A preference keeps the spread where
there are nodes for it, as the master and s3 settings here already do.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit 7eabb9b517)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The dashboard reads an application's WorkloadMonitors by name through
its resource-map Role, so the admin and worker monitors the lifecycle
switch adds were invisible to the tenant: the components ran, but the
application page never listed them.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit a6f4f557f3)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The backport becomes redundant once the vendored chart reaches 4.46.
Re-applied to a chart that already carries the section, BSD patch takes
it as reversed, removes the section and exits 0, so a re-vendor would
quietly return the s3 gRPC listener to plaintext. --forward refuses an
already-applied patch with a non-zero exit, which stops the update at
the point where the patch should be dropped.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit c3d1a73d8c)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The admin volume and the two lifecycle pods are new demands on tenant
quota, so an upgrade into a namespace with no headroom can wait out its
timeout. Flux's default remediation then rolls the release back, and
with unlimited retries it does so on every attempt: each rollback drops
the [grpc.s3] section and the s3 restart annotation, each retry brings
them back, and the s3 pods restart twice per cycle until quota frees up.
RetryOnFailure keeps what was applied and retries it, as the parent
release that the apiserver builds for the application already does.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit a70a1cf83b)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
SeaweedFS accepts and stores a bucket lifecycle configuration, but only
the s3_lifecycle job of its plugin worker acts on it, and that job is
scheduled by the admin server. Neither ran here, so a rule returned 200
and no object ever expired, on the platform backup bucket and on tenant
buckets alike, and the documented way to bound backup storage did
nothing.
Both now run in Simple and MultiZone instances, behind lifecycle.enabled
(on by default). A Client instance has no data plane of its own; its
rules are enforced where the master it connects to runs. The worker
registers for s3_lifecycle alone, so enabling lifecycle does not also
start vacuum, balancing or erasure coding. The admin keeps its job state
on a small volume (on volume.storageClass when set), and its UI gets a
generated password, because a tenant namespace admits traffic from the
whole cluster and the server is unauthenticated without one. The
data-plane chart keeps both off unless its parent turns them on, so it
never starts an admin without that password.
Existing rules start applying minutes after the upgrade: the admin's
scheduler runs the first pass within one idle cycle of its lifecycle
lane, then once a day, and objects the rules have already expired are
deleted on that first pass.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit f36d864e99)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>