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>
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>
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>
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 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>
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>
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>
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>
When Hubble Relay is enabled at tenant cluster creation, hubble-relay waits on DNS resolution for hubble-peer.cozy-cilium.svc.cluster.local before the Cilium HelmRelease becomes Ready. Because the CoreDNS HelmRelease declared dependsOn on Cilium, Flux blocked CoreDNS installation until Cilium was ready, creating a circular deadlock.
Removing dependsOn from CoreDNS lets both HelmReleases reconcile concurrently: CoreDNS pods remain Pending without a CNI and retry via spec.install.remediation.retries: -1 until Cilium comes up, at which point CoreDNS starts and unblocks Hubble Relay.
Closes: #5315
Assisted-by: LLM
Signed-off-by: anikethinge <anikethinge4@gmail.com>
(cherry picked from commit a91689ad8a)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
TLS-enabled Qdrant rejects the ServiceMonitor's HTTP requests. The
vendored chart exposes no scheme or CA value, so patch its endpoint
through the existing HelmRelease post-renderer mechanism. Trust the
issued CA and use a certificate SAN without disabling verification.
Tested the app-to-system chart render through Kustomize for explicit
TLS, external default TLS and explicit opt-out; the TLS cases fail
without the patch.
Fixes: cdb03a9929 ("feat(qdrant): implement TLS in Helm templates")
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit d009a1e737)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
CVE-2026-114938 is an out-of-bounds write in the AVX-512 VBMI Base64
decoder of OpenJDK 17.0.6 and later, reachable on x86-64 hosts with
attacker-supplied Base64. OpenSearch decodes the Basic credentials of a
request before it authenticates it, so a tenant's cluster is exposed to
anyone who can reach its HTTP port.
Two of the three versions this chart offers bundle an affected JDK:
opensearchproject/opensearch:3.0.0 carries 21.0.7 and 2.11.1 carries
17.0.8. 1.3.20 carries 11.0.25, which is not affected. OpenSearch has
not released a build on a patched JDK yet.
Start the nodes with -XX:-UseBASE64Intrinsics, which removes the
vulnerable code path and leaves the other AVX-512 optimizations in
place. It is delivered as a jvm.options.d file mounted from a
ConfigMap, because neither obvious route works: bin/opensearch-env
unsets JAVA_TOOL_OPTIONS, and setting nodePools[].jvm makes the
operator stop sizing the heap from the memory request. The operator
mounts general.additionalVolumes into the node pools and the bootstrap
pod alike.
Rolling this out restarts every OpenSearch cluster once.
Tested with helm unittest, and by starting 3.0.0, 2.11.1 and 1.3.20
with the file mounted: each server JVM runs with the flag, and the heap
passed in OPENSEARCH_JAVA_OPTS still applies.
Assisted-by: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
(cherry picked from commit 65f0943710)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
A tenant with hugepages-2Mi or hugepages-1Gi in resourceQuotas got both
requests.hugepages-<size> and limits.hugepages-<size> in tenant-quota.
A ResourceQuota accepts huge pages only as hugepages-<size> or
requests.hugepages-<size>, so the apiserver rejects tenant-quota and the
tenant release fails to install or upgrade. Huge pages are not counted
in limits.memory either, so without this key a VM whose memory is
backed by huge pages runs outside the tenant quota.
The limits side is dropped for hugepages-* the same way it already is
for storage. sanitize still emits equal requests and limits, which is
what a pod spec needs for huge pages, so only the quota rendering
changes.
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
Assisted-by: LLM
(cherry picked from commit 38a32445f7)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
The case that resizes the other components looked only at nginx and
the portal, so it would keep passing if those overrides stopped
reaching the nested release, and then it could not catch nginx or the
portal following another component's values. It now checks the core,
registry and jobservice limits it sets and leaves trivy alone, as
nothing in the case reads it. The portal case also checks its memory
request, as the nginx case does.
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit 1d8bea039b)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
Both containers run nginx with worker_processes auto, so their idle
memory follows the CPU count of the node, whatever their own CPU limit
is. In a tenant namespace a container without resources gets the
LimitRange default of 128Mi, which the proxy outgrows on a node with
many CPUs before it serves a request. The presets that keep both out
of that default have no test, so dropping them or tying them to
another component's values would go unnoticed.
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit 7c0634586b)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
The ComputePlane wrapper forwards only the pool fields it names, and maxUnavailable was not one of them. A ComputePlane pool without room for one extra VM therefore had no way back to the drain-first rollout, and its rollouts stalled.
CAPI decodes maxUnavailable as an int32, so a value above 2147483647 passed the chart schema and was then refused by the MachineDeployment decoder.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit 525e416134)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
With maxUnavailable 0 a pool short of quota or capacity for the
replacement VM stalls its rollout instead of shrinking. The field
description, which also feeds the API and dashboard documentation, now
says so and names maxUnavailable: 1 as the way out.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit ed40d83323)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
A Proxmox template that passes a GPU through leaves gpus empty, so the
chart renders maxUnavailable 0 for that pool and its replacement VM
waits for the GPU the old worker still holds. The pool can now say so
itself with maxUnavailable, which overrides the 0, or 1 with gpus,
that the chart derives otherwise.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit 670f33d68c)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
A replacement VM in a pool with passed-through GPUs may need the very
GPU the old node holds. With maxUnavailable 0 it would stay Pending
and the rollout would never finish, so those pools keep removing a
node first.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit 392bbb3c96)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
A worker pool rollout (instance type, image or version change) ran with
maxUnavailable 1, so CAPI drained and deleted an old Machine as soon as
its replacement had been created rather than once it had joined. A
one-node pool was left with no node for the few minutes the new VM
took to boot and register, and every pool lost one node of capacity
for each step of the rollout.
With maxUnavailable 0 a node is only drained once its replacement is
up. The surge stays at the pool ceiling, with a floor of 1 because
CAPI refuses a rolling update where both values are 0 and maxReplicas
may be 0.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit 55066b981d)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
The Service rendered ports 6443 and 50000 under httpAndHttps, while the
Deployment declares the kubernetes and talos container ports and HAProxy
binds those frontends only under kubernetesAndTalos. So with the default
values every Service carried two ports whose targetPort names no
container declares, with no endpoints behind them, and with
external: true the LoadBalancer Service carried them as well. A release
with kubernetesAndTalos and without httpAndHttps got no Service port for
those frontends at all.
kubernetesAndTalos is not documented in values.yaml, but the apps API
keeps the top level of spec open and hands it to the chart as values,
so the key reaches the chart and the Deployment and the ConfigMap
already follow it. Gating the Service on the same key keeps the three
templates in step, while dropping the block would leave HAProxy
listening on ports that no Service exposes.
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit 78cadf53f9)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
The apps API admits release names of up to 53 characters, and several
charts name a Job <release>-<suffix>. Kubernetes copies a Job name into
the job-name label of its pods, and a label value takes at most 63
characters, so the apiserver refused these Jobs for the longest names. A
Kafka whose name has 42 to 44 characters could not be installed, a
VMDisk of 37 or more could not grow, a VMInstance of 40 or 41 could not
take an instance type, profile or external change, and a Bucket of 44 or
more or a Qdrant of 42 or more failed its post-delete hook. Those Job
names, and the pod label vm-instance copies from one, are now cut to 63
characters. A release name is never longer than 53, so only the fixed
suffix is cut and two releases still get two Jobs.
A CronJob name is refused over 52 characters, because the controller
names each Job it starts <cronjob>-<timestamp>. With the backup CronJob
on, a MariaDB whose name has 38 characters or more and a ClickHouse of
35 or more failed the whole release. A cut there reaches into the
release name and could give two releases one CronJob, so a name that
does not fit becomes the release name cut to 38 characters, a hash of
the full release name and -backup, the way the ClickHouse Keeper name
is already shortened.
The tenant cleanup Job is named after the tenant namespace, which a
nested tenant can fill to 63 characters by itself. The Job runs in
cozy-system next to that of every other tenant, where a plain cut could
give a parent and its child one name and let the child's
before-hook-creation delete the parent's Job while it runs, so it is
shortened with a hash of the namespace the same way.
Names that fit render exactly as before, and a name that did not fit
never produced an object, so nothing is renamed on upgrade. The hook
ServiceAccounts, Roles and RoleBindings have no such limit and keep
their names.
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit a2c9c07a16)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
A VMDisk created with source upload waits in UploadReady for an image,
but no tenant role can fill it. virtctl image-upload reads the disk PVC
and CDI's PVC Prime and requests an upload token, and the tenant roles
grant neither get on persistentvolumeclaims nor create on
uploadtokenrequests, so the command stops on a forbidden PVC read.
cozy:tenant:admin:base now grants both, so tenant admins and
super-admins get them in their own namespaces through the existing
RoleBindings, while the use and view tiers do not. Reading the
DataVolume is already granted for the disk's own name by the vm-disk
chart's dashboard role. The vm-disk notes print the command with
--no-create, because the chart has already created the DataVolume, and
the security self-assessment and threat model list the new grants.
The rules, their tests, the notes change and the docs lines come from
#3847, which also carries a console upload panel and an upload proxy
certificate that are still in review there.
Fixes#3759
Co-authored-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit bcc5f3216a)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
CDI checks a clone against its source before it creates the claim. When
the golden image's PVC is in Block mode and requests more than the disk,
it records CloneValidationFailed and leaves the DataVolume pending for
good. The DataVolume spec is immutable, so raising storage on the VMDisk
afterwards changes nothing, and the resize hook finds no claim to patch.
Every image in vm-default-images is 20Gi on replicated, where CDI picks
Block mode for the LINSTOR driver, while the chart defaults storage to
5Gi, so a disk created from an image at the default size never comes up.
The chart now refuses such a disk at render time and names both sizes,
so the user sets storage to the golden's size before any DataVolume
exists. It compares what validateClone compares in CDI v1.66.1, the
golden PVC's request against the disk's request raised to the target
StorageProfile's minimumSupportedPvcSize. A Filesystem golden is not
compared, because CDI sizes that clone from the image inside it or with
a filesystem overhead, and neither is a golden whose PVC does not exist
yet. An existing disk is exempt, as for the other golden checks.
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit 8d82348e85)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
The sidecar was left without a CPU limit so that a throttled sidecar
would slow WAL archiving down rather than fail it. In a tenant with
resourceQuotas that does not hold: the tenant LimitRange gives every
container a 250m CPU limit by default, so the sidecar gets it and
compresses full backups and WAL segments on a quarter of a core. A
1.6 GB database took 30 minutes to back up.
Set an explicit one-core limit in both places that build the sidecar
configuration, the backup driver and cozy-lib, the same way the memory
request and limit already override the LimitRange defaults.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit f1dd2d17fc)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
The API server rejects a Service that declares no port, so a VM switched
to external PortList with an empty port list could not be upgraded: the
release failed and was retried forever, while the old Service kept the
previously listed ports open.
Render a single SCTP placeholder in that case. cozy-proxy only admits
TCP and UDP ports into its PortList filter, so the VM keeps its external
IP for egress and ICMP while all inbound TCP and UDP traffic is dropped,
which is what an empty port list means.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit c6f1d6c559)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
An empty _namespace.ingress means no ingress-nginx serves the tenant,
which tenant-root now reports when the root Tenant has ingress off. The
Ingress would carry ingressClassName "", which the API rejects, and the
release would fail to install where it used to leave an unserved
Ingress behind.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit c61e6a842e)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
The monitoring-agents chart reads vmagent.remoteWrite.urls as a list and
takes the tenant label from global.target, while the kubernetes app still
passed a single remoteWrite.url and vmagent.externalLabels.tenant. Both
keys were dropped in silence, so the vmagent of every tenant cluster fell
back to the chart defaults: it wrote to vminsert services in
cozy-monitoring that do not exist inside the tenant cluster, queued the
failed writes on the node disk, and labelled every series
tenant="cozy-monitoring". No tenant cluster metric reached the tenant's
Monitoring.
The tenant label has to name the tenant that owns the cluster, which is
not always the tenant whose Monitoring receives the data: a tenant
without its own Monitoring inherits a parent's.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit 55d6c52fab)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
postgres, template0 and template1 were accepted in databases and handled
like an application database. The init job made <db>_admin their owner,
installed the auto-grant event trigger in them and, once the entry left
values, ran DROP DATABASE on them. That DROP can only fail (template
databases cannot be dropped, and the job is connected to postgres), so
every later upgrade failed in the init job and the release stayed in
UpgradeFailed even after the entry was put back. template1 also passed
the takeover on to every database created from it afterwards, where the
trigger, naming a role about to be dropped, makes CREATE SCHEMA fail.
A release a previous version let take one of them over has to be
repaired without dropping it, and without touching what this chart did
not create: a role or owner that merely carries an expected name may
belong to a tenant or an administrator, and a role comment can be set
by any CREATEROLE holder, so only the cozystack:managed mark is trusted.
What the marked roles own goes to cozystack:orphaned rather than to the
superuser, since a tenant's SECURITY DEFINER function would otherwise
run with superuser rights. A failed lookup of the databases cloned from
template1 has to stop the run before template1 stops being selected, or
those clones would never be repaired.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit f003851338)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The air-gapped note said in-guest image pulls honour no per-tenant
mirror until a Phase 2 that has landed, so an operator setting up an
air-gapped cluster would read that mirroring is unavailable and file
an issue. It now says the Secret and the platform registries value are
removed, that a Package still setting the value keeps installing, and
that worker mirrors are set per pool through talos.registryMirrors of
the KubernetesNodes resource.
Assisted-by: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
(cherry picked from commit 41507e36aa)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The long-name case checked only that the Job name fits in 63 characters and that the Job targets the right PDB. A Job name that dropped the release, letting two releases' hooks replace each other, or a Role granting a different PDB would both have passed.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit 9fba8af69c)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The operator runs three Redis pods when the count is zero or negative, but the chart treated any count up to 1 as the single-pod case. Such a cluster got one Sentinel and no Sentinel PDB, while three Redis pods ran under it.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit a7f84242d1)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The API server copies a Job's name into its pods' job-name label, which
takes 63 characters at most, and a release name may take 53, so
<release>-sentinel-pdb could be refused and leave the stale PDB in
place. The Job name is truncated; the ServiceAccount, Role and
RoleBinding keep the full name.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit 2541aec625)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
Setting sentinel.disablePodDisruptionBudget only stops the operator from
ensuring the PDB; it never deletes the one it created while three
Sentinels ran. An existing instance scaled to one Redis pod therefore
kept minAvailable 1 on its single Sentinel, which refuses every
eviction. A post-upgrade hook deletes rfs-<release> in that case.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit 7c1bd33b08)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The chart pinned three Sentinels whatever the replica count, so a
single-pod instance paid for three pods that have nothing to fail over
to. One Sentinel is enough for the operator to locate the master: its
quorum is replicas/2+1, which is 1.
The operator gives the Sentinel Deployment a PodDisruptionBudget with
minAvailable 1 whenever Redis has two replicas or fewer. On a single
Sentinel that budget refuses every eviction and would block node
drains, so it is disabled in that case. From two Redis pods up nothing
changes: three Sentinels, budget kept.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit 48779cc03b)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
keys returns a map's keys in Go's randomized iteration order, so a
release with several databases rendered DEFINED_DBS in a different
order on each upgrade. The init-script Secret, and the checksum the
init Job carries, then changed on upgrades that left the databases
untouched, which makes a no-op upgrade look like a real change in the
release history.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit dc94660a44)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The bootstrap Job wrote a ClusterRoleBinding per oidc.users entry into
its script, and the script reaches the container as one `sh -c`
argument. Linux caps a single argument at 128 KiB, which about 240
users cross at roughly 530 bytes each. The container then cannot start,
the post-install and post-upgrade hook fails, and the tenant cluster's
HelmRelease stays unready. The values schema puts no bound on
oidc.users, so a shared cluster reaches that size with ordinary
per-person entries.
The bindings and the list of their names now reach the Job through a
ConfigMap it mounts, so the script is the same size for any list. Names,
labels and roles of the bindings are unchanged, so the bindings already
in a tenant cluster are updated in place and none is orphaned.
Assisted-by: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
(cherry picked from commit 7b7444feaf)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
On the kubevirt substrate resources.cpu is written into domain.cpu.cores
as spelled and decoded as YAML, so "010" gives the VM eight cores, while
the cluster-autoscaler capacity annotation parsed the same string as
decimal ten. The autoscaler then planned 9000m on a node that offers
7000m.
Keep the YAML-decoded value the range check already computes and start
the capacity annotation and the reserved-CPU check from it on kubevirt.
The kubelet reservations stay as they are: the worker machineconfig
sizes them from the decimal string, and the TalosConfigTemplate name is
a hash of that config, so changing them would roll every leading-zero
pool once. The annotation therefore subtracts the reservations the
machineconfig really carries (2 x 500m for "010") from the cores the VM
really has, which is the node's real allocatable. Neither template name
changes for any spelling, so no pool rolls. Proxmox parses the quantity
as decimal on both sides and is unchanged. The field description says
the value is decoded as YAML and that the reservations still read it as
a decimal.
This closes#4554 without the migration and the render-time refusal it
proposes: a refusal breaks stored pools on their next upgrade, a schema
pattern breaks updates of existing CRs, and a platform-wide migration of
every KubernetesNodes and nodeGroups entry is a lot of blast radius for a
spelling nobody has reported in a live cluster.
Closes#4554
Signed-off-by: Marian Koreniuk <moriarti@cp.if.ua>
Assisted-by: LLM
(cherry picked from commit f7913329b2)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
The CSI controller in the management cluster was referenced by the bare
tag ghcr.io/sergelogvinov/proxmox-csi-controller:v0.20.0, and the node
plugin in the tenant by the vendored chart's default, its appVersion as
a bare tag. That registry is the one whose proxmox-cloud-controller-
manager:v0.15.0 was re-pushed to a build that panics, so a tag there is
not a statement of what runs.
Both now carry the v0.20.0 digest: the controller through
images/proxmox-csi-controller.tag, like the cloud-controller-manager, and
the node plugin through repository and tag in the proxmox-csi values,
which also makes it visible to hack/lib/image-refs.sh and therefore to
the release multi-arch gate. Both digests are indexes for linux/amd64
and linux/arm64.
Pinning takes the version out of the vendored chart's hands: a chart
bump would bring a new appVersion while both pins kept naming the old
release, and the controller and the node plugin would drift apart from
the templates and from each other without anything noticing.
hack/proxmox-csi-driver-pin_test.bats fails unless the chart's
appVersion and both pins name the same release.
The sig-storage sidecars stay on tags, as they do for the KubeVirt CSI
driver: registry.k8s.io publishes them through image promotion, which
does not overwrite a tag.
Assisted-by: LLM
Signed-off-by: Marian Koreniuk <moriarti@cp.if.ua>
(cherry picked from commit 780b068df0)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
The Proxmox CCM was referenced by its bare v0.15.0 tag, and that tag no
longer names the image it named when the template was written. It was
re-pushed on 2026-09-27 (index sha256:d81702998ae1, replacing the
2026-08-06 build sha256:fbc553921145) to a binary whose gitVersion is
"0.15.0" without the leading v. component-base v0.37 parses that string
in the init() of its legacy metrics registry and panics:
panic: version string "0.15.0" doesn't match expected regular
expression: "^v(\d+\.\d+\.\d+)"
so the Deployment crash-loops, no Node ever loses the
node.cloudprovider.kubernetes.io/uninitialized taint, and workloads on a
new worker stay Pending. Any node that pulls the tag fresh gets it, which
is every fresh install.
v0.16 builds with goreleaser and stamps gitVersion as v{{.Version}}. The
configuration this template writes is read unchanged: the cluster entry
moved to go-proxmox-pool's ClusterConfig with the same url, insecure,
token_id, token_secret and region keys, and features.provider: capmox
still writes proxmox://<SMBIOS UUID>, the providerID capmox puts on the
Machine.
The reference now lives in images/proxmox-cloud-controller-manager.tag
as tag plus digest, the shape the chart already uses for the KubeVirt
cloud provider, so a moving tag can no longer change what runs.
Assisted-by: LLM
Signed-off-by: Marian Koreniuk <moriarti@cp.if.ua>
(cherry picked from commit 05a347e6f6)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
Without a global section HAProxy 3.4 sizes itself from the node.
maxconn comes from the nofile limit, cut to the built-in fd-hard-limit
of 1048576, so about 524k, and the thread count is the number of CPUs
the process may run on, whatever the CPU limit says. With one thread
that alone idles at about 85 MiB, and every thread adds about 0.6 MiB,
so a t1.nano replica with its 128Mi limit runs on a small node and is
OOMKilled at startup on a node with many CPUs.
fd-hard-limit is now 32 per MiB of the memory limit, from which HAProxy
derives about 16 connections per MiB, 2035 for the t1.nano defaults.
That leaves 64 KiB per connection against the roughly 35 KiB HAProxy
budgets per connection itself when it is given a memory limit with -m,
and the rest covers the process and the kernel socket buffers charged
to the same cgroup. It caps the derived value instead of setting
maxconn, because an explicit maxconn above half the hard nofile limit
stops HAProxy at startup (strict-limits is on by default), while
fd-hard-limit still follows a lower system limit.
thread-hard-limit is the CPU limit rounded up, at least 1. It only caps
the detected thread count, so a node with fewer CPUs is not forced to
run more threads than it has.
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit 20545d00a5)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>