Commit Graph
8802 Commits
Author SHA1 Message Date
Myasnikov Daniil e99a15dbee fix(ci): push the stable chart once, so a re-run keeps cozy-installer:X.Y.Z
Since finalize publishes the release page last, a run that fails in
Publish draft release is re-run after the chart is already pushed. The
re-run packaged and pushed the chart again, and helm package does not
give the same bytes twice (two packagings of the same tree with
different file times give two digests), so cozy-installer:X.Y.Z moved
to another digest.

The chart step now pushes only when the registry answers that cozy-
installer:X.Y.Z is missing, read as manifest_digest in hack/promote-
retag.sh reads it; any other lookup error fails the step instead of
being taken for a missing tag. cozy-installer:latest still follows the
latest decision on every run.

A bats test runs the step against stub skopeo, helm and yq: the first
run pushes once, a re-run pushes nothing, an older patch leaves latest
alone, a failed push fails the step, and a failed lookup fails it
without packaging or pushing.

Fixes: e1472e58de ("fix(ci): publish the release only after the stable images and chart exist")
Assisted-by: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-27 13:51:28 +00:00
Aleksei Sviridkin 8641ebbf63 fix(ci): publish the release only after the stable images and chart exist (#5169)
## What this PR does

Finalize undrafted the release before retagging the rc images and
pushing the cozy-installer chart, so release page announced version
whose images and chart still returned `manifest unknown` (7m47s on
v1.7.0:
https://github.com/cozystack/cozystack/actions/runs/40864518300). Failed
retag or chart push also left public release that re-run couldn't
repair, because re-run looks for draft and finds none.

Now draft lookup and `make_latest` decision are in own step `Resolve
draft release`, before any registry write. Retag, chart and `Publish
draft release` take the decision from its outputs, and publish goes
last. Missing draft fails before anything is pushed, failed retag or
chart leaves the draft for re-run. Body selection, orphaned draft
repair, `prerelease` and restoring `latest` after older patch are
unchanged.

Deciding `latest` before the retag opens a window of minutes where two
release PRs merged close together both decide they are newest, and the
older line ends up with `latest` on release page, image `:latest` and
`cozy-installer:latest`. So finalize runs one release at a time:
job-level concurrency group built from the job's own `if:` (other closed
PRs never join it), `cancel-in-progress: false` and `queue: max`, so
third merged release waits instead of cancelling the pending one.

Docs and comments in `tags.yaml` and `promote-rc.yaml` that said release
is already public when finalize pushes the stable tag now say when it is
published. Release checklist no longer says to undraft by hand when
draft lookup fails.

Closed-PR workflow runs from base branch, so supported lines get this in
own PRs: #5480 (release-1.7) and #5481 (release-1.6).

Tests: contract tests pin step order, that nothing publishes after
failed registry step (no `continue-on-error`, no `if:` on publish,
registry steps skip only for prerelease) and the concurrency group.
Behaviour tests run both github-script steps under node against stubbed
API (missing draft, orphaned draft, older patch after newer minor, all
shipped changelog tags). Every new test fails against the old workflow,
I also checked them against mutated copies of it.

### Downstream repositories

- [x] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up:

### Release note

```release-note
fix(ci): finalize publishes the release page last, after the stable image tags and the cozy-installer chart exist, and finalizes one release at a time, so a release is no longer public while its images return manifest unknown
```
2026-11-27 15:33:44 +03:00
Aleksei Sviridkin f342bd4765 feat(api): add installation defaults for new applications (#5107)
## What this PR does

This PR adds installation defaults for applications: administrator sets
`applicationDefaults` in the platform values, and every application
created after that starts from them. Design is in [the proposal in
cozystack/community](https://github.com/cozystack/community/pull/116),
related to [the worker defaults
issue](https://github.com/cozystack/cozystack/issues/3950).

The value is keyed by ApplicationDefinition plural (for example
`postgreses`) and the platform chart renders it into the
`cozystack-application-defaults` ConfigMap in `cozy-system`. The
aggregated API merges the entry for the kind under the submitted spec on
create, apply-create and dry-run create, and saves the result in
HelmRelease values. The order is user values, installation defaults,
then developer defaults from the chart schema. Update never applies
defaults, so changing the value leaves existing applications alone.

The merge goes into objects that declare `properties` and replaces
everything else whole: arrays, dictionaries with `additionalProperties`,
free-form objects, objects that also take arbitrary keys and objects
marked `x-kubernetes-map-type: atomic`. So a node pool that sets its own
`registryMirrors` gets no platform mirror entries. Explicit empty values
from the user (`{}`, `[]`, `false`, `0`, `""`) win over the installation
value.

An entry is checked against the application's OpenAPI schema before it
is merged. An object that the merge completes is checked as a partial
one, so `required` and `minProperties` are not enforced on it and its
`oneOf` is not evaluated (CEL rules are not evaluated at all). Whatever
is stored whole is checked whole: array rows, dictionary values,
free-form and atomic objects. Without that, an entry like a RabbitMQ
vhost without `roles` was accepted and stored, and the chart refused to
render it.

A missing ConfigMap means no defaults and gives no warning. An
unreadable ConfigMap, invalid JSON, a bad entry or an unreadable schema
does not block the create: defaults are skipped and the response carries
a Warning (dry-run too). The generic checks cover the whole map, so one
entry that is not an object, or a reserved top-level field in any entry,
turns defaults off for every application until it is fixed, while a bad
entry of one application only affects that application. The ConfigMap is
read through a cache limited to that one object, startup waits up to 30
s for it to sync and a create waits up to 5 s for the read, then both go
on without defaults.

Some objects take exactly one of their children and the chart refuses
two: the worker image of a node pool (`osImage.builtin` or
`osImage.factory`), a vm-disk `source`, the `oidc.customConfig` of a
kubernetes cluster and of a monitoring stack (`config` or `secretRef`).
A default for one child merged into an application that chose another
built that spec. These carry the atomic marker now, so the merge
replaces them whole, and `values.yaml` tells catalog authors to do the
same in their own schemas. The chart guide (`docs/agents/overview.md`)
says when the marker fits and when it does not. The `osImage` change is
the same hunk as in #5192.

The dashboard order page sends one dry-run create when it opens and
starts the form and YAML from the returned spec, so the browser reads no
ConfigMap and merges nothing. If the preview fails, or gets no answer in
8 s, the form opens with a notice and Retry, and Deploy still works.
After a failed preview a dropdown stays empty instead of selecting the
cluster default option, so the API applies the platform default to the
omitted field. A cleared text field leaves its key out, a dropdown None
and a sensitive field are written as `""`. While the server owns
defaults the form does not fill schema defaults on its own.

Not in this PR: defaults on update, re-rendering existing applications
when the value changes, defaults for HelmReleases that controllers
create directly, validation when the ConfigMap is saved, previews on
every edit in the dashboard.

### Merge order

#5190 and #5191 are merged and this branch is rebased on main. #5192 is
open and has the same `osImage` marker hunk, so whichever of the two
lands second needs one more `make generate` after a rebase.

### Known limits

- The dashboard does not show the API Warning.
- `null` for a field that has a developer default is saved as `null`
through kubectl or Terraform, but the dashboard form shows the developer
default.
- A number in an integer-or-string field is rejected by the form (same
on main), so quantities in an entry have to be quoted, `cpu: "2"`.
`values.yaml` says so.
- After a failed preview the form still requires a field that has no
schema default, even if an entry would supply it. Typing the value or
switching to YAML gets around it.
- The marker only fits a choice between alternatives that each stand
complete. I went through the application charts and rendered every
refusal I found that involves two or more fields, and most are not that.
A pair that has to be set together (`resources.cpu` with
`resources.memory`, `tls.enabled` with `tls.disableNonTLSListeners` in
rabbitmq) is completed field by field today, and an atomic object would
drop the default half. An object that also holds independent fields an
admin would default (`backup` in clickhouse, mariadb, mongodb and
postgres, `volume` in seaweedfs) would lose them. Relations between two
objects or two top-level fields (`cloudflareProxy` with `proxyProtocol`
in the ingress, most of postgres, the kubernetes addons) cannot carry a
marker. In all of these a default for one field plus the user's value
for another can make the chart refuse the render after the create went
through. Catching that needs the relations declared as rules in the
schema and the merged spec checked against them, and the API does not
evaluate such rules on a user spec yet (#2657), so it is a separate
change. A few relations depend on a lookup into the cluster and I could
not render them offline.
- Clearing an optional text or number field in the order form leaves its
key out, so the default comes back. A dropdown set to None, a sensitive
field and a dictionary value send an empty string and win. The form
keeps its old meaning of clearing a field, same as on main. To override
a default with an empty value, set it in the YAML tab (`""`, `0`).
Switching from the YAML tab back to the form fills an empty dropdown
with its default option again, a None included, so such a value has to
be deployed from the YAML tab
(https://github.com/cozystack/cozystack/issues/5473).
- An entry that cannot be parsed (invalid JSON, a reserved `_` key)
turns defaults off for every kind, not only its own, and the Warning on
each create names the problem. I did not split it per entry: the failure
is loud, the fix is in one place, and splitting touches the parse and
cache path for a case only a typo causes.
- An atomic object also drops a default for a field nested inside an
alternative when the user sets another field of that alternative. A
default for `osImage.factory.imageFactoryURL` does not survive a pool
that sets `osImage.factory.version`, and the boot disk then comes from
the public factory. `talos.imageFactoryURL` is the knob the chart falls
back to, it is not atomic, and defaults for it keep working.
- A schema that declares a typed property only inside an `allOf` or
`anyOf` branch, under a root that takes arbitrary keys, is checked as
partial. No schema in the tree looks like that.
- An object inside an `allOf`, `anyOf` or `oneOf` branch is closed to
unknown keys even when the property it constrains is declared as a
dictionary, so a valid entry for such a schema is refused and the create
goes on with a Warning
(https://github.com/cozystack/cozystack/issues/5474). No schema in the
tree looks like that either.
- The preview uses the placeholder name `preview`, so it fails when the
tenant already has an application of that kind with this name, and the
form opens with the notice.
- The cache wiring in `pkg/apiserver/apiserver.go` has no unit test, the
cache itself has.

### Verification

- `make unit-tests` on this head with `LC_ALL=C`, exit code 0 (a kafka
bats test on main depends on the locale).
- `tsc` and `eslint` in the console are clean.
- For the checks below I broke the code on purpose and saw the matching
test fail, except the `arrayMinItems` flag of the server form, I could
not make it matter.
- A run on a test cluster with v1.7.0 is in the comment below. It was on
an earlier revision, the stored-whole checks, the extra markers and the
cleared-field change came after and are covered by unit tests only.
- Not run: `make test-controllers`.
- The merge cases asked in review are fixtures of
`TestInstallationDefaultsMergeContract` now: a field set inside the
alternative a user chose of an atomic object, the same object without
the marker, an atomic object nested in one that merges, and an explicit
`null` over an installation object. The whole table is in the proposal
addendum, https://github.com/cozystack/community/pull/146.

Checked cases:

- user values `{}`, `[]`, `false`, `0`, `""` are kept, and a node pool
with its own `registryMirrors` gets none from the platform
- an object with both `properties` and a dictionary, or with preserved
unknown fields, is replaced whole
- empty and `null` `spec` on create
- update after create, apply-update and a field removed on update keep
stored values
- a broken entry for another application, or an application with no
entry and no readable schema, does not touch this create
- missing ConfigMap gives no defaults and no warning, invalid JSON,
unreadable ConfigMap and a cache that did not sync give a Warning and
the create goes on
- partial entry: `required`, `minProperties` and object `oneOf` are
skipped on an object the merge completes, while unknown fields, wrong
types, scalar `oneOf` and array items are still checked
- array rows, dictionary values, free-form and atomic objects are
checked whole, also when the constraint sits in an `allOf` or `anyOf`
branch next to the property, and in these shapes an accepted entry
merges into a spec that the application's own schema accepts
- every ApplicationDefinition in the tree accepts an entry built from
its own developer defaults
- an object that lists properties without `type: object` is checked as
an object, so an unknown field in it is refused
- a pool with `osImage.factory`, a disk with another `source`, a cluster
with `oidc.customConfig.secretRef` and a monitoring stack with
`oidc.customConfig.config` do not get the other child from the platform,
on their real schemas
- a node pool that sets `resources.cpu` still gets `resources.memory`
from an entry, so the marker does not take away the field-by-field
completion of pairs
- dashboard: a user with no tenant does not wait on the spinner,
switching tenant keeps what was typed, a preview answer that arrives
after the tenant changed is dropped, a non-object answer counts as a
failed preview, Retry sends the current draft
- dashboard: after a failed preview dropdowns in a field, an array row
and a dictionary value stay empty, and edits made in YAML come back into
the form
- `required` inside array rows and dictionary values stays in force when
the server owns defaults, and an emptied sensitive field stays `""`

### Screenshots

Not captured yet.

### Downstream repositories

This PR changes `packages/core/platform/values.yaml`. The docs for the
new key are in https://github.com/cozystack/website/pull/828, and the
proposal addendum with the merge cases and two decision records is in
https://github.com/cozystack/community/pull/146. The Terraform provider
may be reached too: it has its own defaults for some sizing fields
(storage class, disk size), so installation defaults would not apply to
those, while the Talos block fields are left out when unset and do get
them. I read the schema, not the expand code.

- [ ] No downstream repository is affected by this change
- [x] [cozystack/website](https://github.com/cozystack/website) -
follow-up: https://github.com/cozystack/website/pull/828
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up: to check, provider defaults vs installation defaults
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [x] [cozystack/community](https://github.com/cozystack/community) -
follow-up: https://github.com/cozystack/community/pull/146

### Release note

```release-note
feat(api): add the `applicationDefaults` platform value, installation defaults are applied to new applications under user values, existing applications keep their saved settings, and the dashboard order form starts from the same defaults.
```
2026-11-27 15:18:14 +03:00
Myasnikov Daniil e1472e58de fix(ci): publish the release only after the stable images and chart exist
Finalize undrafted the release before it retagged the images and
published the cozy-installer chart, so for the length of the retag the
release page announced a version whose images and chart returned
manifest unknown. The retag took 80-95 seconds on the 1.6.x patches and
several minutes on v1.7.0. A failure in either step also left a public
release that a re-run could not repair, because the re-run looked for a
draft and found none.

Move the draft lookup and the latest decision into their own step that
runs before any registry write, hand the decision to the retag, the
chart and the release page as step outputs, and undraft last. A missing
draft now fails while no stable name exists, and a failed retag leaves
the draft in place for a re-run. The comments and docs that took the
release to be public by the time finalize pushes the stable tag now say
when it is published.

Deciding latest before the retag opens minutes in which two release PRs
merged close together would both decide they are the newest, leaving
latest on the older line on the page, the image aliases and the chart.
Finalize therefore runs one release at a time, in a concurrency group
that only release PRs join and that queues every merged release rather
than cancelling the one waiting.

The finalize bats suites run both github-script steps under node against
a stubbed API: a missing draft, an orphaned draft, an older patch after
a newer minor, and every shipped changelog's tag. A contract test fails
on a registry step allowed to fail, a publish step that runs after a
failure, a `latest` that moves without the decision, or finalize runs
that may overlap.

Assisted-by: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-27 10:25:01 +00:00
myasnikovdaniil fc2da5810f Merge commit from fork
fix(monitoring): give Alerta a real signing key and its own admin password
2026-11-27 14:47:20 +05:00
myasnikovdaniil 01a57f7169 docs(release): add changelog for v1.7.2 (#5471)
This PR adds the changelog for release `v1.7.2`.

✅ Changelog has been automatically generated in
`docs/changelogs/v1.7.2.md`.
2026-11-27 12:39:14 +05:00
Myasnikov Daniil 74ac18e042 feat(apps): mark objects whose children exclude each other atomic
The worker image of a node pool takes one of builtin and factory, a
vm-disk source one of disk, http, image and upload, and the oidc
customConfig of a kubernetes cluster and of a monitoring stack one of
config and secretRef, and each chart refuses a spec that sets two. An
installation default for one child merged into an application that
chose another built exactly that spec, and nothing warned at create
time. The x-kubernetes-map-type: atomic marker makes the defaults
merge replace the object whole. Nothing else reads it, so existing
applications render as before.

The marker stays off objects whose fields must be set together or sit
beside independent fields, where replacing the object whole would drop
a default the user did not mean to override. The chart guide says when
to use it and when not to.

The tests run the merge against the four real schemas, and one more
pins that a pair like resources cpu and memory still merges field by
field.

Assisted-by: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-27 07:39:01 +00:00
Myasnikov Daniil 8ef5ad1324 feat(api): treat objects that cannot be completed as one value
The merge completes an object field by field only when its schema
declares properties. An atomic object (x-kubernetes-map-type: atomic), a
dictionary value, a free-form object and an object that also takes
arbitrary keys are stored as written, so nothing can complete them
later. A default osImage.builtin plus a user's osImage.factory gave a
spec the kubernetes-nodes chart refuses to render, and an entry such as
a RabbitMQ vhost without roles was accepted and stored the same way.

The merge now copies such an object whole or leaves the user's value
alone, and an entry is validated for it as a whole, like an array row.
A branch of an allOf, anyOf or oneOf that names a property is judged
like the property declared next to it. An entry that gets this wrong is
skipped with a warning like any other invalid entry.

Assisted-by: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-27 07:39:01 +00:00
cozystack-ci[bot] 5d012b83bd docs: add changelog for v1.7.2
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
2026-11-27 07:25:31 +00:00
Andrei Kvapil bcba5d349a security(monitoring): reset the Alerta admin password on every start
The entrypoint creates admin users only when they are missing, so an
admin user created before Alerta had a password of its own keeps the
Grafana password, which stays valid after an operator rotates Grafana's.
The respin runs a step right after user creation that sets every admin
user's password to ADMIN_PASSWORD, and stops the container if it fails.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-11-27 05:39:18 +01:00
Andrei Kvapil 68b0e80d17 security(monitoring): show tenants Alerta's login apart from its keys
Tenants logged in to the Alerta UI with the Grafana credentials, the
only Secret of the release they are shown. With Alerta on a password of
its own, that password moves to a Secret that holds nothing but the
login, listed for tenants next to Grafana's, so the signing key and the
API key in the alerta Secret stay hidden. The alerta Secret is now
rendered under data alone.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-11-27 05:39:18 +01:00
Andrei Kvapil 8942c7dfcc security(monitoring): keep Alerta credentials out of its container log
The upstream Alerta entrypoint prints the whole environment, including
the admin password and API key, and echoes the admin API keys it
creates, while nginx logs the request line where Alertmanager passes
the key as a query parameter. Pod logs are readable at lower tenant
tiers than the credentials themselves.

The respin drops the environment dump, silences key creation and masks
the api-key parameter in the access log. Each edit is checked during
the build, so an upstream change to either file fails the image build
rather than bringing the output back.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-11-27 04:49:30 +01:00
Aleksei Sviridkin 9af6594342 fix(apps): stop granting tenants core Secrets through dashboard resource maps (#5410)
## What this PR does

Every app chart renders a `<release>-dashboard-resources` Role bound to
the tenant's use, admin and super-admin groups and to the tenant
ServiceAccounts. These started as the kubeapps resource map and became
real grants in #1067. The console moved to `tenantsecrets`, but the
bindings stayed. So a tenant subject can read the named Secrets straight
from the API server and skip the `-rd` allowlist. For a bucket with no
users, which is the default, `resourceNames` renders empty and the Role
grants every Secret in the namespace. I checked that on a live cluster:
the rendered Role lets a `use` subject get and list all Secrets in the
tenant namespace.

Closes #3613.

Nothing reads these Roles any more. Services, ingresses and
workloadmonitors are already granted namespace-wide by the `cozy:tenant`
ClusterRoles, and every Secret tenants need is in the kind's
`secrets.include`, served through `tenantsecrets`.

- Remove the Roles and RoleBindings from every chart under
`packages/apps` and `packages/extra`, except foundationdb. The qdrant
and vm-instance WorkloadMonitors that lived in the same file move to
`workloadmonitor.yaml`. computeplane keeps `withholdAdminKubeconfig` for
one more release: the new kubernetes chart ignores it, but it covers the
window in which the old chart is still served.
- Keep the foundationdb resource map and its Role, with a TODO to remove
them once Cozystack can serve application ConfigMaps to tenants. They
are the only way a tenant reads `<release>-config`, the ConfigMap with
the cluster file, and they grant ConfigMaps only, no Secrets. The map
now lists only that ConfigMap, the one entry the console's ConfigMaps
tab reads, and the foundationdb README says how to read the cluster
file.
- Point the postgres, mariadb, mongodb and kubernetes docs at `kubectl
get tenantsecret`, as redis and rabbitmq already do.
- Add `hack/check-tenant-secret-grants.bats`. It renders every chart and
fails if any binds a tenant subject to a Role that grants core Secrets.
On current main it flags 18 charts, bucket included.

One deliberate loss: with OIDC, the `view` tier no longer reads the
`kubeconfig-<namespace>` Secret of the info module. The old Role granted
it from `view` up, while `tenantsecrets` is granted from `use` up, and
giving `view` `tenantsecrets` would show it every tenant credential. The
kubeconfig holds no credential (the API address, the public CA and an
`oidc-login` call), so `view` users can build it from the docs until
`tenantsecrets` can serve such Secrets to `view`.

No objects carry `helm.sh/resource-policy: keep`, so Helm deletes them
on upgrade and no migration is needed.

### Screenshots

N/A, no UI changes.

### Downstream repositories

- [ ] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up: needed, pages that tell tenants to `kubectl get secret` for
app credentials or kubeconfigs should say `tenantsecret`
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up: needs a check, any data source that reads app Secrets with
a tenant identity
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up:

### Release note

```release-note
fix(apps): Tenants no longer get direct read access to application Secrets through the per-application dashboard Roles. Those Roles are removed; read credentials with `kubectl get tenantsecret` instead of `kubectl get secret`. This closes a case where a bucket without users let tenant members read every Secret in the namespace.
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Updates**
* Kubernetes credential retrieval instructions now use `tenantsecret`
resources.
* **New Features**
* Added workload monitoring resources for Qdrant and virtual machine
instances.
* **Removed**
  * The application details page no longer includes a ConfigMaps tab.
* Dashboard access to selected application and infrastructure resources
is no longer provided through chart-defined permissions.
* FoundationDB dashboard resource-map checks are no longer part of the
end-to-end test.
* **Tests**
* Added checks to detect tenant access grants to Kubernetes Secrets
across rendered charts.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-27 05:58:21 +03:00
Aleksei Sviridkin 69c2c3729f test(seaweedfs): cover zone pool collisions with base classes (#5412)
## Summary

Adds regression coverage for #5316 following maintainer feedback and the
changes merged in #5426.

The existing rendered-class collision checks already reject pool names
that conflict with the instance's base classes. This revision focuses on
verifying that behavior rather than introducing redundant validation.

## Changes

- Add a regression test for a MultiZone pool named `lock`.
- Add a regression test for a MultiZone pool named `readonly`.
- Assert that both fail with the existing base-class collision messages.
- Leave production code unchanged.

## Testing

- Targeted regression tests: **2 passed**
- Complete SeaweedFS Helm suite: **101 tests passed across 19 suites**
- No test failures

This revision replaces the original implementation with focused
regression tests as requested in review.
2026-11-27 05:08:01 +03:00
Aleksei Sviridkin bcba1a0bfb fix(seaweedfs): keep the masters on separate nodes through a drain (#4947)
## What this PR does

SeaweedFS masters can end up on the same node after a drain, leaving two
of the three raft members on one failure domain. A hard hostname spread
makes the replacement wait for the drained node, or use a spare node.

The SeaweedFS app now exposes `master.topologySpreadPolicy`: `hard` is
the default; `soft` removes the hard spread and keeps the preferred
anti-affinity. Use `soft` before upgrading a cluster where a tainted
node counts toward the spread but cannot run a master. On a two-node
cluster, draining the node with two masters leaves both Pending with the
hard policy.

## Validation

All 252 Helm tests across the app and system charts pass. Generated app
schema, API types, resource definition and README are current. The
fail-closed test guard passes. The new opt-out has not had an e2e run.

## Downstream repositories

No separate downstream change is required. The app value, schema, API
and documentation are generated in this repository.

## Release note

```release-note
fix(seaweedfs): SeaweedFS masters now wait for a drained node instead of starting next to another master. The new master.topologySpreadPolicy app setting defaults to hard. Set it to soft before upgrading when tainted or otherwise unusable nodes would leave a master Pending; soft keeps the preferred anti-affinity. With hard placement, draining the node that holds two masters in a two-node cluster leaves both Pending until it returns.
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
* SeaweedFS master placement now defaults to a hard spreading policy,
enforcing one master per node when enough schedulable nodes are
available.
* Set the policy to `soft` to allow masters to share nodes while
preferring to keep them separate.
* **Documentation**
* Added guidance on the scheduling trade-offs, including how hard
spreading accounts for nodes where masters cannot run.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-27 04:59:01 +03:00
Aleksei Sviridkin 6aa33e379e feat(monitoring): alert when a namespace stays in Terminating (#5040)
## What this PR does

On a cluster running v1.6.5 a tenant namespace that was deleted
directly, not through the Tenant app, stayed in `Terminating` for about
28 hours, held by the Kamaji finalizers described in #5002. Nothing
alerted on the namespace itself. The only signal was
`HelmReleaseNotReady` of the tenant release, which kept flapping.
kube-state-metrics already exports `kube_namespace_status_phase` and
`dashboards/main/capacity-planning.json` reads it, but no alert rule in
the repo does.

This adds `KubeNamespaceStuckTerminating`, a warning in a new
`namespace-deletion` group under
`packages/system/monitoring-agents/alerts/`. It fires when `max by
(cluster, namespace)
(kube_namespace_status_phase{job="kube-state-metrics",
phase="Terminating"}) == 1` has held for 30 minutes. kube-state-metrics
exports a `Terminating` series for every namespace, 0 while the
namespace is active and 1 while it is being deleted
([namespace.go#L109-L135](https://github.com/kubernetes/kube-state-metrics/blob/v2.15.0/internal/store/namespace.go#L109-L135)).
The scrape adds the node and pod of the kube-state-metrics pod as target
labels, so the rule groups by cluster and namespace and its timer keeps
running through a kube-state-metrics rollout to another node. A gap in
the series, for example while kube-state-metrics is down, starts the 30
minutes over. The description names the namespace and the cluster and
points at the namespace status conditions, which list the remaining
resource types and finalizers
([status_condition_utils.go#L101-L140](https://github.com/kubernetes/kubernetes/blob/v1.33.12/pkg/controller/namespace/deletion/status_condition_utils.go#L101-L140)).

Why 30 minutes. Healthy tenant deletions we watched on current versions
took under a minute from the delete request until the namespace was
gone, 61 of 61, and about 5 minutes for a tenant with a Kubernetes
cluster, a VM and Postgres inside. The namespace itself spent under a
minute in `Terminating` in every one of them. 30 minutes leaves wide
room and still reports a stuck namespace within the hour.

`hack/namespace-deletion-alerts.bats` replays `.spec` of the VMRule
through `vmalert-tool` v1.136.0 pinned by digest, the same harness as
#4963, #4985 and #4993.
`hack/testdata/namespace-deletion-alerts/unittest.yaml` has 5 cases with
11 checks. A namespace in `Terminating` is quiet at 29 minutes and fires
at 35, with labels and annotations pinned. A namespace deleted after 20
minutes in `Terminating` stays quiet at 19, 35 and 60 minutes, and an
active namespace stays quiet. When kube-state-metrics moves to another
node 15 minutes in, the alert still fires at 31 minutes. The same
namespace name in two clusters gives one alert per cluster, each with
its own timer.

```console
$ bats hack/namespace-deletion-alerts.bats
1..1
ok 1 namespace deletion alerts pass their vmalert-tool cases
```

With the expression replaced by `vector(1) == 0` the suite prints `not
ok 1` and vmalert-tool fails the 4 checks that expect an alert. On main,
where the rule file does not exist, the suite fails too. Each of the
following rule changes fails at least one check. They are `for: 15m`,
`for: 45m`, no `== 1`, `sum by` instead of `max by`, which only the
kube-state-metrics move catches, no `cluster` in the grouping,
`phase="Active"`, no aggregation, another severity and another
description.

With Bats 1.14.0 at the commit CI pins and Helm 3.17.3 on `PATH`, 18
suites pass with 325 of 325 tests, the new one together with
`alert-severity-contract`, `bats-strict-setup`, `bats-runner-coverage`,
`bats-runner-contract`, `unit-test-parallelism`, `image-pin-consistency`
and `check-commit-trailers` among others. The severity contract lists
the new alert as `warning`. helm-unittest 1.1.2 passes the
monitoring-agents chart with 19 of 19 tests, and `helm template` renders
the VMRule the same as the file. Like the migration suites, the new
suite needs docker. I have not run the rule in vmalert on a live
cluster.

The release-1.6 backport is a separate PR with one more commit that
drops the `load test_helper` line, because release-1.6 runs
`hack/*.bats` through `hack/cozytest.sh`.

### Screenshots

Not a UI change.

### Downstream repositories

A new alert file under `packages/system/monitoring-agents/alerts/`, a
Bats suite under `hack/` and its test data. No values, schema, README,
image or `ApplicationDefinition` change, and the website does not list
platform alerts by name, so no trigger map entry applies.

- [x] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up:

### Release note

```release-note
feat(monitoring): new warning alert KubeNamespaceStuckTerminating fires when a namespace has been in phase Terminating for more than 30 minutes.
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

- **New Features**
- Added an alert for Kubernetes namespaces that remain in the
`Terminating` phase for more than 30 minutes.
- Alerts identify the affected cluster and namespace and note that
remaining finalizers may be preventing deletion.

- **Tests**
- Added coverage for deletion timing, active namespaces, node changes
during termination, and identically named namespaces across clusters.
Test cases verify expected alert labels and annotations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-27 03:40:22 +03:00
Andrei Kvapil d99a1a063e fix(monitoring): give Alerta a real signing key and its own admin password
Alerta signs its session JWTs with SECRET_KEY, but the upstream image never
wires a real value into it: the entrypoint renders the generated key into
alertad.conf under the name SECRET (which the application never reads) and
unsets SECRET_KEY before exec, so at runtime the built-in default from
alerta.settings ("changeme") signs and verifies every token. Anyone can mint
a valid admin token without credentials.

Alerta's admin account also reused Grafana's credentials
(grafana-admin-password), and Alerta exposes the whole process environment via
/api/management/properties to any admin-scoped caller, so admin on Alerta
yielded Grafana's admin password.

Generate a strong SECRET_KEY and a dedicated admin password, persist both in
the alerta Secret so they survive upgrades and restarts, feed the key to the
application through a mounted alertad.conf under the name it actually reads,
and stop referencing grafana-admin-password. Add a unittest covering the key,
the mount and the credential decoupling.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-11-27 01:26:22 +01:00
Aleksei Sviridkin 7be083a5a7 feat(harbor): expose replicas and zone spread for the request path (#4880)
<!-- Thank you for making a contribution! Here are some tips for you:
- Use Conventional Commits for the PR title: `type(scope): description`
- If it's a work in progress, consider creating this PR as a draft.
-->

## What this PR does

Closes #4824.

Every `docker login`, pull and push goes through nginx → core
(`/service/token`) → registry, and each of them ran as a single pod.
Losing the node that hosted one stopped all registry traffic, however
many PostgreSQL and Redis instances backed it. The vendored goharbor
chart already scales these components and the registry keeps its blobs
in S3, so only the wrapper was missing the knobs.

**Request path (`packages/apps/harbor`)**

- New `nginx.replicas`, `portal.replicas`, `core.replicas` and
`registry.replicas`, all defaulting to `1`.
- Above one replica, the wrapper forwards to the upstream chart a
`podDisruptionBudget` with `maxUnavailable: 1` and
`topologySpreadConstraints`. Upstream defaults `minAvailable` to 1 and
renders whichever of the two fields is set, and the API server rejects a
PDB carrying both, so the wrapper forwards `minAvailable: 0` to drop it.
- At one replica nothing but `replicas: 1` is forwarded, which is the
upstream default, so an existing install renders the same Deployments as
before.
- The `WorkloadMonitor`s for core, registry and portal take `replicas`
from the values instead of a hard-coded `1`. `minReplicas` stays at 1,
since one serving replica is enough for the component to work.

- The spread follows the platform's
`scheduling.globalAppTopologySpreadConstraints` (read from
`_cluster.scheduling`), as postgres, etcd, keycloak, grafana and
kubernetes-nodes already do, so the cluster operator sets the policy
once. When the platform sets none, a soft spread stands in: zone then
hostname, both `ScheduleAnyway`, so a cluster without zone labels or
with fewer nodes than replicas still schedules every replica. Any
`labelSelector` in the policy is dropped, because the upstream chart
appends its own `release`/`app`/`component` selector to every entry.

**Data tier (`packages/system/harbor`)**

- The CNPG `Cluster` (when `database.replicas > 1`) gets
`topologySpreadConstraints` from the same platform policy, or a
`ScheduleAnyway` zone spread when the platform sets none; CNPG's default
anti-affinity handles nodes. The Redis pods and sentinels already spread
hard per node on main (#4990); this adds a `ScheduleAnyway` zone spread
on top of that default. A constraint in the platform policy without a
selector gets the component's own; a selector the policy sets is kept,
as in the keycloak chart.

**Deviations from the issue, on purpose**

- Placement follows the platform-wide
`globalAppTopologySpreadConstraints` instead of a set of rules
hard-coded in Harbor, to stay consistent with the other applications.
The fallback spreads across nodes with a `topologySpreadConstraints`
entry rather than a preferred `podAntiAffinity` term: the upstream chart
appends its own selector to spread entries, while an affinity term is
passed through verbatim and would have to hard-code that label set in
the wrapper.
- On the data tier the zone spread goes through
`topologySpreadConstraints`, not `affinity.topologyKey:
topology.kubernetes.io/zone`. Moving CNPG's `topologyKey` to the zone
would drop its per-node anti-affinity, so instances could share a node
on a cluster without zone labels. With spread constraints the two add
up, and for Redis the zone entry sits beside the per-node one.
- `jobservice.replicas` (item 5 of the issue, which needs `jobLoggers:
[database]`) is left for a follow-up, as the issue suggests.

**Upgrade impact**

- Request path: none at the default replica count.
- Data tier: `database.replicas` and `redis.replicas` default to 2, so
on upgrade most installs see a one-off rolling restart of the CNPG
instances (with a switchover), of the Redis pods and of the sentinels,
as their pod spec gains the spread constraint. Where the platform policy
uses `DoNotSchedule`, it is now enforced for Harbor pods too, as it
already is for the other applications.

**Tests**

- `packages/apps/harbor/tests/replica_placement_test.yaml`: defaults
forward nothing beyond `replicas: 1`; above one replica the PDB and
spread are forwarded; the platform policy replaces the fallback and
loses its `labelSelector`, and is ignored at one replica; components
scale independently; `registry.replicas` lands at the Deployment level,
not under `registry.registry`; WorkloadMonitors follow the values.
- `packages/system/harbor/tests/zone_spread_test.yaml`: CNPG, Redis and
sentinel spread with the right selectors and no `affinity` override,
both with the fallback and with a multi-entry platform policy, keeping a
selector the policy sets; `redis_spread_test.yaml` covers the per-node
default with the zone entry on top; and, rendering the vendored chart
with the values the wrapper forwards, the PDB carries `maxUnavailable`
alone and the spread entries are scoped to the component's pods.
- Checked that the tests fail with the fix removed (helper without
`minAvailable: 0`, upstream PDB without the zeroing, CNPG spread
removed, platform policy ignored). `helm unittest` on both charts: 72/72
passing. Also rendered the app chart, with and without a platform
policy, fed its HelmRelease values into the system chart, and checked
the resulting Deployments, PDBs and CNPG `Cluster`.

### Screenshots

No UI change.

### Downstream repositories

- [ ] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [x]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up: cozystack/terraform-provider-cozystack#70 (issue: the
provider models Harbor by hand)
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up:

The diff adds fields to the `harbor` app's `values.schema.json`, which
the Terraform provider models by hand, so a follow-up issue is open
there. The website reference page is regenerated from the README on
release, and no other trigger in the map matches the diff.

### Release note

```release-note
feat(harbor): nginx, portal, core and registry now take a `replicas` value. Above one replica they get a PodDisruptionBudget and follow the platform's `globalAppTopologySpreadConstraints`, or a best-effort spread across zones and nodes when none is set, so draining or losing a node or zone keeps docker login, pull and push working. The PostgreSQL and Redis instances and the Redis sentinels now follow the same policy, or a best-effort zone spread; on upgrade this causes a one-off rolling restart of the database and Redis pods.
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
* Harbor NGINX, portal, core, and registry replica counts are
configurable and default to one. Above one replica, these components use
a PodDisruptionBudget and follow platform-wide placement settings when
available, or spread across zones and nodes otherwise.
* Database replicas spread according to placement settings when
configured above one. Redis replicas also spread above one, while all
three Redis sentinels are always spread.
* Core and registry resource settings now use a shared default when not
specified.
* **Documentation**
* Harbor configuration guidance now describes replica settings,
placement behavior, and PodDisruptionBudget behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-27 01:52:06 +03:00
Timofei Larkin c797803dd7 feat(vm-instance): keep a cozyplane VM's IP and MAC (#5389)
## What this PR does

It bumps cozyplane to v0.1.5 and has a cozyplane `vm-instance` VM hold
its Port through a `PortClaim`, so the VM keeps its IP and MAC across
restarts and live migrations.

Without a claim, a VM's Port is garbage-collected when its launcher pod
goes away, and the next launcher pod gets a new IP and a random MAC. A
guest whose network config is pinned to the old MAC then matches no
interface and loses its network. lllamnyp/cozyplane#79 (released in
v0.1.3) fixes this without special-casing KubeVirt. A namespaced
`PortClaim` in `sdn.cozystack.io` holds a cluster-scoped `Port` the way
a PVC holds a PV, and a pod binds it with the annotation
`sdn.cozystack.io/port-claim: <name>`, resolved in the pod's own
namespace. The claim keeps its IP and MAC for as long as it exists: a
stopped VM keeps its address reserved, and deleting the claim frees it.

- **cozyplane v0.1.5.** `cozyplane`, `cozyplane-kpr` and
`cozyplane-apiserver` are re-vendored with `make update` at `b99171ea7`
(tag `v0.1.5`). Beyond v0.1.3's PortClaim, it carries
lllamnyp/cozyplane#80, so a PortClaim that adopts a running VM's Port
keeps it bound to the pod already holding it and reports `Bound=True`
with reason `PreClaimPod`. It also carries lllamnyp/cozyplane#81: the
aggregated apiserver sets `metadata.generation` and the controllers
stamp `observedGeneration`, so a retargeted FloatingIP no longer keeps
its old target's status. The wrappers pin the release images by tag and
digest:
-
`ghcr.io/lllamnyp/cozyplane:v0.1.5@sha256:2cc55293000b64a4c4233910cbc3803b9bea7c16e9e7d44ddcc44fb4042cdd98`
-
`ghcr.io/lllamnyp/cozyplane-kpr:v0.1.5@sha256:28254bdc0283b3797ea8c5f26146932c46b0be98a15cdd660cb42330963cb01c`

The aggregated apiserver serves `PortClaim` from the same binary, and
its chart changes only in the image pin. The CNI chart gains the agent's
and controller's PortClaim RBAC, and its tenant roles gain `portclaims`.
- **`vm-instance`.** A VM that joins a VPC through `networks` renders a
`PortClaim` named after the VM, with `spec.vpcRef` set to the VM's VPC,
and annotates its pod template with `sdn.cozystack.io/port-claim: <VM
name>` next to `sdn.cozystack.io/vpc`. The name matters: cozyplane
adopts a running VM's existing Port into a claim named after that VM, so
running VMs keep their IP and MAC through the upgrade. Without a VPC, or
on kube-ovn, nothing changes.
- **RBAC.** No change is needed. Releases are applied by the same
identity that already applies the VPC application's `sdn.cozystack.io`
objects. Tenants reach `portclaims` through cozyplane's own tenant
roles, which `cozy:tenant:cozyplane-edit` and `-view` (#3149) already
aggregate into the `cozy:tenant*` tiers: every access level can read
claims, and admins can manage them.

### Compatibility

The bump and the chart change have to land together. From v0.1.3 a VM
with no claim gets a new IP and MAC on every launcher pod, live
migration included.

**Upgrading running VMs.** A VM adopted while it was running gets a new
IP and loses its network if it is live-migrated before a restart. Such a
VM's claim shows `Bound=True` with reason `PreClaimPod`, and the VM is
marked `RestartRequired`; restart it before migrating it.

**Tenant Kubernetes worker VMs are not covered.** `kubernetes-nodes` is
unchanged, so from v0.1.3 a tenant cluster's worker VMs keep no IP or
MAC across restarts or live migrations.

A PortClaim's spec is immutable. Changing `networks[0].name` on an
existing VM therefore fails the release upgrade at the claim, instead of
moving the VM to another VPC as it did before.

### Tests

The new helm-unittest suite `vm-instance/tests/portclaim_test.yaml`
covers a VPC VM (one claim named after the VM, its `vpcRef`, no `mac`,
and the pod-template annotation), cozyplane with no VPC (no claim, no
annotation), and kube-ovn (no claim, no annotation). The `vm-instance`,
cozyplane wrapper, kubernetes, kubernetes-nodes and platform suites
pass.

### Downstream repositories

- [ ] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:

Boxes left unticked so a human decides.

### Release note

```release-note
feat(vm-instance): on the cozyplane networking variant, a VM in a VPC keeps its IP and MAC across restarts and live migrations through a PortClaim; cozyplane is bumped to v0.1.5
```

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
* VMs configured with supported VPC networks now receive a port claim
that launcher pods can use to bind to the selected network.
* Tenant roles now support viewing and managing port claims, with access
appropriate to each role.
* **Updates**
* Cozyplane components are updated to version 0.1.4, including the API
server and Kubernetes provider. These updates include revised support
for port claims.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-26 22:19:37 +03:00
Timofei Larkin f7a52ed4f6 feat(vm-instance): keep a VPC VM's IP and MAC
From cozyplane v0.1.3 a pod without a PortClaim gets a new Port, and so
a new IP and MAC, on every launcher pod, live migration included. A
guest whose network config is pinned to its MAC then loses its network
after a restart. A VM in a VPC now renders a PortClaim named after the
VM and binds its launcher pods to it, so the address survives restarts
and migrations and stays reserved while the VM is stopped. The name
matches the VM so cozyplane adopts the Port a running VM already has.

Assisted-by: LLM
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2026-11-26 16:11:47 +01:00
Timofei Larkin f17cd76d5e feat(cozyplane): bump to the v0.1.5 release
v0.1.5 adds the PortClaim kind: a pod naming a claim in its
sdn.cozystack.io/port-claim annotation keeps the claim's IP and MAC
across launcher pods. A claim that adopts a running VM's Port keeps it
bound to the pod already holding it and reports Bound=True with reason
PreClaimPod. Without a claim a VM now gets a new IP and MAC on every
launcher pod, live migration included, so vm-instance claims one in the
next commit. The aggregated apiserver now sets metadata.generation, and
the controllers stamp observedGeneration, so a retargeted FloatingIP no
longer keeps its old target's status. The vendored charts pin a main
build, so the wrappers keep pinning the release images by tag and
digest.

Assisted-by: LLM
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2026-11-26 16:11:47 +01:00
Aleksei Sviridkin a2b341e31b fix(kubernetes): include the namespace in the kubevirt-csi ClusterRole name (#5236)
## What this PR does

The ClusterRole that lets the kubevirt-csi controller get
PersistentVolumes in the management cluster, and its ClusterRoleBinding,
are named `<release>-kcsi` and `<release>-kcsi-binding`. They are
cluster-scoped and the release is named after the cluster, so two
tenants that each have a Kubernetes cluster with the same name render
the same pair.

I hit this on a 1.6 cluster. A user moved from one tenant to another and
created a cluster named `test` in the new tenant while the old tenant
still had its own `test`:

- installing the new release did not fail: the audit log shows
helm-controller getting and patching the existing ClusterRoleBinding,
and the release reported `Install complete`;
- when the old tenant was deleted, its uninstall deleted
`kubernetes-test-kcsi` and `kubernetes-test-kcsi-binding`
(helm-controller's `delete` on both is in the audit log);
- from then on the new cluster's CSI controller failed every
`ControllerExpandVolume` with `error fetching pv ... persistentvolumes
"pvc-..." is forbidden: User
"system:serviceaccount:tenant-...:kubernetes-test-kcsi" cannot get
resource "persistentvolumes" ... at the cluster scope`, and PVC resizes
stayed in `Resizing`;
- the next upgrade of the new release recreated the pair, and resizing
worked again.

Now both objects are named `<namespace>-<release>-kcsi` and
`<namespace>-<release>-kcsi-binding`, the same way the kccm ClusterRole
and binding already are. The rules and the subject are unchanged. On
upgrade Helm creates the new pair before it deletes the old one, so the
driver doesn't lose access in between.

`tests/csi_rbac_test.yaml` checks the new names, the PersistentVolume
rule, the binding's roleRef and subject, and that a release with the
same name in another namespace gets its own pair. Without the template
change three of the four cases fail; the whole chart suite passes (370
tests).

The same naming is in release-1.6, so this needs a backport.

### Screenshots

Not a UI change.

### Downstream repositories

I walked the trigger map against the diff (one chart template and its
unit tests): no package added or removed, no values, schema or default
changed, no output Secret or Service renamed, nothing under `hack/`
touched.

- [x] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up:

### Release note

```release-note
fix(kubernetes): the kubevirt-csi ClusterRole and ClusterRoleBinding are now named after the tenant namespace and the cluster, so deleting a cluster no longer removes PersistentVolume access, and with it volume expansion, from a cluster with the same name in another tenant.
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Bug Fixes**
* CSI access-control resources in non-Proxmox deployments now include
the release namespace in their names, allowing same-named releases in
different namespaces to have separate roles and bindings. Each binding
remains associated with its corresponding role and service account. The
permissions granted to the CSI service account are unchanged.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-26 17:29:31 +03:00
Myasnikov Daniil ecb2576239 feat(dashboard): start the order form from one server dry-run
The form took its defaults from the schema in the browser, which
cannot see the installation defaults the API now applies on create,
so it could show values the created application would not have. The
page sends one dry-run create when it opens and fills the form and
the YAML editor from the spec the server returns.

There are no further previews while the user edits. A preview that
fails, or gets no answer within 8 seconds, opens the form without
installation values and shows a notice with Retry. Deploy still works
then, because the real create applies the defaults itself.

After a failed preview a dropdown stays empty instead of selecting the
cluster's default option: a value the user did not choose would be sent
and win over the platform default the API applies to omitted fields. A
cleared plain text field leaves its key out, as it did before, so
clearing a field still resets it.

Assisted-by: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-26 14:20:06 +00:00
Myasnikov Daniil 77d8bf5001 feat(api): apply installation defaults when creating applications
Defaults set by the administrator have to reach every application
kind, including ones from external catalogs, and give the same result
for the dashboard, Terraform and kubectl, so the merge runs in the API
server on create instead of in each client.

User values win over installation defaults, which win over the
developer defaults of the chart. Only objects with declared properties
merge recursively. Arrays, dictionaries and free-form objects are
replaced whole, so a pool that sets its own registry mirrors never
receives the platform entries. The entry is checked against the
application's OpenAPI schema before merging. CEL rules are left out of
that check, since a rule such as an immutability test has no meaning
on a partial object.

The ConfigMap is read through a cache limited to that one object, so
the API does not hold a watch on every ConfigMap in the cluster. A
missing ConfigMap means no defaults. One that cannot be read, or an
invalid configuration or entry, skips the defaults and the create goes
on with a warning, because a configuration mistake must not stop
applications from being created. Updates never apply defaults. The
ConfigMap rule the API already has covers the read, and its comment
now names this second user.

Assisted-by: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-26 14:20:05 +00:00
Myasnikov Daniil e43dac3a69 feat(platform): add applicationDefaults value
An administrator has no single place to set what every new application
of a kind should start with, such as a storage class or a registry
mirror, so each user repeats it in every spec. The value is keyed by
the application plural and rendered into a ConfigMap in cozy-system,
which the API reads when an application is created.

Assisted-by: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-26 14:20:05 +00:00
myasnikovdaniil c51ea43fee chore(deps): update module golang.org/x/net to v0.62.0 [security] (#4822)
This PR contains the following updates:

| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [golang.org/x/net](https://pkg.go.dev/golang.org/x/net) | [`v0.61.0` →
`v0.62.0`](https://cs.opensource.google/go/x/net/+/refs/tags/v0.61.0...refs/tags/v0.62.0)
|
![age](https://developer.mend.io/api/mc/badges/age/go/golang.org%2fx%2fnet/v0.62.0?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/go/golang.org%2fx%2fnet/v0.61.0/v0.62.0?slim=true)
|

---

### Avoid quadratic complexity when coalescing text nodes in html in
golang.org/x/net
[CVE-2026-78661](https://nvd.nist.gov/vuln/detail/CVE-2026-78661) /
[GO-2026-6860](https://pkg.go.dev/vuln/GO-2026-6860)

<details>
<summary>More information</summary>

#### Details
When coalescing adjacent text nodes in addText and fosterParent,
appending to an existing TextNode's Data via string concatenation
(n.Data += text) reallocated and copied the accumulated string on every
token. Inputs containing many short text runs separated by ignored end
tags (such as "a</x>") caused O(n^2) allocations and byte copies.

Accumulate coalesced text in per-node byte slices during parsing and
materialize Data strings once at the end of parse.

#### Severity
Unknown

#### References
- [https://go.dev/cl/849365](https://go.dev/cl/849365)
- [https://go.dev/issue/82224](https://go.dev/issue/82224)
-
[https://groups.google.com/g/golang-announce/c/sqrs2vTx_Xs](https://groups.google.com/g/golang-announce/c/sqrs2vTx_Xs)

This data is provided by
[OSV](https://osv.dev/vulnerability/GO-2026-6860) and the [Go
Vulnerability Database](https://redirect.github.com/golang/vulndb)
([CC-BY 4.0](https://redirect.github.com/golang/vulndb#license)).
</details>

---

### Check all ancestor namespace transitions when rendering raw text in
html in golang.org/x/net
[CVE-2026-97045](https://nvd.nist.gov/vuln/detail/CVE-2026-97045) /
[GO-2026-6866](https://pkg.go.dev/vuln/GO-2026-6866)

<details>
<summary>More information</summary>

#### Details
In childTextNodesAreLiteral, walking up the tree previously stopped at
the nearest foreign ancestor once an HTML integration point was found.
However, that integration point may itself be a descendant of an element
that was foster-parented into a foreign namespace (such as <mglyph> or
<malignmark> fostered under <mtext>), causing a parser to resolve the
subtree in a different foreign namespace upon re-parsing the rendered
output.

Continue walking the full ancestor chain and verify that every
transition from a non-empty namespace occurs at an HTML integration
point before emitting literal text.

#### Severity
Unknown

#### References
- [https://go.dev/cl/855121](https://go.dev/cl/855121)
- [https://go.dev/issue/82622](https://go.dev/issue/82622)
-
[https://groups.google.com/g/golang-announce/c/sqrs2vTx_Xs](https://groups.google.com/g/golang-announce/c/sqrs2vTx_Xs)

This data is provided by
[OSV](https://osv.dev/vulnerability/GO-2026-6866) and the [Go
Vulnerability Database](https://redirect.github.com/golang/vulndb)
([CC-BY 4.0](https://redirect.github.com/golang/vulndb#license)).
</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/cozystack/cozystack).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xMzQuMSIsInVwZGF0ZWRJblZlciI6IjQ0LjI0OS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWF0ZWQiLCJzZWN1cml0eSJdfQ==-->
2026-11-26 19:13:43 +05:00
myasnikovdaniil 4e957bde0d chore(deps): update module github.com/klauspost/compress to v1.20.2 [security] (#5238)
This PR contains the following updates:

| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
|
[github.com/klauspost/compress](https://redirect.github.com/klauspost/compress)
| `v1.20.1` → `v1.20.2` |
![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fklauspost%2fcompress/v1.20.2?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fklauspost%2fcompress/v1.20.1/v1.20.2?slim=true)
|

---

### Panic on two-block frames in github.com/klauspost/compress
[CVE-2026-116591](https://nvd.nist.gov/vuln/detail/CVE-2026-116591) /
[GHSA-fpmh-frq8-7rj8](https://redirect.github.com/advisories/GHSA-fpmh-frq8-7rj8)
/ [GO-2026-6865](https://pkg.go.dev/vuln/GO-2026-6865)

<details>
<summary>More information</summary>

#### Details
Panic on two-block frames in github.com/klauspost/compress

#### Severity
Unknown

#### References
-
[https://github.com/klauspost/compress/security/advisories/GHSA-fpmh-frq8-7rj8](https://redirect.github.com/klauspost/compress/security/advisories/GHSA-fpmh-frq8-7rj8)
-
[https://github.com/klauspost/compress/commit/7f5d8528720c895a6106f201719f87eb030a565d](https://redirect.github.com/klauspost/compress/commit/7f5d8528720c895a6106f201719f87eb030a565d)
-
[https://github.com/klauspost/compress/releases/tag/v1.20.2](https://redirect.github.com/klauspost/compress/releases/tag/v1.20.2)

This data is provided by
[OSV](https://osv.dev/vulnerability/GO-2026-6865) and the [Go
Vulnerability Database](https://redirect.github.com/golang/vulndb)
([CC-BY 4.0](https://redirect.github.com/golang/vulndb#license)).
</details>

---

### Release Notes

<details>
<summary>klauspost/compress (github.com/klauspost/compress)</summary>

###
[`v1.20.2`](https://redirect.github.com/klauspost/compress/releases/tag/v1.20.2)

[Compare
Source](https://redirect.github.com/klauspost/compress/compare/v1.20.1...v1.20.2)

- zstd: Fix DecodeAll crash on specially crafted input.
[GHSA-fpmh-frq8-7rj8](https://redirect.github.com/klauspost/compress/security/advisories/GHSA-fpmh-frq8-7rj8).
- s2: fix LZ4 block conversion writing past dst by
[@&#8203;klauspost](https://redirect.github.com/klauspost) in
[#&#8203;1244](https://redirect.github.com/klauspost/compress/pull/1244)
- dict: Stricter input validation by
[@&#8203;klauspost](https://redirect.github.com/klauspost) in
[#&#8203;1250](https://redirect.github.com/klauspost/compress/pull/1250)
- zstd: reject snappy copy shorter than minimum match by
[@&#8203;Raghuvardhan-Reddy78](https://redirect.github.com/Raghuvardhan-Reddy78)
in
[#&#8203;1235](https://redirect.github.com/klauspost/compress/pull/1235)

**Full Changelog**:
<https://github.com/klauspost/compress/compare/v1.20.1...v1.20.2>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/cozystack/cozystack).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4yMjAuMCIsInVwZGF0ZWRJblZlciI6IjQ0LjI0OS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWF0ZWQiLCJzZWN1cml0eSJdfQ==-->
2026-11-26 19:11:03 +05:00
Timofei Larkin 64cd55a161 feat(kubernetes): run tenant clusters inside a cozyplane VPC (#5337)
## What this PR does

Stacked on #4508 (VMs in a cozyplane VPC). This layer runs a whole
tenant Kubernetes cluster inside a VPC: the control plane, its etcd and
the worker VMs. The `Kubernetes` cluster and each of its
`KubernetesNodes` pools set the same `network: {name: <VPC catalog
name>}`.

A VPC refuses cluster-internal destinations, so the workers, the
tenant's own pods and the konnectivity agents all need an apiserver
address inside the VPC. The platform side keeps working unchanged: it
reaches VPC pods by their fabric IPs and through ClusterIPs that resolve
to them. That covers Kamaji, CAPI, kccm, the cluster autoscaler, the
chart's Jobs, the ingress passthrough, and the `super-admin.svc`
kubeconfig Flux installs the tenant addons with.

**Control plane.** `network.name` on the `Kubernetes` cluster does three
things:
- puts the apiserver pods in the VPC
(`deployment.podAdditionalMetadata`);
- attaches their Service to it (`network.serviceAnnotations`), so that
inside the VPC the resolver answers the Service's name with a VIP from
the VPC's own range;
- stamps the cluster's own etcd through the `annotations` key of
`cozy-lib.etcd.cluster`. etcd-operator copies that annotation onto the
member Pods and both etcd Services, so the apiserver reaches its
DataStore entirely inside the VPC.

**Advertise address.** Kamaji's `advertiseAddress` is what the tenant's
`kubernetes` endpoints and the konnectivity agents dial, and its CRD
requires an IP. The right IP is the apiserver Service's VIP, which only
a pod inside the VPC can learn. In VPC mode each pool's talos-reconcile
Job starts a short-lived probe pod in the VPC. The probe resolves the
Service's FQDN and writes the answer to its termination message. The Job
reads that back with a namespaced pod `get`, patches `advertiseAddress`
(Kamaji adds it to the apiserver certificate itself), and uses the VIP
for the workers' `extraHostEntries` in place of the ClusterIP. This
happens before the pool's TalosConfigTemplate is applied, so Kamaji's
one rollout runs while the cluster has no workers yet. The Job's Role
gains `create` on pods plus `get`/`delete` on the probe pod by name, in
VPC mode only.

**Workers.** Each pool stamps `sdn.cozystack.io/vpc` on its worker VM
template, only when set, because the KubevirtMachineTemplate is
content-hash named.

**Route table.** A pool can also name a cozyplane RouteTable with
`routeTable` (a DNS-1123 name, empty by default), the same contract as
`vm-instance`'s value in #4508. When it is set, the pool renders
`sdn.cozystack.io/route-table: <routeTable>` on its worker VM template
next to `sdn.cozystack.io/vpc`, and setting or changing it rolls the
pool's workers, as `network` does. Empty renders nothing, which leaves
the VPC's default table in effect. The render fails with `routeTable` on
a cluster that does not serve `sdn.cozystack.io`, on `substrate:
proxmox`, or without `network.name`. The control plane keeps the VPC's
default table.

**Guards**, all unit-tested. The cluster refuses `network.name`:
- where `sdn.cozystack.io` is not served;
- on the proxmox substrate;
- on the tenant's shared DataStore;
- on a running cluster outside that VPC, in either direction, because
etcd-operator never re-stamps a running member.

A pool refuses a network that differs from its control plane's, again in
either direction, checked against the live apiserver Service.

Design notes:
- **The probe is interim.** A request for cozyplane to report an
attached Service's VIP on the Service itself (`sdn.cozystack.io/vpc-ip`,
the same annotation the CNI stamps on pods) is going to upstream. Once
it ships, the Job reads the annotation and the probe goes away.
- **The rejected alternative is a LoadBalancer.** Publishing the
apiserver Service and reaching it through the VPC gateway's NAT spends a
published address per cluster and makes NAT a dependency of the control
path.

Not verified on a live stand yet:
- the probe's resolution through the VPC resolver;
- worker bootstrap and konnectivity through the VIP;
- etcd member peering inside the VPC;
- OIDC mode, where the apiserver dials Keycloak's internal URL from
inside the VPC.

### Screenshots

Not a UI change.

### Downstream repositories

Walked the trigger map against the diff. terraform-provider-cozystack
models app fields by hand, so the new `network` (both apps) and
`routeTable` (KubernetesNodes) fields need its schema, model and
expand/flatten; that is cozystack/terraform-provider-cozystack#90. The
website's reference pages for kubernetes and kubernetes-nodes are
regenerated from their READMEs on release, and both apps are in the
website's app lists, so no follow-up is needed there. Nothing else in
the map is touched.

- [ ] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [x]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up: cozystack/terraform-provider-cozystack#90
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up:

### Release note

```release-note
feat(kubernetes): on the cozyplane networking variant, a tenant Kubernetes cluster can run entirely inside a VPC — network.name puts its control plane, its own etcd and its worker VMs in the VirtualPrivateCloud
```

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
* Kubernetes clusters now use dedicated etcd by default, with
configurable one- or three-member setups and storage options. Existing
clusters using shared etcd retain their current configuration.
* Clusters and worker pools can join a cozyplane VPC, subject to
platform and compatibility requirements. Changing a worker pool’s
network rolls its worker VMs.
  * Cluster status notes now identify the etcd configuration in use.

* **Bug Fixes**
* Enabled Kubernetes add-ons and supporting services can render
independently of tenant-shared etcd availability.
  * Cluster cleanup now handles dedicated etcd resources.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-26 16:24:28 +03:00
Aleksei Sviridkin fba9fa8278 docs(release): add the v1.7.0 release notes (#5163)
## What this PR does

This PR adds `docs/releasenotes/v1.7.0.md`, short hand-written release
notes used as v1.7.0 release body. File is the same as in
[e4a9d43](https://github.com/cozystack/cozystack/commit/e4a9d433ae03a64508126589a364db279291b53a)
on `release-1.7.0-rc.3` plus one sentence that links the [v1.7 upgrade
guide](https://cozystack.io/docs/v1.7/operations/cluster/upgrade-to-v1.7/).

Full v1.7.0 changelog is about 260 KB, GitHub doesn't accept that much
as release description, so release body is this file instead (about 10
KB): what has to be known before upgrading with each item linked to the
full changelog, and contributors list.

It needs to be on main because `update-releasenotes.yaml` runs on pushes
to main and reads files from main. Since
[#5142](https://github.com/cozystack/cozystack/pull/5142) the sync takes
`docs/releasenotes/<tag>.md` over the changelog and also runs when that
file changes, so a later edit of these notes reaches the release page.

This PR should be merged only after v1.7 documentation is published on
the website, before that the new link returns 404. Merging it makes
`update-releasenotes.yaml` update the v1.7.0 release body from main.

`docs/changelogs/v1.7.0.md` is not part of this PR, `tags.yaml` ports it
to main from the stable tag with its own changelog PR, so main gets the
version that shipped.

No backport to `release-1.7` - release line gets this file through
`release-1.7.0-rc.3` staging branch, where it already is, without the
upgrade guide sentence. The link exists only in this copy.

### Downstream repositories

- [x] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up:

### Release note

```release-note
NONE
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Documentation**
* Added Cozystack v1.7.0 release notes covering release highlights,
upgrade prerequisites, breaking changes, affected configurations and
resources, required upgrade actions, and reported migration or rollout
effects.
* Included contributor acknowledgements and a link to the full
changelog.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-26 13:26:02 +03:00
myasnikovdaniil bfc9aec823 docs(release): add changelog for v1.7.0 (#5162)
This PR adds the changelog for release `v1.7.0`.

✅ Changelog has been automatically generated in
`docs/changelogs/v1.7.0.md`.
2026-11-26 15:23:26 +05:00
Andrei Kvapil e6c32304b3 docs(apps): read credentials through tenantsecrets
The postgres, mariadb, mongodb and kubernetes docs, and the kubernetes
release notes, told tenants to read their credentials and kubeconfigs
with kubectl get secret. That worked only through the per-chart
dashboard Roles, which no longer exist. Point them at tenantsecret,
which serves the same data for every Secret the ApplicationDefinition
includes, as the redis and rabbitmq docs already do.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-11-26 10:52:32 +01:00
Andrei Kvapil 6ed0541eb2 fix(apps): stop granting tenants core Secrets through dashboard resource maps
Every app chart rendered a <release>-dashboard-resources Role and a
RoleBinding to the tenant's groups and ServiceAccounts. The Roles began
in 2024 as a resource map that the kubeapps dashboard read to list an
application's objects, and had no bindings. When the tenant roles lost
the core wildcard, the maps were bound so kubeapps kept working, and
they became real grants. The console that replaced kubeapps reads
Secrets through core.cozystack.io/tenantsecrets, which cozystack-api
serves with its own identity and only for what the ApplicationDefinition
admits, yet the bindings stayed.

So any tenant subject at the bound level could read the named Secrets
directly through the API server, bypassing the -rd allowlist: database
credentials, the kubernetes admin kubeconfig, Grafana's admin password.
A bucket with no users rendered an empty resourceNames list, which RBAC
reads as every Secret in the namespace.

Nothing reads these Roles' Secret rules any more. Services, ingresses
and workloadmonitors are already granted namespace-wide by the
cozy:tenant ClusterRoles, and the Secrets tenants need are all in
secrets.include. Remove the Roles and RoleBindings from every chart
except foundationdb. The qdrant and vm-instance WorkloadMonitors that
shared the file move to workloadmonitor.yaml.

foundationdb keeps its resource map and Role: they are the only way a
tenant reads <release>-config, the ConfigMap with the cluster file,
since no cozy:tenant role grants ConfigMaps and tenantsecrets serves
only Secrets. They grant ConfigMaps and no Secrets, and the map now
lists only that ConfigMap, the one entry the console reads. They go
once Cozystack can serve application ConfigMaps to tenants.

The new kubernetes chart ignores computeplane's
withholdAdminKubeconfig pin, but it stays for one more release: until
the ExternalArtifact catches up, the previous kubernetes chart would
otherwise render its admin kubeconfig rule again.

None of these objects carries helm.sh/resource-policy: keep, so Helm
deletes them on upgrade and no migration is needed.

A new bats check renders every chart under packages/apps and
packages/extra and fails if any binds a tenant subject to a Role that
grants core Secrets. The suites and e2e steps that pinned the Roles'
rules are removed with them. The charts that needed cluster state only
to render the Roles now render offline, so they leave the release-size
check's NO_OFFLINE_RENDER list.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-11-26 10:52:28 +01:00
Timofei Larkin 94c79925f8 feat(api): add the credentials API with mint and revoke subresources (#4921)
## What this PR does

Tenants read application passwords from Secrets today, and a leaked
password can't be taken back. This PR adds the platform side of the user
secrets API design (cozystack/community#137, ADR 0002): a password comes
out once from a mint, the next mint replaces it, and a revoke kills it.
The engines are converted in the PRs stacked on top, starting with
Postgres in #4922.

How it works:

- A kind's chart renders one `CredentialTemplate`
(`cozystack.io/v1alpha1`) per account: the username, the stored format
(`scram-sha-256`, `mysql-native`, `sha256` or `plaintext`), labels for
the account Secret, and an optional `valuesPath` for an operator that
reads no Secret.
- cozystack-controller keeps the account Secret `<template>.account`. It
seeds it on a release the API marked for seeding, adopts an unowned
Secret with the same username, leaves a foreign one alone with a
`SecretConflict` condition, and mirrors the record (origin, time, actor,
history) into the template status. For a `valuesPath` template it
maintains an optional `valuesFrom` entry on the release.
- `core.cozystack.io/v1alpha1` serves `credentials` as a read-only view
of the templates, plus `mint` and `revoke` subresources. A mint checks
the caller's `resourceVersion` precondition against the mirrored status,
builds the whole Secret and writes it in one request, or answers 409. It
never reads the Secret back. One API request writes one object; the
best-effort Event is the only extra write.
- The Application API marks a new release for seeding, keeps the account
`valuesFrom` entries when it rewrites a release, and refuses to delete a
suspended release that still has accounts, since Flux would skip its
uninstall.
- The dashboard gets a Credentials tab on the application page. It lists
accounts with origin and history; an administrator can mint or revoke,
and a viewer sees no buttons.

The application charts are untouched here: a kind starts using this only
when its chart renders templates. The `CredentialFormat` webhooks that
ADR 0002 describes are not in this PR, so `format.name` accepts only the
four built-in names for now.

### Screenshots

<img width="1440" height="900" alt="01-admin-tab"
src="https://github.com/user-attachments/assets/8c48086c-8f6c-4908-82c1-40e9078afe57"
/>

<img width="1440" height="900" alt="02-mint-dialog"
src="https://github.com/user-attachments/assets/802b2963-3f57-4c0b-ab84-f74bad28c343"
/>

<img width="1440" height="900" alt="03-mint-result"
src="https://github.com/user-attachments/assets/0e9ae3cc-7a3c-4daf-9a09-d4abf53bf70b"
/>

<img width="1440" height="900" alt="04-viewer-tab"
src="https://github.com/user-attachments/assets/10e940f2-4ceb-469d-a0f9-6c9d20a62919"
/>

### Downstream repositories

- [ ] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up: needed, cozystack/website#753 should document the
`Credential` mint/revoke flow and the dashboard tab
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up: needed later, a way to mint from Terraform; nothing breaks
in this PR alone
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up: none, the design is cozystack/community#137

### Release note

```release-note
feat(api): Add the credentials API. Applications that support it expose their accounts as `credentials.core.cozystack.io`; an administrator mints a password once with the `mint` subresource, and `revoke` invalidates it without issuing a new one. The dashboard shows a Credentials tab for such applications. No application uses it in this release on its own; see the per-engine changes.
```
2026-11-26 12:37:20 +03:00
Timofei Larkin eec761a40f feat(kubernetes-nodes): choose a cozyplane route table
A worker pool in a VPC always routed by the VPC's default table. routeTable
names a cozyplane RouteTable for every worker VM of the pool and renders
sdn.cozystack.io/route-table on the worker VM template, the same contract
as vm-instance's routeTable. It fails the render where cozyplane does
not serve sdn.cozystack.io, on proxmox workers, and without network.name.

Assisted-by: LLM
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2026-11-26 10:13:58 +01:00
Timofei Larkin 9e7741449c feat(kubernetes): run tenant clusters inside a cozyplane VPC
On the cozyplane networking variant a VPC refuses cluster-internal
destinations, so a tenant cluster whose workers join a VPC must bring
its control plane along: the workers, the tenant's own pods and the
konnectivity agents all need an apiserver address inside the VPC. The
platform side keeps working unchanged, since it reaches VPC pods by
their fabric IPs and through ClusterIPs that resolve to them.

network.name on the Kubernetes cluster puts the apiserver pods in the
VPC, attaches their Service to it, and stamps the cluster's own etcd,
whose operator copies the annotation onto the members and both etcd
Services, so the apiserver reaches its DataStore inside the VPC too.
The same value on each KubernetesNodes pool stamps its worker VM
template.

Kamaji's advertise address must be an IP that tenant consumers reach,
which here is the VIP the VPC knows the apiserver Service by. Only a
pod inside the VPC can learn it, so the pools' talos-reconcile Job
starts a probe pod in the VPC, reads the address it resolves back from
its termination message, advertises it, and gives it to the workers'
host entries in place of the ClusterIP.

The cluster refuses a VPC where sdn.cozystack.io is not served, on the
proxmox substrate, on the tenant's shared DataStore, and on a running
cluster outside that VPC, since etcd-operator never moves a running
member. A pool refuses a network that differs from its control
plane's.

Both checks hold where a live object does not exist yet: the pools'
reconcile Job compares the apiserver Service's VPC before the probe,
and the etcd render compares the live EtcdCluster's. The probe's Role
grants only get and delete, so a probe left by an interrupted attempt
is deleted without waiting and polled with get. network.name is a
DNS-1123 label in both apps, and every annotation carrying it is quoted.

Assisted-by: LLM
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2026-11-26 10:13:47 +01:00
renovate[bot] 16d0f1fd19 chore(deps): update module golang.org/x/net to v0.62.0 [security] 2026-11-26 09:09:59 +00:00
myasnikovdaniil c55c05d351 chore(deps): update module golang.org/x/crypto to v0.59.0 [security] (#5285)
This PR contains the following updates:

| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [golang.org/x/crypto](https://pkg.go.dev/golang.org/x/crypto) |
[`v0.58.0` →
`v0.59.0`](https://cs.opensource.google/go/x/crypto/+/refs/tags/v0.58.0...refs/tags/v0.59.0)
|
![age](https://developer.mend.io/api/mc/badges/age/go/golang.org%2fx%2fcrypto/v0.59.0?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/go/golang.org%2fx%2fcrypto/v0.58.0/v0.59.0?slim=true)
|

---

### The golang.org/x/crypto/openpgp package is unmaintained, unsafe by
design, and has known security issues
[GO-2026-5932](https://pkg.go.dev/vuln/GO-2026-5932)

<details>
<summary>More information</summary>

#### Details
The golang.org/x/crypto/openpgp package is unsafe by design, has
numerous known security issues, is not maintained, and should not be
used.

If you are required to interoperate with OpenPGP systems and need a
maintained package, consider github.com/ProtonMail/go-crypto/openpgp
which is a maintained fork that aims to be a drop-in replacement for
this package.

#### Severity
Unknown

#### References
- [https://go.dev/issue/44226](https://go.dev/issue/44226)
- [https://go.dev/issue/81227](https://go.dev/issue/81227)

This data is provided by
[OSV](https://osv.dev/vulnerability/GO-2026-5932) and the [Go
Vulnerability Database](https://redirect.github.com/golang/vulndb)
([CC-BY 4.0](https://redirect.github.com/golang/vulndb#license)).
</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/cozystack/cozystack).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4yMjguMCIsInVwZGF0ZWRJblZlciI6IjQ0LjI0OS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWF0ZWQiLCJzZWN1cml0eSJdfQ==-->
2026-11-26 14:07:20 +05:00
Andrey Kolkov ef32ff8d71 fix(postgres): bound a backup whose cnpg Backup stalls in pending (#5320)
<!-- Thank you for making a contribution! Here are some tips for you:
- Use Conventional Commits for the PR title: `type(scope): description`
- Types: feat, fix, security (a fix that comes through a security
advisory), docs, style, refactor, perf, test, build, ci, chore
- Scopes are not an exhaustive list — pick the most specific scope for
the change and extend the list when a genuinely new area appears.
Examples:
- System components: dashboard, platform, operator, cilium, kube-ovn,
linstor, fluxcd, cluster-api
- Managed apps: postgres, mariadb, redis, kafka, clickhouse,
virtual-machine, kubernetes
- Development and maintenance: api, hack, tests, ci, docs, maintenance
- Breaking changes: append `!` after type/scope (`feat(api)!: ...`) or
add a `BREAKING CHANGE:` footer
- If it's a work in progress, consider creating this PR as a draft.
- Don't hesistate to ask for opinion and review in the community chats,
even if it's still a draft.
- Fixes merged to `main` reach the release lines the backport batch runs
for automatically, so do not open backport PRs by hand:
https://github.com/cozystack/cozystack/blob/main/docs/release/backports.md
-->

## What this PR does

Part of #5209. The other part, a Plan that does not start a run while
its previous BackupJob is still running, follows in a separate PR.

A Postgres BackupJob whose `cnpg.io/Backup` never left `pending` stayed
`Running` with no bound. In CloudNativePG 1.30.0 a Backup is pending for
one of two reasons: it is queued behind a started or running backup of
the same Cluster (`waitIfOtherBackupsRunning`), which is healthy, or the
instance to run it on cannot be found or is not ready
(`startBackupManagedByInstance`), which lasts for as long as the Cluster
is fenced. A restart on another instance goes through the second path
too.

The driver tells the two apart only by whether a backup of the Cluster
is `started` or `running`; it does not model which pending Backup
CloudNativePG lets through first. Each poll reads the Cluster's backups
from the cache, and the job reads them again from the apiserver right
before it gives up, since the cache can still show pending a backup that
has just started. Behind a started or running backup the wait stays
uncapped and the BackupJob says which backup it waits for. Otherwise the
BackupJob records a `CNPGBackupStalled` condition, and once that has
lasted the backup deadline (30 minutes, the same bound as the plugin
rollout wait) the BackupJob fails with the cause, and its own
`cnpg.io/Backup` is deleted so it does not run later with no Cozystack
`Backup` recording it. The delete is conditional on the UID and
resourceVersion the driver read, so a Backup CloudNativePG started in
between is kept. The give-up is recorded before the delete, so a Backup
found missing later fails the job only when the driver removed it; a
Backup deleted by hand is replaced and its stall counts afresh. The
stall also ends, and a later one counts afresh, as soon as the Backup
moves to any other phase.

The reason CloudNativePG gives (`BackupPending: Backup target pod not
ready: ...`) exists only as an event on the Backup, so the condition and
the failure message carry the newest Warning event recorded on the job's
own Backup, or, when it carries none, on another pending backup of the
same Cluster. The events are listed by the Backup's UID through the
uncached reader, so the controller gains `list` on events and no watch;
when the read fails, the message says so instead of omitting the reason.

A job is no longer held on the plugin rollout another job started when
the Cluster is fenced and every instance pod postdates that attach: a
fenced Cluster is neither healthy nor ready until the fence is lifted,
so waiting there would only delay the bound by up to the rollout
deadline. An instance pod older than the attach still holds the job, so
a Backup never starts on a pod without the plugin.

The postgres e2e (`examples/backups/postgres/run-all.sh` step 26) fences
the source Cluster, checks that a BackupJob reports the stall with the
reason CloudNativePG recorded, which exercises the `involvedObject.uid`
selector and the events grant against a real apiserver and replaces a
helm-unittest that only matched the rendered rule, then lifts the fence
and checks that the same job completes with the stall ended. Failing at
the deadline is covered by the unit tests.

Known limit, left as is: a backup of the Cluster in `finalizing` does
not count as running, which only a hand-made `volumeSnapshot` Backup can
reach, since platform flows create plugin backups only.

### Screenshots

<!-- REQUIRED for UI changes: attach screenshots or screen recordings
demonstrating
the visual impact of your changes. PRs with UI changes without
screenshots will not be merged. -->

### Downstream repositories

<!--
Cozystack is upstream for repositories that are NOT kept in sync with it
automatically, and nothing in CI compares the two sides, so a change
here can break them silently.

Which change forces what, and which file to touch, is the trigger map in
docs/agents/contributing.md under "Downstream Repositories". Walk it
before you tick anything.

IF YOU ARE AN AI AGENT OR AN LLM, THIS IS PART OF THE TASK, NOT A FORM
TO FILL IN:

1. Walk the trigger map against the actual diff of this PR, file by
file. Do not decide from the PR title or from your memory of what you
changed.
2. For every repository you tick, open the follow-up PR there and link
it on the same line. A ticked box with no link claims work that does not
exist, which is worse than an empty box. Search that repository for an
open PR or issue covering it first, and link that instead of filing a
duplicate.
3. When the follow-up is out of scope, or needs a decision that is not
yours to make, open an issue in that repository instead, link that, and
say so in the PR body. Do not push a speculative PR into another
repository just to fill a line here.
4. Do not tick "No downstream repository is affected" to make the
checklist go away. If you are unsure, leave every box empty and say so
in the PR body, so a human decides.
-->

- [x] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up:

### Release note

<!--  Write a release note:
- Explain what has changed internally and for users.
- Start with the same `type(scope):` prefix as in the PR title
- Follow the guidelines at
https://github.com/kubernetes/community/blob/master/contributors/guide/release-notes.md.
-->

```release-note
fix(postgres): a Postgres BackupJob whose cnpg.io/Backup stays pending because its target instance is not ready, for example while the Cluster is fenced, now fails after 30 minutes with the reason CloudNativePG gives, and the abandoned cnpg.io/Backup is removed. A Backup queued behind a running backup of the same Cluster is not affected.
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Bug Fixes**
* Pending backups that stall for 30 minutes now fail with a recorded
reason. Backups queued behind an executing backup, progressing, or
finished are not incorrectly treated as stalled.
* Backup handling accounts for concurrent progress, external deletion,
and retries, and reports the newest available warning for a pending
backup.
* Fenced clusters now use instance-pod creation time when evaluating
plugin rollout readiness.

* **Tests**
* Expanded coverage for stalled backups, warning reporting, queue
handling, and fenced-cluster backup recovery.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-26 15:59:36 +07:00
Aleksei Sviridkin 40b4fc6ad4 fix(ingress-nginx): pick up the nginx rebuild with the remaining CVE fixes (#5436)
## What this PR does

Moves the ingress-nginx controller from `v1.11.6-cozystack.1` to
`v1.11.6-cozystack.3`. It is the same v1.11.6 controller and nginx
1.25.5, rebuilt with the rest of the nginx fixes the controller can
reach. cozystack.1 had only the two HTTP/2 fixes.

| Fork PR | nginx commits | Fixes |
| --- | --- | --- |
| cozystack/ingress-nginx-with-protobuf-exporter#14 | 6, from 1.30.7 |
CVE-2026-118899 (SSL request body loop, also HTTP/3), CVE-2026-123634
(resolver), CVE-2026-121810 (HTTP/3), CVE-2026-125283 (`try_files` with
`alias`) |
| cozystack/ingress-nginx-with-protobuf-exporter#15 | 10, from 1.26.3 to
1.30.8 | CVE-2025-23419 (TLSv1.3 resumption across SNI names),
CVE-2026-1642 (HTTPS backends), CVE-2026-42945 and CVE-2026-9256
(`rewrite`), CVE-2026-42055 (gRPC backends), CVE-2026-97629 (session
tickets), CVE-2026-132779 (`ssl-early-data`) |

Advisories that need a module the controller does not build (mail, dav,
mp4, slice) or a directive the template does not emit are left out, as
is the CVE-2026-42533 series: it rewrites the script engine the Lua
modules build on, and the template's maps carry no regex that reaches
it. The fork's `images/controller/PROVENANCE.md` lists every patch.

CVE-2026-97629 is the one reachable on platform defaults; #5407 already
turned session tickets off as a mitigation. This image fixes it in
nginx, and the `ssl-session-tickets: "false"` setting stays as it is.

Checked on the published image (`sha256:059a75d5…`, amd64 and arm64),
without running it:

- the nginx binary reports 1.25.5 with the same configure arguments as
in cozystack.1 and .2, and differs from the one in cozystack.2;
- it carries strings the new patches add, such as the gRPC header length
errors and `SSL_SESSION_get0_hostname`;
- it keeps `cap_net_bind_service` in its file capabilities.

The fork's build compares the configure arguments with the shipped
binary and fails on a mismatch. `nginx -t` and a live request were not
run for this image, and neither was a live cluster.

`nginx -v` still says 1.25.5, so scanners that match on the version will
keep flagging it.

### Screenshots

N/A, no UI changes.

### Downstream repositories

Walked the trigger map against the diff: an image tag and digest in
`packages/system/ingress-nginx/values.yaml`. No package, values key,
schema or app README changes.

- [x] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up:

### Release note

```release-note
fix(ingress-nginx): the ingress-nginx controller's nginx 1.25.5 now carries the fixes for CVE-2025-23419, CVE-2026-1642, CVE-2026-9256, CVE-2026-42055, CVE-2026-42945, CVE-2026-97629, CVE-2026-118899, CVE-2026-121810, CVE-2026-123634, CVE-2026-125283 and CVE-2026-132779. nginx still reports version 1.25.5.
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Updates**
  * Updated the ingress controller to a newer build.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-26 11:22:51 +03:00
Aleksei Sviridkin 74e103d6f2 ci(workflows): run push and schedule workflows only in cozystack/cozystack (#5186)
## What this PR does

GitHub runs no CI in a security advisory's temporary private fork, and
merging from the advisory skips branch protection, so an embargoed fix
currently reaches `main` with nothing having run on it. This PR prepares
the repository for verifying such a fix in a separate private copy of
the repository (an embargo mirror), and documents that process.

- Every job of a workflow that a push or a schedule starts now runs only
in `cozystack/cozystack`. A mirror receives all workflow files on each
sync, and without the guard it would build, publish, prune and cut
releases from that copy on every sync and cron tick. Workflows that also
run on `pull_request` keep running on pull requests, which is what the
mirror is for. Every job carries the guard rather than only the root
jobs, because a job whose condition calls a status function such as
`!cancelled()` runs even when the job it needs was skipped.
- `hack/workflow-repo-guard.bats` holds every current and future push or
schedule workflow to that guard, accepting it only as the leading
conjunct so nothing ORed after it can reopen the job.
- `docs/security/incident-response.md` describes the verification flow:
sync the mirror on demand, open the fix PR inside it, record the green
run in the advisory, then merge from the advisory. It also records why
the mirror must not hold the public registry credentials: pull request
CI pushes every image and the packages artifact (the full chart tree) to
a registry that is anonymously readable, tag listing included, so a run
there would publish the fix before the release.

Behaviour in `cozystack/cozystack` is unchanged: the guard is true
there, and each existing condition is kept intact inside the new
conjunction. Contributor forks with Actions enabled stop running these
workflows too.

Out of scope, as a follow-up: letting pull request CI push to a private
registry and pull from it in the E2E cluster, so the mirror can run the
E2E suite and not only planning, pre-commit and the unit tests.

Verification:

- `hack/workflow-repo-guard.bats` was red before the workflow changes
(30 unguarded jobs) and is green after; removing the guard from
`tags.yaml` `rc-e2e`, dropping the pull request clause from
`zizmor.yml`, or adding an unguarded scheduled workflow each turns it
red.
- Every changed workflow is identical to `main` once job `if` fields are
removed (`yq 'del(.jobs[].if)'`).
- `zizmor --offline` reports no findings; `actionlint` reports the same
findings on the changed files as on `main`.
- `hack/stitch-multiarch_test.bats` pinned the exact `if` of two
`tags.yaml` jobs and is updated to the guarded form.

### Screenshots

Not a UI change.

### Downstream repositories

- [x] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up:

The trigger map entry that touches this diff is `cozystack/ccp` for
`tags.yaml`: its `package-bump` skill describes the release pipeline of
`cozystack/cozystack`, which this PR does not change.

### Release note

```release-note
ci(workflows): push- and schedule-triggered workflows run only in cozystack/cozystack, so a private mirror used to verify embargoed security fixes does not build, publish or release from its copy.
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **CI**
* Scheduled, release, and maintenance workflows now run only in the
canonical repository. Pull-request checks continue to run where
configured.
* Build, validation, and security workflows now follow
repository-specific run conditions.

* **Documentation**
* Updated incident-response guidance with steps for verifying fixes in a
private advisory mirror, including CI limitations, check requirements,
and credential restrictions.

* **Tests**
* Added workflow checks to verify repository guards and event-specific
conditions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-26 11:09:54 +03:00
Aleksei Sviridkin 180c01170f fix(ingress): restore visitor IPs through SSL passthrough (#5443)
## What this PR does

Closes #5327.

With `cloudflareProxy: true`, HTTPS reaches nginx through
ssl-passthrough on loopback, so an IP whitelist sees `127.0.0.1` instead
of the visitor and rejects legitimate Cloudflare traffic. This change
validates the original transport peer before the whitelist, restoring
the visitor IP for Cloudflare requests without reopening the spoofing
fixed by #4444.

Direct HTTPS requests that bypass Cloudflare still appear as
`127.0.0.1`, as before.

### Validation

- `helm unittest packages/extra/ingress`: 34/34 tests passed, including
a separate run with helm-unittest 1.1.2.
- `make --directory=packages/extra/ingress show NAMESPACE=tenant-root`:
passed against the test cluster after rebasing on `upstream/main`.
- On an isolated ingress-nginx v1.11.6 controller, `nginx -t` passed.
Spoofed headers over HTTP and HTTPS returned 403. A trusted Cloudflare
PROXY-protocol source with an allowed visitor passed the whitelist and
the access log contained the visitor IP; an untrusted source or a
visitor outside the whitelist returned 403.
- A real Cloudflare end-to-end request was not tested.

### Screenshots

Not applicable; this PR does not change the UI.

### Downstream repositories

- [x] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up:

### Release note

```release-note
fix(ingress): restore visitor IP handling for Cloudflare-proxied HTTPS through ssl-passthrough while rejecting spoofed `CF-Connecting-IP` headers before IP whitelists
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Bug Fixes**
* Cloudflare-proxied ingress accepts `CF-Connecting-IP` only from
trusted Cloudflare address ranges and returns HTTP 403 when an untrusted
source provides the header.
* When no PROXY protocol address is available, source checks use the
direct connection address.
* Loopback addresses are included in trusted real-IP ranges, and the
existing keepalive setting is preserved.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-26 04:39:50 +03:00
Aleksei Sviridkin ed4a378428 style(ingress): drop blank lines from the Cloudflare geo block
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>
2026-11-26 03:31:51 +03:00
toribru 00a540eb62 fix(ingress): restore visitor IPs through SSL passthrough
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>
2026-11-26 01:30:15 +03:00
Aleksei Sviridkin 8cab9b7d7b refactor(tenant): make gateway a plain bool (#5408)
<!-- Thank you for making a contribution! Here are some tips for you:
- Use Conventional Commits for the PR title: `type(scope): description`
- Types: feat, fix, security (a fix that comes through a security
advisory), docs, style, refactor, perf, test, build, ci, chore
- Scopes are not an exhaustive list — pick the most specific scope for
the change and extend the list when a genuinely new area appears.
Examples:
- System components: dashboard, platform, operator, cilium, kube-ovn,
linstor, fluxcd, cluster-api
- Managed apps: postgres, mariadb, redis, kafka, clickhouse,
virtual-machine, kubernetes
- Development and maintenance: api, hack, tests, ci, docs, maintenance
- Breaking changes: append `!` after type/scope (`feat(api)!: ...`) or
add a `BREAKING CHANGE:` footer
- If it's a work in progress, consider creating this PR as a draft.
- Don't hesistate to ask for opinion and review in the community chats,
even if it's still a draft.
- Fixes merged to `main` reach the release lines the backport batch runs
for automatically, so do not open backport PRs by hand:
https://github.com/cozystack/cozystack/blob/main/docs/release/backports.md
-->

## What this PR does

<!-- Link the issues this PR addresses. For a complete fix targeting the
default branch, use Closes #N (Closes owner/repository#N for another
repository). Otherwise use a non-closing reference; release-branch PRs
need manual issue linking and closure when appropriate. -->

Closes #4542.

Makes `tenant.spec.gateway` a plain boolean defaulting to `false` and
removes the unset-specific helper branch. Both `false` and an omitted
key retain the existing behavior: the tenant owns no Gateway and
inherits the nearest ancestor Gateway. Setting `true` still gives the
tenant its own Gateway.

The API now serializes `gateway: false`, and the dashboard shows the
`gateway` checkbox next to `ingress`, unchecked by default. The chart
test now verifies the rendered namespace label for both `false` and
`true`.

### Screenshots

<!-- REQUIRED for UI changes: attach screenshots or screen recordings
demonstrating
the visual impact of your changes. PRs with UI changes without
screenshots will not be merged. -->

N/A

### Downstream repositories

<!--
Cozystack is upstream for repositories that are NOT kept in sync with it
automatically, and nothing in CI compares the two sides, so a change
here can break them silently.

Which change forces what, and which file to touch, is the trigger map in
docs/agents/contributing.md under "Downstream Repositories". Walk it
before you tick anything.

IF YOU ARE AN AI AGENT OR AN LLM, THIS IS PART OF THE TASK, NOT A FORM
TO FILL IN:

1. Walk the trigger map against the actual diff of this PR, file by
file. Do not decide from the PR title or from your memory of what you
changed.
2. For every repository you tick, open the follow-up PR there and link
it on the same line. A ticked box with no link claims work that does not
exist, which is worse than an empty box. Search that repository for an
open PR or issue covering it first, and link that instead of filing a
duplicate.
3. When the follow-up is out of scope, or needs a decision that is not
yours to make, open an issue in that repository instead, link that, and
say so in the PR body. Do not push a speculative PR into another
repository just to fill a line here.
4. Do not tick "No downstream repository is affected" to make the
checklist go away. If you are unsure, leave every box empty and say so
in the PR body, so a human decides.
-->

I walked the trigger map against the diff. The tenant `gateway` default
and API serialization change reaches the hand-written Terraform
provider's documentation and key-presence/null assumptions. Follow-up is
tracked in cozystack/terraform-provider-cozystack#88; no provider change
is included in this PR. The website already lists tenant in its managed
app set, and its stable-tag automation regenerates the tenant reference
from README, so no manual website follow-up is required. No other
downstream trigger applies.

- [ ] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [x]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up: cozystack/terraform-provider-cozystack#88
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up:

### Release note

<!--  Write a release note:
- Explain what has changed internally and for users.
- Start with the same `type(scope):` prefix as in the PR title
- Follow the guidelines at
https://github.com/kubernetes/community/blob/master/contributors/guide/release-notes.md.
-->

```release-note
refactor(tenant): make `gateway` a plain boolean defaulting to `false`; the dashboard now shows the `gateway` checkbox next to `ingress`, unchecked by default. Existing routing behavior is unchanged: `false` or an omitted value inherits the nearest ancestor Gateway, while `true` gives the tenant its own Gateway.
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Documentation**
* Clarified that `gateway: false` is the default and uses the nearest
ancestor’s Gateway, falling back to Ingress when no ancestor owns one.
* Updated tenant configuration references to display the Gateway setting
and its class in the dashboard.
* **Bug Fixes**
* Confirmed that `gateway: false` inherits the parent Gateway without
creating a tenant-owned Gateway, while `gateway: true` identifies the
tenant namespace as owning its dedicated Gateway.
* Tenant configuration now includes the Gateway value explicitly when it
is false.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-26 00:44:33 +03:00
Aleksei Sviridkin 22843c5c5c fix(kubernetes-nodes): surge one worker at a time during a pool rollout (#5399)
<!-- Thank you for making a contribution! Here are some tips for you:
- Use Conventional Commits for the PR title: `type(scope): description`
- Types: feat, fix, security (a fix that comes through a security
advisory), docs, style, refactor, perf, test, build, ci, chore
- Scopes are not an exhaustive list — pick the most specific scope for
the change and extend the list when a genuinely new area appears.
Examples:
- System components: dashboard, platform, operator, cilium, kube-ovn,
linstor, fluxcd, cluster-api
- Managed apps: postgres, mariadb, redis, kafka, clickhouse,
virtual-machine, kubernetes
- Development and maintenance: api, hack, tests, ci, docs, maintenance
- Breaking changes: append `!` after type/scope (`feat(api)!: ...`) or
add a `BREAKING CHANGE:` footer
- If it's a work in progress, consider creating this PR as a draft.
- Don't hesistate to ask for opinion and review in the community chats,
even if it's still a draft.
- Fixes merged to `main` reach the release lines the backport batch runs
for automatically, so do not open backport PRs by hand:
https://github.com/cozystack/cozystack/blob/main/docs/release/backports.md
-->

## What this PR does

A worker pool rollout (instance type, image or version change) currently
surges up to `maxReplicas` new VMs before draining an old one, so a pool
running 8 workers under a ceiling of 10 can reach 18 VMs at its peak.
Those VMs land in the tenant's namespace: today they count against its
`ResourceQuota`, and under [tenant quotas as reservation
limits](https://github.com/cozystack/community/pull/48), where a pool
reserves `maxReplicas` workers, they are capacity nobody reserved. This
PR fixes the surge at one Machine per pool.

The surge is treated as platform margin rather than tenant budget:
rollouts are mostly platform-driven, and charging them to the tenant
would block a platform upgrade for any tenant whose pool sits at its
ceiling. Bounding that margin is what this PR does. `maxUnavailable` is
untouched, so a node is still only drained once its replacement is up
(#5153).

The value is the open question for maintainers. **1** keeps the loan to
a single worker per pool and is what this PR ships; a large pool then
rolls one worker at a time. **2** halves the rollout time of a large
pool at twice the margin. I would rather not make it a chart value,
since tenants write the values and would then size the platform's margin
themselves.

Tested with `helm unittest` on `kubernetes-nodes`; the three golden
renders change only in `maxSurge`.

Refs: cozystack/community#48, cozystack/cozystack#5397

### Screenshots

Not a UI change.

### Downstream repositories

<!--
Cozystack is upstream for repositories that are NOT kept in sync with it
automatically, and nothing in CI compares the two sides, so a change
here can break them silently.

Which change forces what, and which file to touch, is the trigger map in
docs/agents/contributing.md under "Downstream Repositories". Walk it
before you tick anything.

IF YOU ARE AN AI AGENT OR AN LLM, THIS IS PART OF THE TASK, NOT A FORM
TO FILL IN:

1. Walk the trigger map against the actual diff of this PR, file by
file. Do not decide from the PR title or from your memory of what you
changed.
2. For every repository you tick, open the follow-up PR there and link
it on the same line. A ticked box with no link claims work that does not
exist, which is worse than an empty box. Search that repository for an
open PR or issue covering it first, and link that instead of filing a
duplicate.
3. When the follow-up is out of scope, or needs a decision that is not
yours to make, open an issue in that repository instead, link that, and
say so in the PR body. Do not push a speculative PR into another
repository just to fill a line here.
4. Do not tick "No downstream repository is affected" to make the
checklist go away. If you are unsure, leave every box empty and say so
in the PR body, so a human decides.
-->

I walked the trigger map against the diff: one template line, its
comment and its tests. No values key, schema, default, version enum or
release name changes.

- [x] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up:

### Release note

<!--  Write a release note:
- Explain what has changed internally and for users.
- Start with the same `type(scope):` prefix as in the PR title
- Follow the guidelines at
https://github.com/kubernetes/community/blob/master/contributors/guide/release-notes.md.
-->

```release-note
fix(kubernetes-nodes): a worker pool rollout now adds one replacement worker at a time instead of up to the pool's maxReplicas, bounding the extra capacity a rollout uses in the tenant's namespace. Large pools roll out more slowly.
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Behavior Changes**
* Rolling updates now allow a fixed surge of one worker at a time,
regardless of the pool’s maximum replica count. Pools with higher
replica limits no longer increase the surge allowance. This change
applies even when the pool’s minimum and maximum replica counts are both
set to five. The existing default and explicitly configured
`maxUnavailable` behavior remain unchanged.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-25 22:21:10 +03:00
MugunthSureshkanna 4d3226f224 test(seaweedfs): cover zone pool collisions with base classes
Assisted-by: LLM
Signed-off-by: MugunthSureshkanna <mugunth.sureshkanna@gmail.com>
2026-11-25 11:40:49 -06:00
Aleksei Sviridkin 054b4ef4bc fix(linstor): gate group snapshots on the v1 group snapshot API (#5430)
## What this PR does

The linstor group snapshot gate and the linstor
`VolumeGroupSnapshotClass` were tied to
`groupsnapshot.storage.k8s.io/v1beta2`, on the grounds that
piraeus-operator probes v1beta2. On main it does not: piraeus-operator
v2.12.1 probes v1, csi-snapshotter v8.7.0 reads the content and class
kinds at v1, and snapshot-controller v8.7.0 watches all three kinds at
v1. The vendored chart serves v1, v1beta1 and v1beta2 today, so nothing
is broken yet, but once upstream stops serving v1beta2 the gate would
turn group snapshots off while every component that acts on them could
still use them.

The first commit gates on v1 and moves the class to v1. It also replaces
the comment that said csi-snapshotter stalls when the gate is on and the
API is missing: v8.7.0 logs a warning and runs without group snapshots.
Velero 1.18 reads group snapshots at v1beta2, so the vm-instance hook,
which gates on v1beta2 for Velero, stays as it is.

The second commit rewrites the snapshot-controller CRD test. It pinned
the vendored chart's layout (six CRD documents, v1beta2 as the storage
version, no v1alpha1) and would go red on a correct `make update` that
moves storage to v1. It now asserts what the platform needs: every group
snapshot CRD serves v1 and v1beta2, the three volume snapshot CRDs are
rendered, and every rendered CRD is kept on uninstall.

On upgrade, an install running the CRDs from this chart sees no change
in the gate and no csi-controller rollout. The class is updated in
place, since Helm matches release objects by group and kind. The only
install that flips is one whose distribution ships group snapshot CRDs
with v1beta2 but not v1: the gate goes from on to off and the class is
removed, and csi-snapshotter there was already disabling the feature at
startup.

I left the `-eq 3` check in the platform `image-migrations` target
alone. It stops an image from shipping where migration 62 deletes the
old CRDs and has nothing to recreate them from; asserting the three file
names instead would copy the list migration 62 already holds, and the
count fails loudly if upstream adds a CRD.

Tested with `helm unittest` on `packages/system/linstor` and
`packages/system/snapshot-controller`. I also checked that the new CRD
test fails when v1 or v1beta2 stops being served, when `keepCRDs` is
false, and when no CRD renders. Nothing was run against a cluster.

### Screenshots

Not a UI change.

### Downstream repositories

- [x] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up:

### Release note

```release-note
fix(linstor): enable volume group snapshots based on the groupsnapshot.storage.k8s.io/v1 API that csi-snapshotter and snapshot-controller use, so they keep working once upstream stops serving v1beta2.
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
* LINSTOR group snapshot support now uses the stable
`groupsnapshot.storage.k8s.io/v1` API when all required resources are
available.
* Group snapshot resources are served through both v1 and v1beta2,
supporting components that use either API version.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-25 19:52:11 +03:00
Aleksei Sviridkin cdec07d0bd refactor(backups): stop annotating restored PVCs for CDI claim adoption (#5428)
<!-- Thank you for making a contribution! Here are some tips for you:
- Use Conventional Commits for the PR title: `type(scope): description`
- Types: feat, fix, security (a fix that comes through a security
advisory), docs, style, refactor, perf, test, build, ci, chore
- Scopes are not an exhaustive list — pick the most specific scope for
the change and extend the list when a genuinely new area appears.
Examples:
- System components: dashboard, platform, operator, cilium, kube-ovn,
linstor, fluxcd, cluster-api
- Managed apps: postgres, mariadb, redis, kafka, clickhouse,
virtual-machine, kubernetes
- Development and maintenance: api, hack, tests, ci, docs, maintenance
- Breaking changes: append `!` after type/scope (`feat(api)!: ...`) or
add a `BREAKING CHANGE:` footer
- If it's a work in progress, consider creating this PR as a draft.
- Don't hesistate to ask for opinion and review in the community chats,
even if it's still a draft.
- Fixes merged to `main` reach the release lines the backport batch runs
for automatically, so do not open backport PRs by hand:
https://github.com/cozystack/cozystack/blob/main/docs/release/backports.md
-->

## What this PR does

<!-- Link the issues this PR addresses. For a complete fix targeting the
default branch, use Closes #N (Closes owner/repository#N for another
repository). Otherwise use a non-closing reference; release-branch PRs
need manual issue linking and closure when appropriate. -->

Both Velero-based restore strategies stamp
`cdi.kubevirt.io/allowClaimAdoption=true` on every restored PVC through
a resource modifier. CDI never reads that annotation on a PVC. In CDI
v1.66.1, the version this repository ships, `AllowClaimAdoption` in
`pkg/controller/common/util.go` is the only place the annotation is
read, and it reads it from the DataVolume; the DataVolume controller and
the admission webhook both go through it. So the PVC rule does nothing.
The VM strategy already said so in a comment and kept the rule anyway,
its tests required the rule, and the Kubernetes strategy comment and the
VM restore example presented it as part of what lets CDI adopt the
restored claim.

This PR removes the PVC rule from both strategies, the comment and
example text that describe it, and flips the two tests that required it
into tests that it is absent. Adoption keeps working the way it already
does: through the annotation the vm-disk chart sets on its DataVolume,
and for tenant Kubernetes clusters through the modifier rule that sets
it on restored DataVolumes. That rule had no test; a new one pins it as
the only rule of the volumes phase.

Restored PVCs no longer carry the annotation. Nothing in CDI reads it
there, so a restore behaves the same before and after.

The PVC rule was also the only unconditional rule of the VM strategy.
Without it, an in-place restore of a VMDisk, or of a VMInstance with no
recorded IP and MAC to keep, has no rules at all, and Velero fails
validation of a Restore whose modifier ConfigMap has an empty rule list
(`resource modifier rules cannot be empty`). So
`createResourceModifiersConfigMap` now returns nil in that case, and the
Restore is created without a resource modifier; the caller already
handled nil. The Kubernetes strategy always has one rule per phase and
is not affected.

This touches the same doc comment as #5367 (it adds a bullet next to the
one removed here), so whichever merges second resolves a one-line
conflict by keeping the HelmRelease bullet. The two changes do not
interact otherwise: #5367 relies on the DataVolume annotation, which
stays.

#### Testing

- The flipped and new tests fail before the change and pass after,
including one that an in-place VMDisk restore creates no modifier
ConfigMap and its Velero Restore has no `resourceModifier`: `go test
./internal/backupcontroller/` and `go vet ./internal/backupcontroller/`
pass.
- Velero behaviour on an empty rule list is read from Velero v1.18.1
source, the version the bundled chart deploys.
- Not run on a cluster. The claim rests on reading CDI v1.66.1 source,
not on a live restore.

### Screenshots

<!-- REQUIRED for UI changes: attach screenshots or screen recordings
demonstrating
the visual impact of your changes. PRs with UI changes without
screenshots will not be merged. -->

No UI change.

### Downstream repositories

<!--
Cozystack is upstream for repositories that are NOT kept in sync with it
automatically, and nothing in CI compares the two sides, so a change
here can break them silently.

Which change forces what, and which file to touch, is the trigger map in
docs/agents/contributing.md under "Downstream Repositories". Walk it
before you tick anything.

IF YOU ARE AN AI AGENT OR AN LLM, THIS IS PART OF THE TASK, NOT A FORM
TO FILL IN:

1. Walk the trigger map against the actual diff of this PR, file by
file. Do not decide from the PR title or from your memory of what you
changed.
2. For every repository you tick, open the follow-up PR there and link
it on the same line. A ticked box with no link claims work that does not
exist, which is worse than an empty box. Search that repository for an
open PR or issue covering it first, and link that instead of filing a
duplicate.
3. When the follow-up is out of scope, or needs a decision that is not
yours to make, open an issue in that repository instead, link that, and
say so in the PR body. Do not push a speculative PR into another
repository just to fill a line here.
4. Do not tick "No downstream repository is affected" to make the
checklist go away. If you are unsure, leave every box empty and say so
in the PR body, so a human decides.
-->

- [x] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up:

### Release note

<!--  Write a release note:
- Explain what has changed internally and for users.
- Start with the same `type(scope):` prefix as in the PR title
- Follow the guidelines at
https://github.com/kubernetes/community/blob/master/contributors/guide/release-notes.md.
-->

```release-note
refactor(backups): restored PVCs no longer get the `cdi.kubevirt.io/allowClaimAdoption` annotation, which CDI reads only on DataVolumes; claim adoption after a restore is unchanged.
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Bug Fixes**
* Updated in-place VM disk restores to apply CDI claim adoption through
the recreated DataVolume, rather than modifying restored PVCs.
* Restores no longer create an empty resource-modifier configuration
when no rules are needed.
* **Documentation**
* Clarified the in-place restore guidance for PVC adoption; OVN IP and
MAC preservation guidance remains unchanged.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-25 19:52:02 +03:00
Aleksei Sviridkin 7067313c95 fix(kubernetes): stop refusing extraOutputs hooks monitoring-agents accepts (#5427)
## What this PR does

The tenant Kubernetes application checked fluent-bit `extraOutputs` with
a regular expression over the text of an `outputs` override, written
against the exact layout of the default hook. The monitoring-agents
chart decides the same question by rendering `outputs`, so a hook
written with `{{- if .Values.config.extraOutputs }}` / `{{
.Values.config.extraOutputs }}` / `{{- end }}`, or a bare `{{
.Values.config.extraOutputs }}`, was refused by the application although
monitoring-agents renders it into `fluent-bit.conf`. I confirmed this
with `helm template` on both charts.

I kept a check in the application, because the addon fails in a
HelmRelease the tenant cannot read and the Application status reflects
only its own release. It now only requires `outputs` to mention
`.Values.config.extraOutputs`. The check stays textual because executing
a tenant template in this chart would run it in the management cluster,
and the exact check is already made by the monitoring-agents render
guard.

A new test covers the `if` form. The application tests for a
commented-out or newline-trimming hook are removed, since only the
monitoring-agents guard catches those now, and it already has tests for
both.

Follow-up to #5376.

### Screenshots

Not a UI change.

### Downstream repositories

- [x] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up:

### Release note

```release-note
fix(kubernetes): an `addons.monitoringAgents.valuesOverride` that overrides fluent-bit `outputs` and emits `extraOutputs` with an `if` block or a bare `{{ .Values.config.extraOutputs }}` is no longer refused by the application.
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Bug Fixes**
* Monitoring-agent output configuration now accepts a wider range of
template formats when including extra destinations, including
conditional hooks. Validation still requires the configuration to
reference the extra destinations setting.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-25 19:51:54 +03:00
Aleksei Sviridkin 0d75b0e352 fix(seaweedfs): stop reserving storage pool name suffixes (#5426)
## What this PR does

The SeaweedFS chart refused any storage pool named `public` or ending in
`-lock`, `-readonly` or `-public`. A second check in the same template
compares the class names each pool actually renders, against each other
and against the instance's base classes, and it already refuses every
one of those names that clashes with something. `public`, `lock` and
`readonly` clash with the base classes. `x-public`, `x-lock` and
`x-readonly` clash only when a pool `x` exists. The suffix list
therefore refused only names that clash with nothing, such as
`cdn-public` with no pool `cdn`, and it would have needed another
breaking change for every new class variant.

I removed the suffix list and kept the rendered-name check as the only
rule. Every values set that rendered before renders the same objects
now. Names that were refused without a real clash are now accepted.
Nothing that was accepted is refused, so this is not a breaking change.

The tests now cover both sides of the rule. `cdn-public`, `cdn-lock` and
`cdn-readonly` without a `cdn` pool are accepted, in `volume.pools` and
in a zone. A pool next to its own `-public`, `-readonly` or `-lock`
variant is refused with the clash message, and so is a pool named
`public`.

Related: #5316 is already handled on main by the rendered-name check
(pools named exactly `lock` or `readonly` are refused there). #5412
takes the opposite approach and extends the reserved-name list in the
same files.

### Screenshots

Not a UI change.

### Downstream repositories

- [ ] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up: the storage pools page says pool names ending in `-lock` or
`-readonly` are reserved; it should say a pool name must not render a
class name another pool or the base classes already use.
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up:

### Release note

```release-note
fix(seaweedfs): storage pool names are no longer refused for a reserved suffix; a pool is refused only when one of its BucketClass or BucketAccessClass names is already rendered by another pool or by the instance's base classes.
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Bug Fixes**
* Pool names ending in `-public`, `-lock`, or `-readonly` are now
accepted when their rendered class names don’t conflict with another
pool or a base class.
* Name collisions are still rejected with errors that identify the
conflicting rendered class.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-25 19:51:46 +03:00