Commit Graph
341 Commits
Author SHA1 Message Date
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
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
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
toribru 9bb661408a refactor(tenant): make gateway a plain bool
Assisted-by: LLM
Signed-off-by: toribru <161638395+toribru@users.noreply.github.com>
2026-11-25 16:08:29 +03:00
Timofei Larkin 37486083b9 feat(vm-instance): choose a cozyplane route table
cozyplane routes a pod by the RouteTable its sdn.cozystack.io/route-table
annotation names, and the VPC's default table when it names none. A VM
had no way to pass one, so a route such as 0/0 to the internet could only
be reached by annotating the VM by hand. routeTable renders the
annotation next to the VPC one, and fails the render where no VPC or no
cozyplane would read it.

Assisted-by: LLM
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2026-11-25 12:00:48 +01:00
Timofei Larkin a24bdb758b feat(vm-instance): join a cozyplane VPC by pod annotation
On the cozyplane networking variant there is no multus, so a VM that
listed a network rendered a multus attachment that can never resolve
and sat Pending forever. When the cluster serves sdn.cozystack.io —
detected by API discovery, the same way the Kube-OVN IP pinning is —
the chart now stamps sdn.cozystack.io/vpc:
virtualprivatecloud-<networks[0].name> on the virt-launcher pod (the
bare name resolves in the VM's own namespace) and renders no multus
networks and no secondary interfaces: the VM keeps its single pod
interface and the CNI gives it its VPC identity. A cozyplane pod joins
exactly one VPC, so more than one network entry fails the render by
name rather than attaching silently to the first. The Cilium-variant
multus path is unchanged, and the suite pins both branches.

Assisted-by: LLM
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2026-11-25 12:00:48 +01:00
IvanHunters 907d369813 feat(postgres): add an audit toggle for access and statement logging (#5404)
## What this PR does

Managed Postgres can already load pgaudit through the
`sharedPreloadLibraries` allowlist and set
`pgaudit.log`/`log_connections` through `postgresql.parameters`, but
that leaves an orchestrator such as a customer-facing panel depending on
internal parameter names to answer "who connected and what did they
run". This adds an `audit` block that bundles access and statement
auditing behind a single switch.

With `audit.enabled`, the chart adds `pgaudit` to
`shared_preload_libraries` and seeds `pgaudit.log` (set by `audit.log`,
default `write, ddl, role`), `log_connections` and `log_disconnections`.
The audit parameters are seeded as defaults, so an explicit
`pgaudit.log` or `log_connections` in `postgresql.parameters` still
takes precedence. The audit records go to the instance log, which the
platform log stack already collects, so they are queryable per database
by its labels without extra wiring. `audit` is off by default, and
toggling it restarts PostgreSQL because pgaudit is a preloaded library.

Postgres only; MariaDB, MongoDB and ClickHouse auditing are left for
follow-ups.

### Screenshots

Not applicable — no UI change.

### Downstream repositories

Walked the trigger map against the diff. One repository is reached:
`cozystack/terraform-provider-cozystack` hand-models each postgres
`values.schema.json` field, and this diff adds the `audit` block to that
schema, so the provider would need the field added to its postgres
schema and its expand/flatten pair. That is separate work there, tracked
in cozystack/terraform-provider-cozystack#87. The website postgres
reference page regenerates from the package `README.md` on release, so
it needs no manual follow-up, and `ansible-cozystack` carries no
postgres values key.

- [ ] 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#87
- [ ]
[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(postgres): managed PostgreSQL gains an `audit` toggle that enables pgaudit statement auditing and connection logging, with the audited classes set by `audit.log` (default `write, ddl, role`).
```
2026-11-25 13:16:04 +03:00
Aleksei Sviridkin ba0ff0f8e8 fix(kafka)!: require SCRAM-SHA-512 on the external listener (#5156)
<!-- 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, 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.
- Add the label `kind/backport` if it's a bugfix that needs to be
backported to a previous version.
-->

## What this PR does

With `external: true` the chart renders a Strimzi listener `external` on
port 9094, `type: loadbalancer`, with TLS on by default but **no
`authentication` block**. Anyone who can reach the public LoadBalancer
address can produce and consume on every topic; TLS only encrypts the
session. The entity operator's User Operator is already deployed, but
nothing declares a KafkaUser.

This PR:

- adds `authentication: {type: scram-sha-512}` to the `external`
listener. The internal listeners (9092 plain, 9093 TLS) are unchanged;
- adds a `users` map. Each key renders a `KafkaUser`
(`kafka.strimzi.io/v1`, `strimzi.io/cluster: <release>`,
`authentication.type: scram-sha-512`) named `<release>.<user>`; the dot
keeps it from spelling any Secret Strimzi derives from a cluster name,
this release's or another's. That name is also the SCRAM username and
the name of the Secret into which the User Operator writes the generated
password (`password`, `sasl.jaas.config`). The release prefix keeps two
Kafka instances in one tenant namespace from colliding;
- refuses user names that are not valid object names;
- lets the tenant read each user's Secret via the existing
`<release>-dashboard-resources` Role, and shows it in the tenant-secret
API: the Kafka ApplicationDefinition selects Secrets labelled
`strimzi.io/kind: KafkaUser`. The instance scope comes from the Secret's
ownership; a templated label value would never match, since only
`resourceNames` are rendered
(`internal/lineagecontrollerwebhook/kafka_rd_secrets_test.go` runs the
Strimzi Secrets through the matcher);
- rewrites the `tls.enabled` description, which said Strimzi provides no
authentication on this listener. Without TLS the data and the SCRAM
exchange are exposed, not the password itself;
- documents the client settings (SASL, truststore from
`<release>-cluster-ca-cert`) and two upgrade sequences in the README.

Passwords are always generated by Strimzi. I did not add a `password`
field like RabbitMQ's; that can come later.

**Known limit:** no ACLs. The cluster has no `authorization`, so every
authenticated user can read and write every topic. Per-user ACLs are a
follow-up.

**Breaking:** an instance with external access refuses unauthenticated
clients after the upgrade. The previous chart cannot create the users
from `users`, so the README gives two sequences: a maintenance window
(declare `users`, upgrade, then configure clients), or credentials
staged ahead by a cluster administrator through `KafkaUser` objects
carrying Helm's ownership metadata, which the upgrade adopts with their
passwords unchanged. Neither has been run on a live cluster.

**Tests**
- New `tests/external_authentication_test.yaml` (11 cases).
- The listener assertions in `kafka_test.yaml` and `kafka_tls_test.yaml`
now include the `authentication` block.
- `helm unittest packages/apps/kafka`: 114 passed.
- Not deployed on a live cluster.

**Backport:** none. Refusing existing clients after an upgrade does not
belong in a patch release, so this stays on `main` and lands in the next
minor (`backport/skip`).


### 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.
-->

- [ ] 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#86 (issue: model the
`users` map on the Kafka resource and data source)
- [ ]
[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(kafka)!: the external listener (port 9094, enabled by external: true) now requires SCRAM-SHA-512 authentication instead of accepting anonymous clients. Declare clients in the new users map; each gets a KafkaUser named <release>.<user> whose generated password is in the Secret of the same name. External clients of an instance with external access are refused after the upgrade until they authenticate; see "Upgrading an instance that has external access" in the Kafka README for a maintenance-window sequence and one that stages the credentials ahead.
```


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

## Summary by CodeRabbit

* **New Features**
* Configure SCRAM-SHA-512 users for external Kafka access. Each user
receives generated credentials and read/write access to all topics;
credential Secrets are available to tenant resources.
  * Invalid, reserved, or overlong user names are rejected.
* **Documentation**
* Clarified that external access requires SCRAM-SHA-512 authentication,
even when TLS is disabled. Without TLS, data is unencrypted and the
authentication exchange is exposed, but the password is not.
* Added external-client connection guidance, certificate trust
information, and upgrade instructions for configuring credentials.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-25 01:23:22 +03:00
Mattia Eleuteri d65fe65f0f fix(kubernetes): refuse Proxmox template tags naming another Talos
On Proxmox the template the tags select is the worker's boot disk, and
talos.version reaches only the installer in the machineconfig. The bump
of the default changes that machineconfig and rolls every pool, so a
pool still tagged for the previous release would clone the old template
and keep the vulnerable kernel while its config names the fixed one.
The template script tags each template talos-<version>, which is the
one link the chart can check; a tag set naming no release is left to
the operator.

Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
2026-11-24 21:12:05 +03:00
Mattia Eleuteri 470e4c55a7 fix(kubernetes): bump tenant worker Talos to v1.13.12 (CVE-2026-99999)
Tenant worker VMs default to Talos v1.13.6, whose kernel predates the
upstream fix for CVE-2026-99999 (PwnEscape), Linux commit 6785011f8b16
("ipv4: validate checksum_start before completing checksum"). The bug
lets a guest escape into its host, and a tenant worker is a host
whenever the tenant runs nested virtualization inside it. The fix was
backported in Linux 6.18.57, which Talos v1.13.12 ships.

The workers stay on the v1.13 line rather than following the host
nodes to v1.14: Talos v1.14 drops Kubernetes 1.31 and 1.32, which the
tenant chart still offers, so a v1.14 default would fail the
support-matrix guard and break the render of those clusters. The v1.13
matrix entry is unchanged.

The new release changes the worker machine config and the golden image
name, so the content-hashed TalosConfigTemplate names and the default
golden DataVolume name pinned in the chart tests move with it.

Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
Assisted-by: LLM
2026-11-24 21:12:05 +03:00
Aleksei Sviridkin 442768abb7 feat(kubernetes): give each tenant Kubernetes cluster its own etcd (#4817)
## What this PR does

A tenant Kubernetes cluster could not start until an ancestor `Tenant`
had `spec.etcd: true`. The chart read the datastore name from
`_namespace.etcd` and, with none, rendered only a
`<release>-awaiting-etcd` ConfigMap. Every cluster below that tenant
then shared one etcd, one CA and one disk, separated by key prefix only.
Whoever creates a cluster usually may not edit the `Tenant`, so anything
ordering clusters on a tenant's behalf (the portal's controller, for
one) had to flip `etcd: true` first.

This PR makes the `Kubernetes` application carry its own etcd. It
implements phases 1 and 2 of the per-cluster etcd design proposal,
[cozystack/community#25](https://github.com/cozystack/community/pull/25),
as three commits that can be split later:

1. `refactor(etcd)`: the etcd chart's `EtcdCluster`, cert-manager PKI,
`DataStore`, `WorkloadMonitor`, defrag `CronJob`, VPA and `VMPodScrape`
move into named templates in `cozy-lib`
(`packages/library/cozy-lib/templates/_etcd.tpl`), parameterised by the
cluster name. `packages/extra/etcd` calls them with `"etcd"`, and its
rendered output is byte-identical before and after (see Verification).
2. `feat(kubernetes)`: a new cluster renders its own `EtcdCluster` and
`DataStore` from those templates, and a cluster that already runs on a
shared tenant etcd keeps it.
3. `feat(platform)`: migration 63 → 64 reports which clusters stay on a
shared etcd and changes nothing.

Phases 3 and 4 (deprecating, then removing `Tenant.spec.etcd`,
`_namespace.etcd` and `cozy-lib.ns-etcd`) are left for later.

### Design

**Names.** For release `kubernetes-<name>` in namespace `<ns>`:

| Object | Name |
|---|---|
| `EtcdCluster`, its headless Service, members `<…>-xxxxx`, `<…>-client`
Service | `kubernetes-<name>-etcd` |
| Secrets | `kubernetes-<name>-etcd-{ca,client,server,peer,peer-ca}-tls`
|
| `DataStore` (cluster-scoped) | `<ns>.kubernetes-<name>` |
| DataStore endpoint | `kubernetes-<name>-etcd.<ns>.svc:2379` |

**Shared templates.** `cozy-lib.etcd.cluster` takes optional `labels`
and `annotations` and renders them into the `EtcdCluster`'s
`spec.additionalMetadata`, which etcd-operator copies onto every member
Pod and PVC. With neither set, it renders no `additionalMetadata` at
all.

**Values.** One new field, `etcd.replicas`: `3` (default) or `1`. The
schema bounds it to 1..3 and the chart refuses 2 at render time. Size
(4Gi), resources (1000m / 512Mi limits to start with) and the etcd
version (3.6.11, the etcd chart's default) are chart-internal. Where a
VerticalPodAutoscaler runs, it sizes each member's requests as it is
recreated, up to 5000m CPU / 8Gi memory divided by the platform's CPU
and memory allocation ratios (500m / 8Gi at the default ratios of 10 and
1), with the limits scaled in proportion; NOTES.txt and the README say
so.

**StorageClass.** Two new platform values,
`kubernetesEtcd.storageClassLocal` and
`kubernetesEtcd.storageClassReplicated`, reach the chart as
`_cluster.etcd-storage-class-local` (used with 3 members) and
`_cluster.etcd-storage-class-replicated` (used with 1 member). Empty
keys fall back to the namespace default StorageClass.
`spec.storage.storageClassName` is immutable on an `EtcdCluster`, so the
chart reads the live object's class on every render after the first and
never re-derives it; scaling 1 → 3 keeps the class the cluster started
with. Dropping from 3 members to 1 is refused at render time when the
etcd is on the class the platform names for 3 members, or off the class
it names for 1, because a single member would then hold the only copy of
the control-plane state on storage that does not replicate it. An etcd
that was created with one member keeps rendering whatever its class.

**New clusters vs existing ones.** The chart decides from the live
`KamajiControlPlane`, looked up by release name:

- no `KamajiControlPlane`, or one whose `spec.dataStoreName` is the
cluster's own name: own etcd;
- one that names any other `DataStore`: that `DataStore` is kept, and
the chart renders no etcd of its own.

Clusters stuck in the old awaiting-etcd state have no
`KamajiControlPlane`, so they get their own etcd on their next
reconcile. `_namespace.etcd` is deliberately not the signal.
`packages/system/cozystack-basics/templates/cozystack-values-secret.yaml`
hardcodes `etcd: tenant-root`, and
`packages/apps/tenant/templates/namespace.yaml` passes it down, so every
tenant publishes a value whether or not an etcd runs behind it.
Honouring it for new clusters would change nothing for anyone. Following
it for existing clusters is also wrong: today, switching on `spec.etcd`
for a mid-level tenant silently moves every cluster below it to a new
datastore, which is a Kamaji datastore migration. With this PR, the live
binding sticks.

An existing cluster renders exactly what it rendered before, pre-delete
hook included, apart from randomly generated Talos tokens, so the
upgrade rolls no control-plane pods. New clusters carry
`policy.cozystack.io/allow-to-etcd-cluster` instead of
`policy.cozystack.io/allow-to-etcd`, which only admits a cluster to its
tenant's shared etcd.

Both lookups the decision rests on read the chart's own live objects:
the binding its `KamajiControlPlane` already records, and the immutable
`storageClassName` of its `EtcdCluster`. Each gives the same output on
every render, and their empty branch is the new-cluster render offline
`helm template` sees, which is the kind of `lookup` the chart guidelines
allow.

**What goes away.** The `awaiting-etcd` beacon goes, along with the
`_namespace.etcd` gate on the ~25 addon and satellite templates
(`helmreleases/*`, `csi/deploy.yaml`, `kccm/manager.yaml`,
`cluster-autoscaler/deployment.yaml`, `ingress.yaml`, the Proxmox CCM
and CSI). A datastore now always exists, so these gates were always
true.

**Deletion.** The pre-delete hook deletes the `TenantControlPlane` and
waits up to 120s, and it exits 0 whatever is left, because a failing
pre-delete hook keeps the release and retries the same teardown; the one
exception is below. Kamaji's `finalizer.kamaji.clastix.io` drops the
tenant's etcd role, prefix and user and the datastore-config Secret's
finalizer, and it runs only while the `DataStore` is Ready and answers,
so a `TenantControlPlane` whose own etcd never came up or has lost
quorum would never finish deleting. On a cluster that owns its etcd,
those three objects live in the etcd this uninstall deletes next. So
when such a `TenantControlPlane` outlives the wait, the hook (Step 4a)
removes that one finalizer with a JSON patch that tests it at the index
it was read at, waits another 60s, and lets Step 4b clear the Secret's
finalizer as before. A `TenantControlPlane` on a shared `DataStore` is
left to Kamaji, since that etcd outlives the cluster. The hook also
deletes the etcd's five Certificates and then their Secrets (Step 8),
which cert-manager issues without an owner, in the same order and for
the same reason as Step 7 deletes the Talos PKI. Then:

- Helm removes the `EtcdCluster`, `DataStore` and the remaining objects;
- the member PVCs go by garbage collection, because the operator owns
them through the `EtcdMember`s.

If Step 4a's patch is rejected, or the `TenantControlPlane` cannot be
read, the hook prints its residue summary and fails before Step 8: Helm
would otherwise delete the etcd while Kamaji's finalizer still waits on
it, so the uninstall is retried with the etcd and its PKI in place.
Steps 4a and 8, that check and their RBAC (a `patch` on this release's
`TenantControlPlane`, and `delete` on the etcd Certificates and Secrets
by name) render only for a cluster that owns its etcd.

### Deviations from cozystack/community#25

- **DataStore name** is `<namespace>.<release>`, not
`<namespace>-<release>`. Tenant names are alphanumeric and nest with
dashes, so the dashed form collides: Kubernetes `foo` in `tenant-a`
gives `tenant-a-kubernetes-foo`, which is also the namespace, and
therefore the shared `DataStore` name, of tenant `foo` under tenant
`kubernetes` under `tenant-a`. A namespace cannot contain a dot. Kamaji
copies the `DataStore` name into the pod label
`component.kamaji.clastix.io/datastore`, so the name is capped at 63
characters, truncated with an 8-character hash past that.
- **No truncate-and-hash for `kubernetes.etcdName`.** The app name is
now capped at 32 characters (`@maxLength 32`, added with the nodes
split), so `kubernetes-<name>-etcd` is at most 48 characters. That is
inside the 56 the operator needs: the `<name>-client` Service and the
generated member names must fit in 63. The helper fails the render past
56 rather than rename anything.
- **"Honour an explicit `_namespace.etcd`"** means keeping a cluster on
the `DataStore` its live control plane names, for the reason above. It
does not mean following `_namespace.etcd` for new clusters.
- **`etcd.replicas` validation** is a schema range of 1..3 plus a
render-time refusal of 2, rather than a schema enum. `cozyvalues-gen`
v1.7.0, the version CI pins and the latest release, emits string members
for an integer enum, which would reject the default `3`. The aggregated
API does not validate an application's spec against its schema at all,
so neither an enum nor a CEL rule would refuse 2 at admission; Helm's
`values.schema.json` check and the render are where it is refused.
- **The delete-hook branch** keys on the same live-`KamajiControlPlane`
condition as the render, as #25 asks, and additionally checks at run
time that the `TenantControlPlane` names this cluster's own `DataStore`
before touching Kamaji's finalizer. Helm deletes release resources only
after the pre-delete hook, so the etcd outlives Kamaji's normal
finalization without any ordering inside the hook.
- **TLS** reuses the etcd chart's `secretRef` shape (chart-issued
certificates) rather than the operator's `certManager` mode. Kamaji's
`DataStore` needs the CA private key to sign each tenant's client
certificate, and `secretRef` keeps that key in a Secret the chart
controls. The server certificate also carries the operator's
`<name>-client` Service names, which the etcd chart's does not.
- **Satellites.** The `PrometheusRule` stays in the etcd chart only, so
a cluster's own etcd has no alert rules. `VMPodScrape`, VPA and the
`CiliumNetworkPolicy` render only where their APIs are served. The etcd
chart's `VMPodScrape` now selects `app.kubernetes.io/instance: etcd`
instead of `app.kubernetes.io/name: etcd`: etcd-operator stamps the
latter on every member it runs, so a tenant etcd would otherwise also
scrape the cluster etcds in its namespace and count their members as its
own.
- **Name budget.** The defrag `CronJob` is `<etcd name>-defrag`, which
reaches 55 characters for a 32-character app name while the apiserver
caps CronJob names at 52; past 52 the template truncates it and appends
an 8-character hash. The etcd chart's `etcd-defrag` is unaffected.
- **Defrag image.** The defrag container pulls
`ghcr.io/ahrtr/etcd-defrag:v0.13.0` through `cozy-lib.image`, pinned to
the multi-architecture index digest, so a configured registry mirror
applies; `_etcd.tpl` is tracked by Renovate and listed in
`IMAGE_REF_EXTRA_FILES`. This changes the etcd chart's CronJob too,
after the extraction commit. Contributed by @yankawai in #5387 and
folded in.
- **Migration.** The opt-in migration runbook is not implemented here
(see below), and no `talosconfig` is issued. The numbered migration only
reports, as #25 suggests.

### Gaps #25 did not cover

- **Backups.** Covered through the `Kubernetes` backup strategy (#4931),
which `cozy-default` routes `apps.cozystack.io/Kubernetes` to. It
resolves the datastore from the `TenantControlPlane`, so it dumps the
cluster's key prefix from its own etcd or a shared one alike. Its dump
Job runs in the application namespace, and the deny policy below would
refuse it, so the strategy's pod template now carries
`policy.cozystack.io/allow-to-etcd-cluster: {{ .Release.Prefix }}{{
.Release.Name }}-etcd`, which is inert for a cluster on a shared etcd.
The strategy's Velero half does not select the etcd's PVCs or TLS
Secrets and does not need to: the dump restores into whatever etcd the
control plane runs on.
- **Per-cluster network policy.** A `CiliumNetworkPolicy` named after
the etcd selects its member pods with `ingressDeny` on 2379/2380 against
two sets of pods and one entity. The first is pods in the tenant
namespace that are neither members nor carry
`policy.cozystack.io/allow-to-etcd-cluster: <etcd name>`, a label set on
the control-plane pods, the defrag Job and the backup dump Job. The
second is pods in any other namespace except `kube-system` and
namespaces labelled `cozystack.io/system: "true"`, which is where
Kamaji, its migrate Job and etcd-operator run. The entity is `world`,
which the tenant's `allow-external-communication` admits to every
endpoint, so sources off the cluster, such as Proxmox workers, are
denied too. The node's own `host` and `remote-node` traffic is not. Deny
rules are needed because the tenant's own policies allow all traffic
within a namespace and from ancestor tenants, and allow rules only add.
Metrics on 2381 stay open. The pods also carry `cozystack.io/service:
kubernetes-etcd` rather than `cozystack.io/service: etcd`, so the
tenant-wide `<tenant>-ingress-etcd` policy does not admit child tenants'
control planes to them. The policy renders only where Cilium serves
`cilium.io/v2/CiliumNetworkPolicy`.
- **Platform ordering.** `cozystack.kubernetes-application` now
`dependsOn` `cozystack.etcd-operator`. Both come with the isp-full
variants, the only ones the iaas bundle allows. The selective-install
fixture is unchanged (`hack/select-install.sh --disabled postgres`
produces the same set). The same edge makes an etcd-operator change
select the `kubernetes-latest`, `kubernetes-previous` and `computeplane`
e2e suites besides `etcd`, and `hack/select-e2e_test.bats` now expects
that.
- **e2e.**
- `hack/e2e-install-cozystack.bats` no longer turns on tenant-root's
etcd, which only Kubernetes clusters used, and no longer waits for it. A
cluster that fell back on a shared etcd would therefore not come up.
- `run_kubernetes_test` asserts the control plane names
`tenant-test.kubernetes-<name>` and that `kubernetes-<name>-etcd`
reaches `Available`.
- `kubernetes-latest` runs the shipped defrag CronJob once and asserts
the Job completes (from #5387), then probes the etcd client port with
`nc -z`: an unlabelled Pod in `tenant-test` and a labelled Pod in
`tenant-root` must be refused, and a labelled Pod in `tenant-test` must
connect as the control. Each Pod ends `Succeeded` only when its verdict
matches, so a probe that cannot run fails the step.
- `cozy_cleanup` waits up to 3m until the `EtcdCluster`, `DataStore`,
member PVCs and Secrets are gone, each read bounded by that deadline;
both Kubernetes suites' teardown op grows from 22m to 25m to cover it.
- The Proxmox suite's tenant drops `etcd: true` and the comment calling
it mandatory.
  - The ComputePlane suite's comment no longer cites #4726.
- `hack/admin-kubeconfig-invariant.bats` drops its two awaiting-etcd
cases, and the now-unused `tests/values-ci-no-etcd.yaml` goes with them.
- **Generated artifacts** come from the tooling. `make -C
packages/apps/kubernetes generate` produced `values.schema.json`, the
README table, `api/apps/v1alpha1/kubernetes/types.go` and
`packages/system/kubernetes-rd/cozyrds/kubernetes.yaml`. Root `make
generate` regenerated `zz_generated.deepcopy.go`, and
`pkg/generated/openapi` did not change. `make generate` in every touched
package leaves the tree clean.
- **Existing clusters.** Migration 63 → 64 lists every
`KamajiControlPlane` whose `DataStore` its own release did not render,
judged by Helm's release annotations on the `DataStore`, with that
`DataStore`'s endpoints. It writes nothing but the version stamp. Slot
check on 2026-11-23:
  - `main` ships through 62 (#5239) with `targetVersion: 63`;
- `release-1.7` ships through 60 (target 61), and `release-1.6` through
53 (target 54);
  - so this PR takes 63 and sets `targetVersion: 64`.
- **README.** `packages/apps/kubernetes/README.md` now describes the
cluster's own etcd, the case of a cluster that keeps its tenant's shared
one, the VPA sizing and the backup path. The ComputePlane README no
longer lists a tenant etcd as a prerequisite.

### Migrating an existing cluster (designed, not implemented)

Nothing here moves a cluster, and nothing should until the runbook below
has an e2e. It combines #25's runbook with SerjioTT's Talos measurements
of 2026-09-03 (about 20s copy, 43s from patch to Ready, reads
uninterrupted) and with what Kamaji 26.9.4-edge's code does.

1. **Opt-in.** The opt-in has to make the chart render the cluster's own
etcd beside the shared one, without switching `dataStoreName`. The
likely shape is a chart-internal value, or an annotation the chart
reads, that the operator sets. Wait for `Available=True`.
2. **Snapshot the source etcd.** This is the rollback path.
3. **Pre-flight reachability from the cluster's namespace, not
Kamaji's** (SerjioTT finding 1). Kamaji's migrate Job runs in Kamaji's
namespace and can reach any etcd, so the copy "succeeds" toward a target
the control-plane pods cannot dial; the new apiserver generation then
crash-loops and the cluster stays write-frozen. Run `nc -zv <target>
2379` from a pod carrying the control plane's labels in the cluster
namespace. For the per-cluster target this holds by construction (same
namespace, and the deny policy admits the control plane), but the check
stays because rollback goes the other way.
4. **Switch.** Point `KamajiControlPlane.spec.dataStoreName` at
`<ns>.<release>`, with the CAPI provider re-projecting it onto the
`TenantControlPlane`. `kamaji.clastix.io/migration-timeout` can go on
the `KamajiControlPlane`, because the provider copies annotations to the
`TenantControlPlane`. Before switching, delete any leftover
`migrate-<TCP UID>` Job in Kamaji's namespace:
- a leftover with identical arguments is taken as success and switches
the datastore without copying;
- one with different arguments is deleted and recreated, with the freeze
already installed.
5. **Verify writes, not status** (SerjioTT finding 2). Kamaji installs a
`kamaji-freeze` ValidatingWebhookConfiguration in the guest, and only
its soot controller removes it, only when the `TenantControlPlane`
status is exactly `Ready`. A paused `TenantControlPlane`, or one sitting
in `WriteLimited`, `Sleeping` or `Upgrading`, keeps the freeze. Node
leases are exempt and reads are untouched, so nodes and `kubectl get`
look healthy. The success criterion is a canary write through the guest
API; if `kamaji-freeze` is still in the guest after the
`TenantControlPlane` is `Ready`, delete it.
6. **Restart every worker kubelet, one node at a time** (SerjioTT
finding 3). Until it restarts, a kubelet keeps running existing pods but
never starts a newly bound one, so the cluster looks healthy and
silently stops starting workloads. The per-node check is a new pod
starting on that node.
- On Talos there is no operator path to the workers' API today: the
chart has a per-cluster `talos-ca` Issuer but issues no client
credentials from it, so the fallback is `virtctl restart` per VM.
- Issuing an operator `talosconfig` from that CA alongside the admin
kubeconfig is the follow-up that makes this step cheap. It is not in
this PR: it is a separate credential with its own exposure question.
- Any pod-based restarter must be deployed before the switch, because a
deaf kubelet will not start it.
7. Retain the source prefix and the snapshot for a cool-off period, then
reclaim. Kamaji does not clean the old prefix after a migration.
Rollback is the same procedure in reverse, against the retained
snapshot.

### Test plan

Done here, on today's `main`, no cluster involved:

- [x] `helm template` of `packages/extra/etcd` before and after the
extraction (commit 1) is byte-identical: 14 renders (default; 1 member +
local SC + 10Gi; resources with CPU and memory allocation ratios +
another version; a global topology spread; a hard affinity with 5
members and 512Mi; leftover `backup.*` values with 0 members; 1 member
at 8Gi with a CPU allocation ratio, for the defrag quota flag), each in
`tenant-root` and `tenant-abc`, all identical by sha256. After commit 2
the one difference in each is the `VMPodScrape` selector.
- [x] `helm template` of `packages/apps/kubernetes` with Cilium served.
With `_namespace.etcd` set to `tenant-root`, or empty, both with 3
members: `EtcdCluster/kubernetes-demo-etcd` replicas=3 on the namespace
default StorageClass, and `DataStore/tenant-demo.kubernetes-demo`
pointing at `kubernetes-demo-etcd.tenant-demo.svc:2379`. The
`KamajiControlPlane` names that `DataStore`, and the policy renders.
- [x] With the platform StorageClass keys set: 1 member uses
`replicated` and 3 members use `local`. 2 members is refused at render
time; 5 is refused by the schema.
- [x] An existing cluster (live-`KamajiControlPlane` lookup stubbed to
return `tenant-root`) renders identically to `main` with
`values-ci.yaml`, pre-delete hook included, apart from random Talos
tokens. A new cluster's render differs from `main` only by the old
shared `dataStoreName`, the shared-etcd pod label and the added etcd
objects.
- [x] helm-unittest:
- `packages/apps/kubernetes`: 392 tests. The 28-case
`tests/etcd_test.yaml` covers names, the second cluster in one
namespace, the 63-character `DataStore` cap, the 52-character defrag
`CronJob` cap at the longest app name, the defrag quota for a 4Gi etcd,
StorageClass choice and stickiness, the refused and the allowed drops to
one member, refusal of 2, the policy with its `world` deny, and the
hook's Step 4a/8 RBAC. For an existing cluster it covers staying on the
shared `DataStore`, ignoring a changed `_namespace.etcd`, keeping the
shared-etcd label, no own etcd and no Step 4a/8.
- `packages/extra/etcd`: 29, including the new scrape-selector case.
`packages/core/platform`: 335. `cozy-lib-tests`: 90.
`packages/system/backupstrategy-controller`: 67, now asserting the dump
Job's label. `packages/apps/tenant`: 89. `packages/extra/computeplane`:
18.
- [x] bats, 867 cases, all passing (`helmrelease-readiness` and
`bats-runner-coverage` included): every `hack/run-kubernetes*_test.bats`
(including two new cases pinning the teardown reads to their deadline),
`kubernetes-pre-delete-hook` (13, split into the shared and the own-etcd
branch, including the fail-closed exit before Step 8),
`check-render-matrix`, `chainsaw-op-budgets`,
`migration-62-shared-etcd-report` (new, 4),
`admin-kubeconfig-invariant`, `check-hook-request-timeout`,
`app-cleanup-hooks_test`, `bats-no-negated-assert`, `bats-no-exit-trap`,
`select-install_test`, `select-e2e_test`, `linstor-storage-mode_test`,
`cozystack-version-stamp` and `md-no-hardwrap`.
- [x] `go build ./...` and `go vet` on the `api/apps/v1alpha1`
Kubernetes package.
- [x] `make generate` in every touched package and at the root leaves no
diff; `hack/check-commit-trailers.sh origin/main..HEAD` passes.

Needs a live cluster:

- [ ] The e2e lanes: `kubernetes-latest`, `kubernetes-previous` and
`computeplane`, now without tenant-root's etcd. The Proxmox lane on its
self-hosted runner.
- [ ] Upgrade from `main` with an existing cluster on tenant-root's
etcd. It must stay on `tenant-root` with no control-plane rollout, and
migration 63 must list it. No CI lane runs a cluster on a shared etcd,
because the chart no longer creates one; an upgrade lane that installs
the previous release first is a follow-up.
- [ ] The deny policy beyond what `kubernetes-latest` now probes: from a
guest worker VM and from outside the cluster, `nc -zv
kubernetes-<name>-etcd.<ns>.svc 2379` must be refused. The control
plane, the defrag Job, a `Kubernetes` backup dump Job, an `EtcdSnapshot`
Job, Kamaji and etcd-operator must still connect, including a freshly
started control-plane pod (Cilium can briefly classify a new pod IP as
`world`).
- [ ] Delete a cluster whose own etcd never became Available (for
example, the quota case below). Step 4a must release the
`TenantControlPlane` and the uninstall must finish without manual work.
- [ ] A tenant whose `ResourceQuota` cannot fit 3 × 1000m/512Mi limits
and 3 × 4Gi requests must surface the quota error on the etcd member
pods.
- [ ] A backup and a restore through the `Kubernetes` strategy of a
cluster that owns its etcd, including the rebuild of a deleted cluster.

### Follow-ups, not opened

These are listed here at the maintainer's request rather than filed:

- **cozystack/website**:
- `content/en/docs/next/operations/configuration/platform-package.md`
gains `kubernetesEtcd.storageClassLocal` and
`kubernetesEtcd.storageClassReplicated`;
- `content/en/docs/next/kubernetes/relocate-etcd.md` describes the
shared tenant etcd as what a cluster uses;
- tenant and Kubernetes docs telling users to set `etcd: true` for a
cluster, which is now an obsolete workaround;
- the Kubernetes app reference is regenerated from the README on the
next stable tag.
- **cozystack/terraform-provider-cozystack**:
`internal/provider/kubernetes_schema.go` and `kubernetes_model.go` need
`etcd.replicas`, with the default of 3, a 1..3 range and the
expand/flatten pair.
- **cozystack/cozystack**, after this lands:
- an upgrade e2e lane that keeps a cluster on a shared etcd across the
upgrade;
  - alert rules for a cluster's own etcd;
  - the opt-in migration path and its e2e;
  - an operator `talosconfig`;
  - phases 3 and 4.

### Screenshots

Not a UI change.

### Downstream repositories

Follow-ups are listed above under "Follow-ups, not opened". By the
maintainer's decision they are not filed from this draft, so no box is
ticked.

- [ ] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up: listed above, not yet filed
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up: listed above, not yet filed
- [ ]
[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): each new tenant Kubernetes cluster now gets its own etcd (EtcdCluster `kubernetes-<name>-etcd` and Kamaji DataStore `<namespace>.kubernetes-<name>`), created and deleted with the cluster, so no ancestor Tenant needs `etcd: true` and the `awaiting-etcd` state is gone. The new `etcd.replicas` field chooses 3 members (default) or 1. Each member starts at 1000m CPU and 512Mi memory limits with a 4Gi volume, counted against the tenant's quota, and a VerticalPodAutoscaler may resize it as it is recreated. The platform values `kubernetesEtcd.storageClassLocal` and `kubernetesEtcd.storageClassReplicated` choose the StorageClass for 3 members and 1 member respectively. Existing clusters keep the shared tenant etcd they run on, unchanged; the upgrade lists them in the migration log. The `Kubernetes` backup strategy covers a cluster's own etcd as it covers a shared one. The tenant etcd's metrics scrape now selects only its own members.
```



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

## Summary by CodeRabbit

* **New Features**
* New Kubernetes clusters now use dedicated etcd by default, with one-
or three-replica configurations and platform-selected storage.
* Clusters already using shared etcd continue to use it. Installation
notes show where control-plane state is stored and summarize resource
limits.
* Kubernetes add-ons can render independently of tenant-shared etcd
settings.
* **Bug Fixes**
* Cluster removal now waits for dedicated etcd resources to be
reclaimed.
* Platform upgrades report clusters still using shared etcd without
modifying them.
* **Documentation**
* Updated Kubernetes and ComputePlane guidance on dedicated etcd,
storage options, and migration considerations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-24 15:04:49 +03:00
Timofei LarkinandYan Bondarenko 16da53637e feat(kubernetes): give each new cluster an etcd of its own
A tenant Kubernetes cluster could only start once an ancestor Tenant had
an etcd module turned on, which nobody creating a cluster may do, and
every cluster below that tenant then shared one etcd, one CA and one
disk. Anything that orders clusters on a tenant's behalf had to flip the
tenant's etcd on first.

A new cluster now renders its own EtcdCluster and DataStore, from the
cozy-lib shapes the etcd chart uses, and is created and deleted with
them. The awaiting-etcd state goes, since a datastore always exists.

An existing cluster stays on the DataStore its live KamajiControlPlane
names, and renders what it rendered before. Changing that name starts a
Kamaji datastore migration, which freezes the tenant's writes and leaves
every worker kubelet needing a restart, so no upgrade may do it.
_namespace.etcd cannot decide this: tenant-root publishes one to every
tenant whether or not an etcd runs behind it.

On uninstall, Kamaji's datastore finalizer drops the tenant's role,
prefix and user from an etcd this release deletes next, and it never
completes while that etcd is down. The pre-delete hook therefore removes
it from a TenantControlPlane on the cluster's own DataStore that
outlives the wait, and deletes the etcd's PKI, which cert-manager issues
without an owner. If the finalizer stays on, or the TenantControlPlane
cannot be read, the hook fails before the PKI goes, so the uninstall is
retried with the etcd still in place. A TenantControlPlane on a shared
DataStore is left to Kamaji as before.

A Cilium deny policy keeps the rest of the tenant namespace, ancestor
tenants and off-cluster sources off the etcd ports; the Kubernetes
backup strategy's dump Job carries the label it admits. The tenant
etcd's scrape now selects its own members by instance, because every
member etcd-operator runs carries app.kubernetes.io/name: etcd. The
platform waits for etcd-operator before offering the application.

The defrag job both charts share pulls its image through the configured
registry, pinned by digest to the multi-architecture index, so a
mirrored installation does not depend on ghcr.io for it.

Tested with helm-unittest on both the own and the shared branch, the
pre-delete hook's bats suite run against a stub kubectl for both, and a
render of an existing cluster that matches main byte for byte.
The guest e2e runs the defrag CronJob once, and probes the etcd client
port from a labelled Pod, an unlabelled one and one in tenant-root.

Co-authored-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2026-11-24 09:04:49 +01:00
IvanHunters 61e0839e0e fix(postgres): validate audit.log and match audit keys case-insensitively
Review on #5404 surfaced three issues with the audit toggle:

- audit.log was a free string, so a mistyped class (write, ddl, rol)
  rendered unchanged and pgaudit fell back to none at the next restart,
  silently disabling auditing. Add a schema pattern over the pgaudit
  class list so a bad class is rejected at admission.
- The explicit-parameter-wins guard matched keys case-sensitively, so a
  user key like pgaudit.LoG landed beside the lowercase seed and
  PostgreSQL, which is case-insensitive, picked the seed. Match the user
  keys lowercased.
- The connection-logging and empty-log guards were untested. Cover
  log_disconnections, an empty pgaudit.log, an empty audit.log and a
  case-variant key.

Also note in the field docs that write/all record statement text, so the
audit trail is readable by anyone with access to the log stack.

Assisted-by: LLM
Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
2026-11-23 18:34:42 +03:00
IvanHunters 64c55898aa fix(postgres): make an explicit parameter win over the audit default
Seeding pgaudit.log and the connection-logging parameters through the
$defaults merge let a falsy explicit value lose: a tenant setting
log_connections: 0 while audit is on had it silently overwritten with
on, because sprig merge reads a zero value as unset. Seed each key only
when postgresql.parameters does not already set it, so an explicit value
wins unconditionally. Also enumerate the valid pgaudit.log classes in
the field description, since an unrecognised class makes pgaudit fall
back to none and silently disables auditing.

Assisted-by: LLM
Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
2026-11-23 17:38:54 +03:00
IvanHunters fc62c7f69f fix(postgres): regenerate deepcopy for the Audit type
The audit values block added a new Audit struct to the generated Go
types, and its DeepCopy methods were missing, so the "Verify generated
code is up to date" job failed on drift. Add the controller-gen output.

Assisted-by: LLM
Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
2026-11-23 17:31:00 +03:00
IvanHunters 902909dbe7 feat(postgres): add an audit toggle for access and statement logging
Managed Postgres could already load pgaudit through the
sharedPreloadLibraries allowlist and set pgaudit.log and log_connections
through postgresql.parameters, but that leaves an orchestrator depending
on internal parameter names to answer who connected and what they ran.

This adds an audit block that bundles access and statement auditing
behind one switch. With audit.enabled the chart adds pgaudit to
shared_preload_libraries and seeds pgaudit.log (from audit.log,
default "write, ddl, role"), log_connections and log_disconnections. The
parameters are seeded as defaults, so an explicit pgaudit.log or
log_connections in postgresql.parameters still wins. The audit trail
goes to the instance log, which the platform log stack already collects,
so it is queryable per database without extra wiring.

Postgres only; the other managed databases are left for follow-ups.

Assisted-by: LLM
Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
2026-11-23 17:25:17 +03:00
Mattia Eleuteri 9ecff91b74 fix(kafka)!: require SCRAM-SHA-512 on the external listener
With external access on, the chart opens a listener on port 9094 of a
public LoadBalancer address, and it rendered that listener without any
authentication: whoever reached the address could produce and consume
on every topic. TLS on that listener only encrypts the session.

The KafkaUser name carries the release name because it is also the
SCRAM username and the name of its Secret, and two instances in one
namespace may declare the same user. A dot joins the two because a
user Secret readable by the tenant must never take the name of a
Secret Strimzi derives from a cluster name, and neither a release name
nor any of those Secrets can hold a dot.

BREAKING CHANGE: an instance with external access enabled refuses
clients that do not authenticate. The Kafka README gives the upgrade
sequences.

Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
2026-11-23 14:11:55 +01:00
Mattia Eleuteri a2c986d770 Merge branch 'main' of github.com:cozystack/cozystack into pr5050-sync
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>

# Conflicts:
#	packages/apps/bucket/README.md
#	packages/system/bucket-rd/cozyrds/bucket.yaml
2026-11-23 12:56:00 +01:00
Mattia Eleuteri ae3dd71e68 feat(bucket): offer Object Lock without a default retention
The only lock class, -lock, sets a fixed default retention of
COMPLIANCE for 365 days. Backup tools such as Veeam, restic and Kopia
set the retention of each object themselves, and other users want a
shorter default or GOVERNANCE, which a bucket owner can set through
the S3 API once the bucket exists. Nothing let them start from a
locked bucket without that year-long default.

The new lockingDefaultRetention flag defaults to true, so existing
buckets and values keep -lock.

The new class keeps deletionPolicy Retain like -lock: the driver
deletes a bucket through the filer without checking retention, so
Delete would destroy objects still under COMPLIANCE.

Pools named with a -lock-noretention suffix already exist, so that
suffix is not reserved, which would block their upgrade; only class
names that actually clash between pools, or with the base classes,
are refused.

Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
2026-11-23 12:04:50 +03:00
Mattia Eleuteri d3804ebea9 feat(api): refuse an application scheduling class its tenant does not allow
The lineage webhook keeps a pod on the tenant class when the
application names a class the tenant does not allow, but it can only
log that, on a pod the user never looks at. Refusing the application
at admission puts the error where the field was set, with the list of
classes that would be accepted.

An update that keeps the class is not refused, so an application whose
class was removed from the list after admission stays editable; the
webhook already keeps its pods on the tenant class. Tenants are left
out, because their spec.schedulingClass is the child tenant's class,
which the tenant chart's inheritance governs.

Users read the field description in the dashboard form and the API
schema, so it names the tenant setting that decides which classes are
accepted, says that only setting another value is refused, and that a
pod gets its class when it is created, so running pods keep theirs. The
field sits in its own README section, since a reader looking for
placement would not look under the unrelated heading it was appended
to.

Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
2026-11-23 08:05:09 +01:00
Mattia Eleuteri 4034f9eeb9 feat(tenant): let an administrator list the classes applications may pick
An application's spec.schedulingClass replaces the tenant class for
its pods, and the tenant class is the administrator's placement
constraint. Without a list of permitted alternatives, anyone who can
create an application in the tenant can move it onto any class the
cluster defines.

allowedSchedulingClasses names those alternatives and defaults to
empty, so per-application placement stays off until an administrator
opts in. The tenant chart writes it to a namespace annotation, the
place the admission policy and the lineage webhook can read it from.
A parent that constrains placement passes its list down unchanged, so
a child tenant cannot allow a class its parent does not, the same way
it cannot replace the parent's class.

Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
2026-11-23 08:05:07 +01:00
Mattia Eleuteri 0132457260 feat(apps): expose schedulingClass across all managed applications
Placement could only be set per tenant, so two applications of the
same tenant could not be kept together, or apart, unless each had a
tenant to itself. With a class per application and the scheduling-class
Pod label, a SchedulingClass name can serve as a co-affinity group: a
database and the virtual machine that uses it can be kept in the same
region without pinning which one.

The field is capped at 63 characters. A SchedulingClass name may be up
to 253, but the webhook writes the class into a Pod label, and this is
the first source of the class the apiserver has not already validated
as a label value; capping it is cheap while the field is new and a
breaking change once released. A class created with a longer name must
still not break Pod admission, so for it only the label is left out.

kubernetes-nodes gets no field: the ownership walk from a worker Pod
reaches the parent Kubernetes application, never the pool, so a class
set on a pool would be accepted and silently ignored.

Placement per replica role (primary or standby of a clustered
database) is out of scope: the operator assigns the role after
election, once the webhook has already seen the pod.

Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
2026-11-23 08:05:06 +01:00
Aleksei Sviridkin d88322197f chore(deps): roll up Renovate updates and raise dependencies to latest stable (#4869)
## What this PR does

One PR instead of separate Renovate PRs. Go modules, Dockerfile base
images and GitHub Actions move to newer versions that build and pass the
tests. Where a newer version is known to break something, it stays
behind, and `.github/renovate.json` holds it with the reason in the rule
description.

The tests come first, in their own commits:

- `make go-unit-tests` runs the Go tests under `pkg/` and `cmd/`, except
the backport-batch suite, which keeps its own target. The apiserver
serializer and fuzz tests, the generated OpenAPI and applyconfiguration
suites, the apis packages and the controller, operator and
observability-proxy commands did not run in CI before.
- The apps API surface that apiserver libraries shape is pinned:
server-side apply, content negotiation, Table output on watch, the
served OpenAPI v2 and v3 documents, and building the server without
etcd. Two answers look wrong and are pinned as they are today: applies
from different field managers never conflict (#4857), and protobuf is
refused with 406 even when the client offers JSON as a fallback (#5297).
- New tests cover the kubeovn webhook patch, the token proxy session
cookie and the mount-utils behaviour the kubevirt CSI node service
relies on.
- `hack/image-smoke.bats` checks the tools the CSI, LINSTOR, multus,
Harbor and redis-backup images take from their base images or build
stages, and that the kubevirt CSI node plugin and its sidecars need no
more than x86-64-v2. Each PR build job runs it against the images it
pushed; forks and the unit lane run no container.

The tests found two bugs:

- The kubeovn webhook dereferenced a nil pointer on an admission review
without a request, so the caller got a dropped connection instead of a
400.
- The token proxy cookie refresh never fired: securecookie decodes the
session times as int64 and the refresh looked for float64, so the
`--cookie-refresh=1h` the chart sets did nothing. A refreshed cookie
keeps the token's expiry. A session too large to encode now shows an
error at sign-in and leaves the current cookie alone on refresh.

What moved:

- GitHub Actions to their Node 24 majors. The flux action stays on the
tag of the Flux CLI it installs. The release job's checkout no longer
persists credentials, so its staging branch push uses the App token.
- Go 1.27.2 for the toolchain and builders. Builds that reproduce an
upstream release keep the Go upstream uses: Harbor, cilium-operator,
SeaweedFS and the chainsaw stage of the e2e sandbox.
- controller-runtime v0.25.2, gateway-api v1.6.3 on the minor of the
installed v1.6.1 CRDs, cel-go v0.30.0, grpc v1.84.0, etcd v3.7.2,
cert-manager v1.21.2, kubevirt csi-driver f10ae94 on Kubernetes v0.37.1.
- Node 24 for the dashboard console.

Held back, each with its reason in the Renovate rule:

- cel-go stays below v0.31: the old repository has no tags past v0.30.0,
and v0.32 moves to cel.dev/cel-go, which k8s.io/apiserver does not
import.
- kube-openapi stays on the commit its dependencies require, and
structured-merge-diff stays on v6, because k8s.io/apimachinery v0.37
does not compile against v7.
- The Flux API modules stay on the Flux v2.8 line the platform installs.
- gomodules.xyz/jsonpatch stays on v2, which controller-runtime's
admission.Patched takes.
- jwx stays on v3: v4 removes jwk.Cache, which the token proxy's JWKS
refresh is built on.
- kubevirt.io/api and the CDI API stay where upstream csi-driver builds.
- The kubevirt CSI driver image stays on AlmaLinux 9, because AlmaLinux
10 builds its amd64 userland for x86-64-v3.
- shadowbox stays on node 18, which outline-server declares in its
engines.
- The e2e sandbox stays on Ubuntu 24.04. 26.04 ships uutils coreutils,
whose `date` costs about 4x per call, and the test harness forks it per
traced line, which adds about ten minutes to the install phase.
- clastix/kubectl stays on v1.32 for the cleanup hooks, within kubectl's
one-minor skew.

The cert-manager Go module (v1.21.2) is one minor ahead of the installed
chart (v1.20.2). The Certificate objects the gateway controller writes
serialize the same either way.

`api/apps/v1alpha1` now requires Go 1.27.2, which applies to every
module that imports the published types.

The Linux run with Go 1.27.2 was done before the rebase onto current
main, and the rebased head has not been through it yet. There the five
modules built, vetted, tested and tidied cleanly, and the repository
unit, controller and envtest lane passed. `go test -race` passed in four
modules. In the root module it failed only on a pre-existing data race
in the workload monitor tests (#5296), which main has too. The image
smoke checks run in this PR's CI.

### Screenshots

No UI change.

### Downstream repositories

`api/apps/v1alpha1` moves to `go 1.27.2`, and
cozystack/terraform-provider-cozystack imports it, so that repository is
affected but needs no action. Its box stays empty for that reason, and
so does the "not affected" one.

- [ ] 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: none needed, because its Renovate raises the go directive
together with the pin bump and its CI takes Go from `go.mod`; the only
effect is that the provider's minimum Go becomes 1.27.2.
- [ ]
[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
chore(deps): move the toolchain and builder images to Go 1.27.2 and raise Go modules, base images and GitHub Actions to newer working releases; the dashboard token proxy now refreshes its session cookie, and the kube-ovn webhook rejects an admission review without a request instead of dropping the connection.
```
2026-11-18 14:42:34 +03:00
Aleksei Sviridkin a3e60ec372 feat(kafka)!: run on Strimzi 1.2.0 and Kafka 4.x (#4900)
<!-- 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

This upgrades the Kafka operator to Strimzi 1.2.0. Kafka 4.3 is the
application default, with 4.2 also available. Upgrades must pass through
Cozystack v1.7 and finish the ZooKeeper-to-KRaft migration first.

The upgrade now stops while any Kafka lacks KRaft evidence. Every Kafka
must report a nonempty `kafkaMetadataVersion` and the `KRaft` metadata
state. The API conversion deletes that state, so without it a Kafka
needs `Ready=True` or the `cozystack.io/kraft-verified` annotation,
which migration 61 writes on every Kafka it accepts before it stops the
operators. Any other explicit state blocks, and the error gives the
reason for each Kafka. On every variant, the platform chart refuses to
switch package sources while Strimzi still serves `v1beta2` and a Kafka
fails that check. On variants without the migration hook, it also
refuses while any Strimzi CRD still stores `v1beta2`, so
`/migrations/61` has to run first. Migration 61 checks the same evidence
again, including on repeat runs, and blocks unfinished broker-pool
drains. A manual change that bypasses the managed package source is
outside this check.

Existing Kafka 3.x applications move to v4.3. Kafka 4 no longer accepts
clients older than Kafka 2.1. Kafka 4 also rejects the topic settings
`message.format.version`, `message.downconversion.enable` and
`message.timestamp.difference.max.ms`, and a `segment.bytes` below 1 MiB
(1048576), which Kafka 3.x accepted down to 14 bytes. A Kafka 4 broker
whose log holds such a topic does not start. The chart now refuses to
render a topic that sets any of these. The platform upgrade refuses to
start while a Kafka application sets one, and migration 61 also checks
KafkaTopic resources, so topics created outside the chart are caught
too. A topic created through the Kafka admin API without a KafkaTopic is
not visible to these checks. Restoring a topic-metadata backup taken on
Kafka 3.x skips the three removed settings and raises a smaller
`segment.bytes` to 1 MiB, with a warning for each. In-place downgrades
are unsupported. The default 10-minute Helm timeout can leave a long
broker roll Failed until its retry succeeds.

The migration does not run automatically on every platform variant. Only
the `isp-*` variants run it automatically. On other variants, run
`/migrations/61` from the matching migrations image before upgrading, as
the Kafka README describes. This includes clusters that run no Kafka but
have the kafka-operator package, from the `paas` bundle or
`bundles.enabledPackages`. Their Strimzi CRDs still store `v1beta2` even
with no objects. The migration converts Strimzi resources and stored
Helm references to `v1`. It stamps platform version 62. Running it
manually also skips earlier migrations on a later move to an `isp-*`
variant. Before it stops the operators, migration 61 refuses objects
that the Strimzi 0.51 conversion tool would reject and names each one,
for example a Kafka with `.spec.kafka.resources` or with OAuth, Keycloak
or OPA settings. A failed conversion can leave the old operators stopped
until the migration succeeds and the operator release upgrades. The
failed conversion Job stays for diagnosis, but its ClusterRole, binding
and ServiceAccount are removed. A Job that is still running when the
wait times out keeps them, because the retry waits for it.

Known limitations. Migration 61 converts with the old operator stopped,
while Strimzi's conversion guide expects a running operator of 0.49 or
later. I stop it because 0.45 keeps writing the Kafka status through
`v1beta2`, but I have not checked this on a live cluster. Objects
Strimzi created keep `ownerReferences` to `v1beta2` until Strimzi 1.2
reconciles them. Deleting a Kafka before that can leave dependents
behind, and the chart's pre-delete hook covers only StrimziPodSets. The
conversion image is pulled from quay.io by digest with no values
override, so an air-gapped cluster has to mirror it under the same name.

The full offline unit run passed on Linux on
`1171d63adfafb45be34214fb9a0f565723e255fd`: 2,576 cases, no failures,
errors or skipped tests. Later changes were checked on `69c704499fa4`
with the Bats tests for migration 61, the migration runner, the Kafka
hooks and the Kafka backup scripts (102), the platform Helm suite (310
tests) and the Kafka Helm suite (91 tests). After the rebase onto `main`
at `5a5d5cd3d85f`, `a48a2f259947` passes the same Bats tests (115) and
the platform and Kafka Helm suites (326 and 103 tests). It also passes
the new check against added `documentIndex` selectors. I have not
validated this revision on a live cluster.

Closes #4365

### 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. -->

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.
-->

- [ ] No downstream repository is affected by this change
- [x] [cozystack/website](https://github.com/cozystack/website) -
follow-up: https://github.com/cozystack/website/issues/805
- [ ]
[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 Terraform provider does not model the Kafka `version` field. The
website issue covers the upgrade notes the `default` variant needs.

### 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
feat(kafka)!: upgrade to Strimzi 1.2.0 and Kafka 4.3 by default, with Kafka 4.2 also available. Platform migration 61 converts Strimzi resources to v1 and moves Kafka 3.x applications to v4.3. Every Kafka must have confirmed KRaft state before the upgrade, including on repeat runs. Upgrade through Cozystack v1.7 first. Kafka 4 drops clients older than Kafka 2.1 and the message.format.version, message.downconversion.enable and message.timestamp.difference.max.ms topic settings, and requires segment.bytes of at least 1 MiB; the chart and the upgrade refuse a topic that breaks either rule, and a topic-metadata backup taken on Kafka 3.x restores without the removed settings and with segment.bytes raised to 1 MiB. In-place downgrades are unsupported.
```
2026-11-18 13:26:31 +03:00
Aleksei Sviridkin 87f160d473 fix(vm-disk, kubernetes-nodes)!: refuse golden images whose import keeps failing (#4802)
## What this PR does

New clones can wait forever on a golden image whose import keeps
failing. CDI v1.66.1 retries ordinary HTTP failures without setting
phase `Failed`.

The guards now also refuse goldens with at least three importer restarts
unless they reached `Succeeded`. kubernetes-nodes and the picker require
`Running=False`; vm-disk refuses during running attempts too. Existing
vm-disks and already-cloned pools remain exempt. CDI never lowers the
restart count, so a healthy import with three early restarts stays
refusable until `Succeeded`, including while a recreated importer is
still starting.

An empty worker-pool StorageClass now resolves to the virtualization
default, then the GA Kubernetes default. Beta is a last fallback for the
class written explicitly onto a worker disk, not a CDI fallback. The
strict same-class policy stays.

This can refuse a previously accepted builtin pool on upgrade. The
affected pool has an empty StorageClass, no cloned disk yet, and a
golden on the Kubernetes default while another class is the
virtualization default. StorageClass is immutable: point
`osImage.builtin` at a catalog entry on the virtualization default or
switch to `osImage.factory`. Already-cloned pools keep their disk's
class.

A VMDisk's own HTTP import, golden-image health checks and imports that
hang without restarting remain outside this change.

Closes #4564

Refs #4059

### Screenshots

No UI changes.

### Downstream repositories

The platform values change only updates a comment. The application
schema change updates the StorageClass description without changing
fields, defaults or enums.

- [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(vm-disk, kubernetes-nodes)!: refuse new clones of golden images whose import has not succeeded after at least three importer restarts. kubernetes-nodes and the image picker require the importer to be not running; vm-disk refuses during running attempts too. kubernetes-nodes now resolves an empty storageClass to CDI's virtualization default before the Kubernetes default. A builtin pool with an empty storageClass, no cloned disk yet, and a golden on a different class can now be refused. Point it at a catalog entry on the virtualization default or switch to osImage.factory. Already-cloned pools are unaffected.
```
2026-11-17 18:05:01 +03:00
Aleksei Sviridkin 638f0ffbe7 feat(redis): add affinity configuration (#2665)
<!-- 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

Adds independent Kubernetes affinity configuration for Redis and
Sentinel pods through `RedisFailover.spec.redis.affinity` and
`spec.sentinel.affinity`. Empty or null rules preserve operator
defaults. Configured rules replace default soft pod anti-affinity;
include `podAntiAffinity` when replica spreading is required.

### Validation

- All 99 chart tests pass with helm-unittest v1.1.2; affected standalone
API package compiles.
- Package generation with cozyvalues-gen v1.7.0 is repeatable; embedded
ApplicationDefinition schema matches the generated values schema.
- Twenty-four offline render scenarios cover default/null/configured
affinity and TLS on/off; Redis checks also cover independent component
rules, single-replica Sentinel behavior, and preservation of upstream
cache configuration.
- Manifest generation, diff checks, and commit trailer checks pass. Each
branch contains one feature commit rebased onto upstream main.
- Root `make generate` remains blocked by the pinned code-generator
parser rejecting Go 1.27's `math/rand/v2` generic method. Affected API
deepcopy generation passes separately with controller-gen v0.16.4;
unchanged files deleted by the failed root generator were restored.
- cozyhr v1.6.1 is installed and checksum-verified. `make show` with
`--plain` still queries Kubernetes discovery, which this environment
cannot access; offline Helm rendering passes.

### Screenshots

Not applicable; no UI changes.

<!-- 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.
-->

- [ ] 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:
https://github.com/cozystack/terraform-provider-cozystack/issues/85.
Provider implementation is tracked separately from this application
change.
- [ ]
[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
feat(redis): add affinity configuration for Redis and Sentinel pods.
```
2026-11-17 15:28:41 +03:00
Aleksei Sviridkin 6efc0a0dc9 feat(rabbitmq): add affinity configuration (#2664)
<!-- 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

Adds optional Kubernetes affinity configuration to RabbitMQ pods through
`RabbitmqCluster.spec.affinity`. Empty or null affinity keeps existing
scheduling behavior.

### Validation

- All 106 chart tests pass with helm-unittest v1.1.2; affected
standalone API package compiles.
- Package generation with cozyvalues-gen v1.7.0 is repeatable; embedded
ApplicationDefinition schema matches the generated values schema.
- Six offline render scenarios cover default/null/configured affinity
and TLS on/off.
- Manifest generation, diff checks, and commit trailer checks pass. Each
branch contains one feature commit rebased onto upstream main.
- Root `make generate` remains blocked by the pinned code-generator
parser rejecting Go 1.27's `math/rand/v2` generic method. Affected API
deepcopy generation passes separately with controller-gen v0.16.4;
unchanged files deleted by the failed root generator were restored.
- cozyhr v1.6.1 is installed and checksum-verified. `make show` with
`--plain` still queries Kubernetes discovery, which this environment
cannot access; offline Helm rendering passes.

### Screenshots

Not applicable; no UI changes.

<!-- 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.
-->

- [ ] 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:
https://github.com/cozystack/terraform-provider-cozystack/issues/84.
Provider implementation is tracked separately from this application
change.
- [ ]
[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
feat(rabbitmq): add support for configuring RabbitMQ pod affinity rules.
```


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

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

## Summary by CodeRabbit

* **New Features**
* Added an optional affinity setting to control where RabbitMQ pods are
placed, including anti-affinity rules to spread pods across nodes.
* Configured affinity rules are applied to RabbitMQ pods. When affinity
is empty or unset, no affinity rules are added.
* **Documentation**
* Updated RabbitMQ configuration guidance to describe the affinity
setting, its empty default, and how to use anti-affinity to distribute
pods across nodes.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-17 15:28:13 +03:00
Aleksei Sviridkin 3b65cebea3 feat(kafka)!: run on the Strimzi v1 API and Kafka 4.x
Strimzi 1.2 serves only the v1 API and runs Kafka 4.2 and 4.3. The
node-pool hook no longer drives the ZooKeeper to KRaft migration or
the drain that freed the shared "kafka" pool name: Strimzi 1.x has no
ZooKeeper support, and the platform migration refuses to upgrade while
a ZooKeeper cluster is left. A cluster migrated earlier keeps its
"kafka" broker pool. Without the drain the hook takes seconds, so the
seven-hour install timeout goes too.

Kafka 4 rejects the topic configs it removed and a segment.bytes below
1 MiB, which Kafka 3.x accepted. A KafkaTopic that sets one stays
NotReady while the release reports Ready, so the chart refuses to
render such a topic. It reads segment.bytes the way Kafka does:
trimmed, with an optional sign, leading zeros decimal.

BREAKING CHANGE: the Kafka application accepts version v4.3 (default)
and v4.2; v3.8 and v3.9 are gone, and the platform migration moves
existing applications to v4.3.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-17 12:22:54 +03:00
Aleksei Sviridkin b6ef231d44 docs(kubernetes-nodes): state why a pool must share its golden's class
The worker image guard, its error message and the storageClass docs
said CDI cannot clone across StorageClasses and always falls back to a
host-assisted copy. CDI falls back only when the two claims have
different CSI drivers or volume modes; with one driver it asks that
driver for a clone into the other class. The guard stays, the reason it
gives is corrected, and the docs name the virtualization default class
an empty storageClass now resolves to.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-17 11:20:20 +03:00
Aleksei Sviridkin 0d239fab81 Merge branch 'main' into feat/kubernetes-nodes-talos-sysctls
The generated cozyrds file is regenerated from the merged values.yaml.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-16 17:17:33 +03:00
kastakhov 977963dda2 feat(redis): add affinity configuration
Signed-off-by: kastakhov <16296930+kastakhov@users.noreply.github.com>
Assisted-by: LLM
2026-11-16 13:16:29 +00:00
kastakhov a0f85886f2 feat(rabbitmq): add affinity configuration
Signed-off-by: kastakhov <16296930+kastakhov@users.noreply.github.com>
Assisted-by: LLM
2026-11-16 13:14:09 +00:00
Aleksei Sviridkin ee0071dd1b chore(deps): update Go modules and move them to go 1.27.2
The five Go modules move to go 1.27.2. The root module moves to
controller-runtime v0.25.2, gateway-api v1.6.3 on the minor of the
installed v1.6.1 CRDs, grpc v1.84.0, etcd v3.7.2, cert-manager v1.21.2
and newer golang.org/x modules; prometheus/client_golang v1.25.0 raises
klauspost/compress to v1.20.1 by minimal version selection.
kubevirt-csi-driver builds upstream csi-driver f10ae94 against
Kubernetes v0.37.1, with its require and replace now naming the same
commit, kubeovn-webhook moves to client-go v0.37.1, and token-proxy to
newer releases of its dependencies.

Several stay behind, each for a stated reason. cel-go stops at v0.30.0:
its old repository has no tag past it, and v0.32 declares a module path
k8s.io/apiserver does not import. kube-openapi past the pinned commit
needs structured-merge-diff v7, which k8s.io/apimachinery v0.37 does not
compile against. The Flux API modules stay on the Flux v2.8 line the
platform installs. kubevirt.io/api and the CDI API stay on the releases
upstream csi-driver builds against, and jwx stays on v3 because v4
removes the jwk.Cache the proxy's JWKS refresh uses.

cert-manager v1.21 drops the deprecated ObjectReference alias, so the
gateway controller names IssuerReference directly; the Certificate
objects serialize the same for the installed v1.20 chart. gateway-api
marks SchemeGroupVersion deprecated, so a gateway test builds its
GroupKind from GroupName.

api/apps/v1alpha1 moves to go 1.27.2 with the rest, so a module that
imports the published types needs Go 1.27.2 or later.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-16 01:07:38 +03:00
Aleksei Sviridkin 7e069356b9 Merge branch 'main' into feat/kubernetes-nodes-talos-sysctls
Generated files (types, README, schema, cozyrds) are regenerated from
the merged values.yaml.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-14 00:43:22 +03:00
Mattia Eleuteri 2568db67b1 Merge branch 'main' into fix/kubernetes-nodes-surge-before-drain
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
2026-11-13 22:40:18 +01:00
myasnikovdaniil aa36d3fad6 fix(kubernetes)!: remove the talos block and other leftovers of the worker pool split (#5191)
## What this PR does

Cleanup after the Kubernetes app was split into `Kubernetes` (control
plane and addons) and `KubernetesNodes` (one release per worker pool):
what the split left behind in values, docs, templates and tests.

### Kubernetes

The `Kubernetes` application has no `talos` field any more. Worker pools
are `KubernetesNodes` resources and take their Talos release, image,
installer and registry mirrors from their own `talos` and `osImage`, so
the cluster's copies did nothing. The last one, `talos.version`, fed a
duplicate of the Talos to Kubernetes support-matrix check. The pool
chart already runs that check against the Talos release each pool
actually boots, including one picked through an `osImage` override; the
cluster's copy compared the Kubernetes version against a release no node
runs. A stored spec that still carries `talos.*` keeps rendering,
because the values schema does not close the object and the API does not
validate `spec` against it, and a unit test pins that.

The pool's check now has render coverage. Its own suite pins the
pairings it must accept, and a bats test renders the refusals through
`talos.version`, `osImage.factory.version` and `osImage.builtin.version`
with schema validation skipped, since the schema offers no Kubernetes
version the matrix refuses.

I fixed the README and field descriptions that described behavior the
chart no longer has, or never had: a dedicated etcd cluster, a
`blockSize.matchVolume` setting that does not exist, a default `md0`
pool, the host default, the substrate mismatch behavior, and rollout
phase names. The README's Breaking Changes section becomes a pointer to
the per-release upgrade notes on cozystack.io. Unused helpers and stale
comments are removed; the chart renders the same bytes.

### KubernetesNodes

Five field descriptions and the `talos` block told users to keep them in
sync with parent fields that do not exist. NOTES warned about colliding
with a parent-managed `md0` pool, although the parent renders no pools
and `md0` is the normal name of a pool. The installer image was credited
to an upgrade Job that never runs one. The values descriptions, README
intro and NOTES now say what the chart renders today, including which
fields have no effect on `substrate: proxmox`: `storageClass`,
`diskSize`, `instanceType`, `talos.imageFactoryURL` (beyond its format
check) and `talos.imageFactoryCA`.

The render error for a pool whose MachineDeployment belongs to another
release told users to remove the pool from the parent's `nodeGroups`,
which cannot clear the conflict. It now names a remedy that works.
Split-era history is gone from Helm and test comments, along with two
`storageClass` fallbacks that can only return the value they fall back
from, a constant variable, and two `.helmignore` rules that match
nothing.

The tenant pod and service CIDRs are literals in both charts, and
nothing checked that they agree. A new bats test renders both charts and
fails when they differ.

No rendered manifest of the pool chart changes. I rendered it for the
snapshot values, GPU, kubelet-override, factory/CA, storageClass
variants and three Proxmox variants on main and on every commit, and the
output is byte-identical. The snapshot and TalosConfigTemplate hash
tests pass unchanged, so no worker rolls. YAML comments inside the
hashed machine config and machine template are left as they are for that
reason.

### The rule

`docs/agents/overview.md` gains a rule so this does not come back with
the next change: app READMEs and field descriptions describe current
behavior, a change users must act on goes to the website's upgrade page,
and a description does not ask the reader to keep it in sync with
another chart.

```release-note
[kubernetes] The Kubernetes application no longer has a `talos` field. Talos settings for workers, and the Talos to Kubernetes compatibility check, live on each KubernetesNodes pool. Existing clusters that still store `talos` values keep working; the values are ignored. KubernetesNodes field descriptions, README and install notes now describe the worker pool as it works today, including which fields have no effect on Proxmox pools.
```

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

## Summary by CodeRabbit

* **Configuration**
* Worker OS image, installer, and registry-mirror settings are
configured per worker pool; these settings are no longer available at
the cluster level.
* Kubernetes and Talos version compatibility is checked for each worker
pool. A worker Kubernetes version cannot be ahead of its parent cluster.
* Worker pools support KubeVirt and Proxmox, with pool-specific sizing
and disk settings.
* Rendering is refused when a pool uses a different substrate from its
cluster or conflicts with an existing worker pool owned by another
release.
  * The default cluster hostname now includes the `kubernetes-` prefix.
* Existing cluster configurations that still include Talos settings
receive a warning; those settings are no longer used.

* **Documentation**
* Updated guidance for cluster and worker-pool settings, storage,
upgrades, and version compatibility.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-14 00:34:44 +05:00
Aleksei Sviridkin f61cfdf0b8 feat(bucket)!: add publicRead to serve a bucket without credentials (#5252)
<!-- 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

Adds `publicRead` to the Bucket application. A bucket cannot serve its
objects without a signature today: every BucketAccess issues a key, and
those keys grant neither `WriteAcp` nor `PutBucketPolicy`, so `aws s3api
put-bucket-acl --acl public-read` is refused and a tenant has no way to
serve static assets (images, downloads) straight from a bucket. The only
workaround is an operator running `weed shell` `s3.anonymous.set` by
hand, which nothing reconciles and which outlives the bucket.

With `publicRead: true` the chart renders one more BucketAccess,
`<bucket>-public-read`, on a new `-public` BucketAccessClass whose
`accessPolicy` is `public-read`. The class is added in the three places
that define access classes: the Client topology, the per-storage-pool
classes, and the vendored chart (through its existing
`cosi-bucket-class-lock-readonly.patch`). The COSI driver handles the
policy by adding `Read:<bucket>` to the gateway's `anonymous` identity
and, on revoke, removing only that action, so turning the flag off or
deleting the bucket closes it again without touching other public
buckets. Anonymous callers can `GET`/`HEAD` objects at
`<endpoint>/<bucket>/<key>`; listing and writes stay refused.

A user named `public-read` would own the same BucketAccess name, so that
combination fails to render with an explicit message rather than having
two owners fight over one object.

The seaweedfs pool name check now also reserves `public` and the
`-public` suffix, next to the existing `-lock` and `-readonly`: a pool
`<x>-public` would render a readwrite BucketAccessClass with the same
name as pool `<x>`'s public-read class, and a pool `public` would take
the instance's own `-public` class. This is a breaking change for an
instance that already defines a pool with such a name: its seaweedfs
release stops rendering with the pool name error. Pool keys are part of
the volume server and PVC names, so renaming such a pool moves its data
to new volumes; that migration is the operator's to plan before
upgrading.

**Known limitation until the next driver release.** On v0.5.0, revoking
public read (turning `publicRead` off or deleting the bucket) can leave
the bucket readable anonymously if an S3 gateway migrates
`identity.json` while the revoke is in flight: the migrated
`identities/anonymous.json` keeps `Read:<bucket>`, and SeaweedFS loads
it over `identity.json` without ever repairing it. The fix is
seaweedfs/seaweedfs-cosi-driver#22 (the revoke always writes
`anonymous.json`, after the legacy file). The driver release carrying it
will be pinned here if it lands before this PR merges, otherwise in a
follow-up. Until then, an operator can check `s3.anonymous.list` in
`weed shell` after a revoke and clear a leftover with `s3.anonymous.set
-bucket <bucket> -access none`.

**Driver: pins the upstream seaweedfs-cosi-driver v0.5.0.** The
`public-read` policy merged upstream in
seaweedfs/seaweedfs-cosi-driver#21 and v0.5.0 is tagged on that merge,
so this PR moves the image pin from v0.4.0 (#5284) to v0.5.0 in
`packages/system/seaweedfs/values.yaml`, the client-mode `.tag` file and
`cosi_image_test.yaml`. An earlier revision of this branch built the
driver in-tree while no release carried the policy; that build is gone,
and the intermediate commits that added it are undone by the merge of
`main`, so squashing leaves only the feature and the pin.

v0.5.0 differs from v0.4.0 only by the `public-read` policy
(seaweedfs/seaweedfs-cosi-driver#21) and its README note. Upstream
documents one `public-read` BucketAccess per bucket as the supported
shape, which is what the chart renders.

Tested: new helm-unittest suites for the bucket app (default off, class
name with and without storage pool, locked bucket, coexistence with
users, the name collision), the seaweedfs extra chart (Client and
storage-pool classes) and the vendored chart; they fail when the class
suffix or the policy is removed. `helm unittest` passes on
`packages/apps/bucket`, `packages/extra/seaweedfs`,
`packages/system/seaweedfs` and `packages/system/bucket`, as do
`test-guard-fail-closed` and `test-image-version`;
`cosi_image_test.yaml` pins
`ghcr.io/seaweedfs/seaweedfs-cosi-driver:v0.5.0`, which is published for
amd64 and arm64. The anonymous-read mechanism itself was checked by hand
on SeaweedFS 4.45 (`weed shell` `s3.anonymous.set -access Read`):
anonymous `GET` returns 200 on both gateways,
`ListObjects`/`ListObjectsV2` and `PUT` return 403, and the identity
survives grants and revokes of regular BucketAccesses. The end-to-end
path through the new driver has not run on a cluster yet.

### Screenshots

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.
-->

- [ ] 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#80
- [ ]
[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:

Walked the trigger map against the diff: the only hit is the new field
in `packages/apps/bucket/values.schema.json` (and
`api/apps/v1alpha1/bucket/types.go`), which the Terraform provider
models by hand. Follow-up filed as
cozystack/terraform-provider-cozystack#80. The website's bucket page is
hand-written and could mention the flag, but no listed trigger covers an
added field, so it is left unticked.

### 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
feat(bucket): add `publicRead` to serve a bucket's objects without credentials at `<endpoint>/<bucket>/<key>`. Anonymous callers can read objects but cannot list the bucket or write to it. The COSI driver is bumped to seaweedfs-cosi-driver v0.5.0, which adds the `public-read` access policy. The seaweedfs pool names `public` and `*-public` are now reserved: an instance that already defines such a pool fails to render until the pool is renamed, which moves its data to new volumes.
```





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

## Summary by CodeRabbit

* **New Features**
* Bucket configurations can enable anonymous reads of objects through
the bucket endpoint. Anonymous access does not allow listing buckets or
writing objects.
* SeaweedFS provides public-read access classes across supported bucket
configurations, alongside read-only and read-write access.
* Added a retained bucket class with object locking and a 365-day
compliance retention period.
* **Documentation**
* Added guidance for the `publicRead` setting, which is disabled by
default.
* **Updates**
* Updated the SeaweedFS COSI driver to v0.5.0. Pool names `public` and
names ending in `-public` are reserved.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-13 18:47:57 +03:00
Aleksei Sviridkin 5fe356f57e fix(postgres): accept a standard five-field backup schedule (#5119)
## What this PR does

The postgres app hands `backup.schedule` to a CloudNativePG
`ScheduledBackup`, and the field asks for the six-field CloudNativePG
cron with leading seconds. The mongodb app takes a standard five-field
cron in the same field, and so do backup Plans and the Plan form in the
console, so tenants copy a value from one app into the other and support
has to explain the difference.

CloudNativePG does not reject a five-field value. CloudNativePG 1.30.0,
which main pins, parses the schedule with `cron.Parse` from robfig/cron
v1.2.0 in both the ScheduledBackup webhook and the controller. That
parser takes five or six fields, reads the first one as seconds and
makes day-of-week optional, and the webhook only returns a warning when
the count is not six. CloudNativePG's own webhook test "warn the user if
the schedule has a wrong number of arguments" covers this with `1 2 3 4
5`. So `0 2 * * *`, meant as every day at 02:00, fires every hour at
minute 2, and `5 * * * *` fires every minute.

The chart now counts the fields. A five-field value gets a leading `0`
seconds field, so `0 2 * * *` renders `0 0 2 * * *`. A six-field value
and a descriptor such as `@daily` or `@every 6h` render exactly as
before. Any other field count fails the render with a message that shows
both forms, where before it reached the webhook and was rejected there.
An empty schedule still renders no ScheduledBackup. The field
description that the dashboard form shows and the README now name both
forms.

One thing changes on upgrade. A release that already sets a five-field
value gets the standard meaning of it, so `0 2 * * *` moves from hourly
to daily. Before this change such a value was outside the documented
format and drew the webhook warning.

`packages/system/keycloak` renders its own CloudNativePG ScheduledBackup
from its `backup.schedule`, with a six-field default and a values
comment that says so. It is a platform component with its own template,
so it is not changed here. The other apps with a backup schedule
(mongodb, mariadb, clickhouse) and backup Plans already take five
fields.

- Ran robfig/cron v1.2.0 `Parse` locally from 10:00:00. `5 * * * *`
fires at 10:00:05, 10:01:05 and 10:02:05, and `0 2 * * *` at 10:02:00
and 11:02:00. With the leading `0` they fire at 10:05:00 and 11:05:00,
and daily at 02:00.
- Rendered the whole chart with helm 3.17.3 and the `configured` render
fixture. The output matches main for the defaults, for `0 2 * * * *` and
for `@daily`, and for `0 2 * * *` only the `schedule` line differs.

Unit tests with `helm unittest` 1.1.2, the version CI pins.
`packages/apps/postgres` passes 216 of 216 in 27 suites, against 209 in
26 on main. The new suite has seven cases. With the old template five of
them fail. The six-field and descriptor cases pass on both, and they
fail when the template prepends to six fields too or drops the
descriptor check.

### Screenshots

Not a UI change. The dashboard form picks up the new field description
from the schema.

### Downstream repositories

Walked the trigger map in `docs/agents/contributing.md` against the
diff. A chart template, a new test suite, one field description and the
README, schema, Go types and cozyrd regenerated from it. No field is
added, removed or renamed and no default or enum changes. The terraform
provider does not model `backup.schedule`. The website reference page
for postgres is generated from this README on a stable tag, and the Go
types example there uses a six-field schedule, which keeps working.

- [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(postgres): backup.schedule accepts a standard five-field cron such as 0 2 * * *, and the chart prepends a 0 seconds field before handing it to CloudNativePG, which reads the first field as seconds. Six-field values and descriptors render as before, and any other field count fails the render. A release that already sets five fields gets the standard meaning on upgrade, so 0 2 * * * moves from hourly to daily.
```


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

## Summary by CodeRabbit

* **New Features**
* PostgreSQL backup schedules support standard five-field cron
expressions as well as six-field expressions with a leading seconds
field. Five-field schedules are converted automatically; six-field
schedules and cron descriptors are used as provided.
* **Schedule Changes**
* After upgrading, `0 2 * * *` runs daily at 02:00 instead of hourly at
minute 2. To keep the previous hourly schedule, use `0 2 * * * *`.
* Invalid schedule formats produce a rendering error. Empty schedules
continue to disable chart-managed backups.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-13 17:38:05 +03:00
Aleksei Sviridkin 24f2b8009f feat(redis): add maxmemory, eviction policy and snapshot toggle (#5310)
## What this PR does

Lets a tenant run Redis as a pure cache without giving up the persistent
volume. Until now the chart only turned snapshots off together with the
volume (when `size` is empty), and offered no way to bound memory: a
`CONFIG SET maxmemory` is lost when the pod restarts. On a cache-only
instance, RDB snapshots and replica full syncs then filled the volume,
and each SIGKILL during a save left an orphaned `temp-*.rdb` behind, so
the instance crashlooped.

New values:

- `maxmemory` (quantity, unset by default): rendered in bytes. Unset
renders `maxmemory 0`, the Redis default (no limit).
- `maxmemoryPolicy` (enum, default `noeviction`): rendered as
`maxmemory-policy`.
- `snapshots` (bool, default `true`): `false` renders `save ""` while
keeping the volume. Snapshots stay off when `size` is empty, as before.

Every directive is rendered with an explicit value, defaults included.
The operator applies `customConfig` with `CONFIG SET` on every reconcile
and never resets a directive whose line disappears
(`service/redis/client.go` in freshworks-oss/redis-operator v3.3.5), so
leaving the defaults implicit would turn reverting a setting into a
no-op until the next pod restart. As a consequence, existing instances
gain `save 3600 1 300 100 60 10000`, `maxmemory 0` and `maxmemory-policy
noeviction` on upgrade. These equal the Redis 7 and 8 defaults, but they
overwrite any value an operator set by hand with `CONFIG SET`.

`maxmemory` is refused at render time above 90% of the Redis memory
request: above that threshold (`reservedPodMemoryPercent`, default 10)
the operator logs an error and skips the line, which would leave Redis
unbounded with nothing visible to the tenant.

Not changed here: a replica still writes a temporary RDB to disk during
a full sync (`repl-diskless-load` defaults to `disabled`), even with
`snapshots: false`. `stop-writes-on-bgsave-error` keeps its default,
since no background save runs once snapshots are off.

Tests: `tests/cache_config_test.yaml` covers the rendered defaults, the
snapshot toggle with and without a volume, byte conversion from presets
and explicit resources, and both refusals. `helm unittest
packages/apps/redis` passes (93 tests).

### Screenshots

Not a UI change.

### Downstream repositories

The new fields in `values.schema.json` reach
`cozystack/terraform-provider-cozystack`, whose redis schema and
expand/flatten pair are hand-written; no follow-up has been opened there
yet, so the box is left unticked. The website reference page is
regenerated from `README.md` by the release bot.

- [ ] 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(redis): add `maxmemory`, `maxmemoryPolicy` and `snapshots` values so Redis can run as a pure cache (bounded memory, eviction, no RDB snapshots) while keeping its persistent volume. Existing instances now render the Redis defaults for these directives explicitly, which resets any value set by hand with `CONFIG SET`.
```


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

## Summary by CodeRabbit

* **New Features**
* Added configurable Redis memory limits, with a default of unlimited,
and eviction policies, defaulting to `noeviction`. Configured limits
must be whole-byte quantities and cannot exceed 90% of the pod’s memory
request.
* Added controls for scheduled Redis snapshots. Snapshots are enabled by
default when storage is configured; disabling them does not remove
existing snapshot files, and snapshots are off when storage size is
empty.
* **Documentation**
* Documented the new Redis memory and snapshot settings, including
defaults, constraints, and effects.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-13 16:32:31 +03:00
Aleksei Sviridkin 97e0618258 Merge branch 'main' into fix/postgres-backup-schedule-five-fields
Regenerate the postgres ApplicationDefinition schema on top of main.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-13 13:39:51 +03:00
Mattia Eleuteri 21fd2b7b69 feat(bucket): add publicRead to serve a bucket without credentials
A bucket cannot serve its objects without a signature: every
BucketAccess issues a key, and the keys grant neither WriteAcp nor
PutBucketPolicy, so a tenant cannot open the bucket themselves with
put-bucket-acl. Static assets then need a proxy, presigned URLs or
an operator running weed shell by hand, which no reconcile tracks
and which outlives the bucket.

publicRead renders one more BucketAccess on a new -public access
class whose accessPolicy is public-read. The COSI driver handles that
policy by adding Read:<bucket> to the gateway's anonymous identity
and removing only that action on revoke, so deleting the bucket or
turning the flag off closes it again without touching other public
buckets. Anonymous callers can read objects but cannot list the
bucket or write to it.

The access is named <bucket>-public-read, the name a user called
public-read would take, so that combination fails to render instead
of fighting over one BucketAccess.

Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
2026-11-13 13:02:02 +03:00
Mattia Eleuteri d308e9e5e5 fix(redis): refuse sub-byte maxmemory and apply the policy first
A quantity such as 512m is 0.512 bytes; the integer cast truncated it,
or -512m, to 0, which Redis reads as no limit, so the bound a tenant
set could vanish without an error. The operator also sends the
directives in list order, and lowering maxmemory below the dataset
evicts at once, so the policy has to be set before the bound.

Turning snapshots off does not remove an RDB already on the volume,
which Redis still loads on restart; the parameter no longer says the
data is lost.

Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
2026-11-13 09:43:05 +01:00
Mattia Eleuteri 0f16bf9c73 feat(redis): add maxmemory, eviction policy and snapshot toggle
A Redis used purely as a cache had no durable way to bound its memory
or stop writing RDB snapshots: the chart only disabled snapshots
together with the persistent volume, and a CONFIG SET is lost when the
pod restarts. Snapshots and replica full syncs then filled the volume
and left the instance crashlooping.

maxmemory, maxmemory-policy and save are always rendered with an
explicit value, because the operator applies customConfig with CONFIG
SET on every reconcile and never resets a directive whose line
disappears; leaving the defaults implicit would make reverting a
setting a no-op until the next pod restart. maxmemory is refused above
90% of the memory request, the threshold above which the operator
silently skips the line and leaves Redis unbounded.

Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
2026-11-13 09:30:50 +01:00
Michel Jansen 7d9f913350 feat(kubernetes): configure per-pool Talos sysctls
Worker sysctl requirements extend beyond user namespaces. A string map
keeps those settings in the Talos machine config without expanding the
application API for each kernel knob.

Tenant input crosses an unquoted shell heredoc in the reconcile Job,
so preserve scalar contents without allowing shell or YAML injection.

Assisted-by: LLM
Signed-off-by: Michel Jansen <mjansen@whero.xyz>
2026-11-12 21:35:53 +01:00
Myasnikov Daniil 8a45b3dd94 docs(kubernetes-nodes): describe the worker pool as it works today
The pool's field descriptions, README and NOTES still read as if the
pool lived inside the kubernetes chart: five fields told the user to
keep them in sync with parent fields that do not exist, NOTES warned
about colliding with a parent-managed md0 pool although the parent
renders no pools and md0 is the normal name of a native pool, and the
installer image was attributed to an upgrade Job that never runs one.

A user of the API, the dashboard form or the published README reads
these descriptions to decide what a field does, so they now say what
the chart renders, which fields have no effect on a Proxmox pool, and
how the reservations and the support matrix actually behave.

Assisted-by: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-12 18:03:43 +05:00
Myasnikov Daniil fb8a7ef278 docs(kubernetes): describe the cluster as it is and drop the history
The README told users two things the chart does not do: that it
deploys a dedicated etcd cluster (the control plane uses the tenant's
etcd, which the Tenant deploys), and that worker disks match the
volume's block size through blockSize.matchVolume, a setting that
exists nowhere in the tree. It also described worker nodes as KubeVirt
VMs managed by this application, while they are KubernetesNodes pools
on KubeVirt or Proxmox, and offered "patch versions" where the user
picks a minor.

The Breaking Changes section was a release log: entries from several
releases, most of them about fields that live on KubernetesNodes now,
and each one written as a change rather than as the current behaviour.
What a user has to do on upgrade belongs on the per-release upgrade
page of the website, so the README points there and keeps only the
storageClass immutability note, rewritten as current behaviour.

The field descriptions are what the dashboard, the API schema and a
rejected name show the user, and several were written against how the
application used to work. The name limit was explained by a default
md0 pool that no longer exists, while the 32-character cap leaves room
for any three-character pool name. The host default left out the
kubernetes- prefix the release name carries. A substrate mismatch with
a pool was said to leave Machines unreconciled, while the pool refuses
to render. The OIDC type carried a roadmap phase in its title, and
extraArgs promised "no change to current behavior". The name-cap test
looked for "md0" in the rejection message as its sign that the chart's
explanation arrives; it looks for the release-name pattern the new
explanation gives.

Assisted-by: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-12 17:21:15 +05:00
Myasnikov Daniil 90f0b043a6 fix(kubernetes)!: remove the talos block the chart no longer uses
The kubernetes chart declared a talos block (version, schematicID,
imageFactoryURL, installerRepository, registryMirrors). Workers are
KubernetesNodes pools and take every one of these from their own talos
values, so an operator who set them on the cluster got no error and no
effect. The only reader left was a copy of the Talos to Kubernetes
support-matrix check, and the pool chart already runs that check
itself, against the Talos release each pool actually boots, including
one an osImage override selects. The cluster's copy compared the
Kubernetes version against a Talos release no node runs.

The block leaves the API schema, hence the "!". Stored specs that still
carry it keep rendering: the values schema does not close the object
and the API does not validate spec against it. A helm-unittest case
pins that.

Readers outside the chart moved with it. The e2e install read
talos.schematicID from this chart's values.yaml in a best-effort block
that only warns, so removing the field would have stopped the image
cache being seeded without failing anything; it now reads the pool
chart, as the proxmox template script already does. The e2e no longer
writes a talos block into the Kubernetes CR, the spec test checks the
pool chart for the key it emits, the release checklist diffs the pool
chart's pins as well, and the catalog guard drops the two tests that
compared or read the parent's block. The null-normalization Go tests
used talos keys of the real Kubernetes schema as their fixtures; they
use oidc.mode, the same required-with-default shape under an optional
root section, and addons.cilium.valuesOverride for the free-form case.

Assisted-by: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-12 16:51:38 +05:00
Mattia Eleuteri d48897cf82 feat(virtual-machine): let each disk set its own boot order
The boot order of a VM's disks was the order of the disks list, so the
only way to boot from installer or rescue media, such as an ISO
attached as a CD-ROM, was to move that media to the front of the list.
Callers that treat the first disk as the system disk then see the ISO
in its place.

An optional bootOrder per disk decides boot priority independently of
the list. Disks that leave it unset keep their positional order, so
existing VMs render unchanged. Duplicate effective boot orders are
refused at render time with the names of both disks, since KubeVirt
would otherwise deny the VirtualMachine with a less specific error.

Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
2026-11-10 10:28:28 +01:00