Commit Graph
5070 Commits
Author SHA1 Message Date
Mattia Eleuteri 64fa40e255 feat(monitoring): add destinations to the agents without replacing the defaults
Sending a copy of metrics or logs to a store of one's own meant
overriding vmagent.remoteWrite.urls or fluent-bit.config.outputs. Both
are replaced wholesale on merge, a list and a single string, so the
override had to restate the platform's own destinations, and one that
did not silently cut the tenant's VictoriaMetrics and VictoriaLogs off.
A plain URL list could not carry credentials either.

vmagent.extraRemoteWrite takes VMAgent remoteWrite entries appended
after urls and passed as is, so an entry can carry basicAuth,
bearerTokenSecret, headers or tlsConfig. fluent-bit.config.extraOutputs
takes [OUTPUT] sections appended by the outputs template itself, which
the fluent-bit subchart renders with tpl, so .Values there is the
subchart's own. The managed Kubernetes app replaces outputs for tenant
clusters, so its outputs carry the same hook, escaped to survive the
app chart's render. On a tenant cluster both are set through
addons.monitoringAgents.valuesOverride.

With neither key set, the system chart render and the tenant render
(app HelmRelease values fed to the system chart) are byte-identical to
before. Unit tests cover both keys in the system chart and the hook in
the tenant HelmRelease; each fails without the change.

Both charts refuse to render when extraOutputs is set and the
effective outputs does not emit it, so an outputs override that drops
the hook fails loudly instead of losing the extra destinations.

Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
2026-11-23 11:58:49 +03:00
Aleksei Sviridkin dec14c736d docs(gateway): stop saying the route-hostname policy admits hostname-less routes (#5352)
## What this PR does

Refs #4938

The edge-termination section of `packages/extra/gateway/README.md` said
that on a class sharing one edge address the class controller has to
keep route hostnames inside the tenant apex, "since the platform's
route-hostname policy admits routes that declare no hostnames at all".

That stopped being true in 1.7.
`packages/system/cozystack-basics/templates/route-hostname-policy.yaml`
now requires `spec.hostnames` to be present and non-empty for
`HTTPRoute`, `TLSRoute` and `GRPCRoute` in `tenant-*` namespaces
(#3475), and it rejects any hostname outside the namespace's
`namespace.cozystack.io/host` apex. The policy doesn't depend on the
Gateway class. This PR replaces the sentence with one that says so and
links to the policy's entry under "Security model".

This fixes only the line the issue points at. I didn't audit the rest of
the README against the code, so I used `Refs` and not `Closes`. The
issue asks for that full review, and it should stay open for it.

`make generate` (cozyvalues-gen) only rewrites the parameter table, and
this change doesn't touch it.

### Screenshots

Not a UI change.

### Downstream repositories

I left every box below unticked on purpose. The only downstream copy of
this text is the Gateway reference page on cozystack/website. Per
`docs/agents/contributing.md`, the release bot regenerates that page
from this README on the next stable tag, so I don't think any manual
follow-up is needed. A maintainer should confirm that.

- [ ] 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
docs(gateway): the Gateway README no longer says the route-hostname policy admits routes without hostnames; since 1.7 it rejects them in tenant namespaces.
```


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

## Summary by CodeRabbit

* **Documentation**
* Clarified that the route-hostname policy applies to `HTTPRoute`,
`TLSRoute`, and `GRPCRoute` resources in `tenant-*` namespaces on
creation and update. It rejects routes with no hostnames or hostnames
outside their namespace’s apex. Routes stored before the policy is
installed are not rejected unless they are subsequently updated.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-23 11:56:48 +03:00
Aleksei Sviridkin 04fb5215a8 fix(kubernetes): apply addons.monitoringAgents.valuesOverride (#5375)
<!-- 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

`addons.monitoringAgents.valuesOverride` on a managed Kubernetes cluster
is accepted, stored and documented in the schema and README, but the
addon's HelmRelease template never reads it. The application stays
`Ready` and nothing reaches the agents, so a user who adds a second
vmagent remote-write URL or an extra Fluent Bit output to ship a copy of
metrics or logs to their own store gets no error and no effect. Every
other addon with a `valuesOverride` (coredns, cert-manager,
ingress-nginx, vertical-pod-autoscaler, cilium) already merges it.

The single commit moves the defaults into a
`cozystack.defaultMonitoringAgentsValues` helper and merges
`valuesOverride` over them with `mergeOverwrite`, the same pattern as
those addons. With no override the rendered HelmRelease is semantically
identical to the one on `main`; a new unit test sets an override and
fails on the previous template.

Note for reviewers: as with the other addons, lists and multi-line
strings are replaced rather than appended, so overriding
`vmagent.remoteWrite.urls` or `fluent-bit.config.outputs` means
restating the default tenant destination to keep it.

The `vmagent.remoteWrite.url` vs `.urls` mismatch from #5258 is already
fixed by #5024 and is on its way to the release lines in #5311 and
#5312; this PR covers the `valuesOverride` gap that #5258 also points
out.

Refs #5258

### Screenshots

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

### Downstream repositories

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

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

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

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

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

### Release note

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

```release-note
fix(kubernetes): `addons.monitoringAgents.valuesOverride` is now applied to the monitoring agents of managed Kubernetes clusters; it was previously accepted but ignored.
```


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

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

## Summary by CodeRabbit

* **Bug Fixes**
* Monitoring agent overrides now retain default settings while applying
custom values. Configured remote-write URLs, cluster and tenant labels,
cluster-specific log filters, and log volumes remain intact when outputs
are overridden.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-23 11:51:37 +03:00
Aleksei Sviridkin 382169be52 fix(talos): bump Talos to v1.14.4 (CVE-2026-99999) (#5045)
## What this PR does

Bumps the Talos release Cozystack ships for host nodes from v1.14.2 to
v1.14.4. Talos v1.14.4 ships Linux 6.18.57, which carries the upstream
fix
[`6785011f8b16`](https://git.kernel.org/linus/6785011f8b16abf40b1e9d8b2e332232b3e68822)
("ipv4: validate checksum_start before completing checksum") for
CVE-2026-99999, known as PwnEscape. v1.14.2 runs Linux 6.18.54 and is
affected.

A guest controls the `csum_start` field of the `virtio_net_hdr` it hands
to the host through TAP or vhost-net. When the host fragments such a
packet, `skb_checksum_help()` writes two guest-chosen bytes inside the
IPv4 header, and `ip_frag_next()` then copies host memory past the
packet into every fragment. The leak has been chained into code
execution on the host. No nested virtualization is needed. KubeVirt VMs
on Cozystack use the bridge binding, a TAP device with vhost-net and
checksum offload on, so root in any guest (a `vm-instance` or a tenant
Kubernetes worker) reaches this path on the host node.

Changes:

- `packages/core/talos/images/talos/profiles/*`: regenerated with
`hack/gen-profiles.sh v1.14.4` (installer-base and every system
extension digest, amd64 and arm64).
- `packages/system/multus/images/multus-cni/Dockerfile`: the
`talos-cni-plugins-checked-against` marker moves to v1.14.4. Talos
v1.14.4 still pins containernetworking/plugins v1.9.1 in
siderolabs/pkgs, the same as `CNI_PLUGINS_VERSION`.
- `docs/operations/system-memory-limits.md`: the shipped version it
names moves to v1.14.4. No OOM handler file changed between v1.14.2 and
v1.14.4, so the quoted defaults still hold.

The v1.14.2 to v1.14.4 changes are patch fixes only (network route
teardown, DHCP, KubePrism recovery, mount cleanup, etcd 3.7.2), with
DRBD 9.3.4 and ZFS 2.4.4 unchanged. No machine-config change is needed
on top of the v1.14 requirements that v1.14.2 already brought in.

Not covered here: tenant Kubernetes workers default to Talos v1.13.6
(`packages/apps/kubernetes`, `packages/apps/kubernetes-nodes`). The bug
is on the host side, so the host bump is what closes the guest escape.
No v1.13 release with the fix exists yet (v1.13.11 is on 6.18.54).

Tested: `hack/cni-plugins-staging-contract.bats` and
`hack/talos-installer-index_test.bats` pass (12/12), run in the
`bats/bats:1.13.0` container. No image was built or booted locally.

### Screenshots

Not a UI change.

### Downstream repositories

The trigger map hits `cozystack/website`: this bumps the version in
`packages/core/talos/images/talos/profiles/installer.yaml`, and
`data/versions/next.yaml` there pinned `talos: "v1.14.2"`. The follow-up
moves it to v1.14.4 and should merge after this PR. No other repository
on the map is reached by this diff.

- [ ] No downstream repository is affected by this change
- [x] [cozystack/website](https://github.com/cozystack/website) -
follow-up: https://github.com/cozystack/website/pull/768
- [ ]
[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(talos): Bump Talos to v1.14.4 (Linux 6.18.57) to fix CVE-2026-99999 (PwnEscape), a guest-to-host escape through virtio_net_hdr checksum offload that any KubeVirt VM can reach on the host node. Upgrade and reboot host nodes; the fix applies only to the kernel that is running.
```



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

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

## Summary by CodeRabbit

* **Updates**
* Updated Talos-based installer, ISO, kernel, metal, and NoCloud
images—including ARM64 variants—from v1.14.2 to v1.14.4, with refreshed
system extensions and firmware.
* Updated the documented Talos version associated with host-node
memory-limit defaults to v1.14.4.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-23 08:12:47 +03:00
Aleksei Sviridkin 18a9530b87 fix(platform): honour a bool false in ingress-enabled and monitoring-enabled (#5354)
## What this PR does

`default "true"` treats a bool false as empty, so an unquoted
`_cluster.ingress-enabled: false` or `_cluster.monitoring-enabled:
false` still rendered `_namespace.ingress: tenant-root` and the
monitoring ExternalName redirects. Both gates now check for a missing
key first and otherwise require `"true"` or a bool true, so a missing
key keeps the old behaviour, every string value keeps its old meaning,
and a bool false turns the feature off. #5097 does the same for the
seaweedfs flag.

helm-unittest 1.1.2, cozystack-basics 83 of 83. Against the templates on
main the two new bool-false cases fail.

### Downstream repositories

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

### Release note

```release-note
fix(platform): an unquoted false in _cluster.ingress-enabled or _cluster.monitoring-enabled now turns off the tenant-root ingress key and the monitoring redirects.
```


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

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

## Summary by CodeRabbit

* **Bug Fixes**
* Ingress and monitoring redirects are no longer enabled when their
settings are explicitly `false` or empty. When settings are missing,
existing default behavior is preserved.

* **Tests**
* Added coverage for disabling ingress and monitoring redirects with
boolean `false`.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-23 06:55:44 +03:00
Aleksei Sviridkin ff461cc41f fix(kubernetes): remove cilium dependency from coredns HelmRelease (#5331)
## What this PR does

Closes #5315

Removes `spec.dependsOn` on Cilium from the tenant `coredns`
`HelmRelease`
(`packages/apps/kubernetes/templates/helmreleases/coredns.yaml`).

When Hubble Relay is enabled at tenant cluster creation, `hubble-relay`
waits on DNS resolution for `hubble-peer.cozy-cilium.svc.cluster.local`
before the Cilium `HelmRelease` becomes Ready. Because CoreDNS
previously declared `dependsOn` on Cilium, Flux blocked CoreDNS
installation until Cilium was ready, creating a circular deadlock.
Allowing both `HelmRelease` resources to reconcile concurrently lets
CoreDNS retry (`spec.install.remediation.retries: -1`) until Cilium
brings up cluster networking, unblocking CoreDNS and Hubble Relay.

### Downstream repositories

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

### Release note

```release-note
fix(kubernetes): remove cilium dependency from coredns HelmRelease to prevent a circular startup deadlock when Hubble Relay is enabled
```

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

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

## Summary by CodeRabbit

* **Updates**
* CoreDNS no longer waits for the release-specific Cilium HelmRelease
dependency before being managed. Its configured values remain unchanged,
and installation and upgrade remediation behavior is covered by
automated checks.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-23 04:41:48 +03:00
Aleksei Sviridkin 0c44188eb5 Merge branch 'main' into mattia/pwnescape-kvm-cozystack-talos-dec626
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-23 04:14:37 +03:00
Aleksei Sviridkin f5479e7093 fix(qdrant): scrape TLS metrics over HTTPS (#5340)
## What this PR does

Qdrant with TLS enabled serves metrics over HTTPS, but its
ServiceMonitor still uses HTTP. Patch the rendered endpoint to use HTTPS
with the issued CA and a certificate SAN. The API key and explicit TLS
opt-out are preserved.

Validation: 3 regression tests and 110 Helm tests pass; both TLS cases
fail without the patch. The full Bats run has 183 failures on this macOS
host, all reproduced on unchanged main. The POSIX lane has 4 baseline
failures as well.

### Downstream repositories

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

### Release note

```release-note
fix(qdrant): restore metrics scraping for TLS-enabled instances by using HTTPS and verifying the server certificate against the issued CA.
```

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

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

## Summary by CodeRabbit

* **New Features**
* Qdrant monitoring now uses HTTPS when TLS is enabled, with certificate
verification and the configured server name.
* Monitoring connections use the release’s TLS certificate authority,
while non-TLS setups continue to use HTTP.
  * External Qdrant monitoring uses HTTPS by default.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-23 04:13:36 +03:00
Andrey Kolkov 5d96897d73 build(kafka-operator): vendor Strimzi 1.3.1 (#5372)
## What this PR does

Moves the Kafka operator from Strimzi 1.2.0 to 1.3.1, the only Strimzi
release rebuilt on an OpenJDK that fixes CVE-2026-114938 ("Java4Shell").

The CVE is an out-of-bounds write in the AVX-512 VBMI Base64 decoder of
OpenJDK 17.0.6 and later. A broker decodes Base64 in SASL/SCRAM before
the client is authenticated, so on an x86-64 node with AVX-512 VBMI a
tenant's cluster can be attacked by anyone who reaches its listeners.
Strimzi [rebuilt 1.3.1 and does not plan to rebuild
1.2.0](https://github.com/strimzi/strimzi-kafka-operator/issues/13394).

| Image | Bundled OpenJDK |
|---|---|
| `quay.io/strimzi/kafka:1.2.0-kafka-4.3.1`,
`quay.io/strimzi/operator:1.2.0` (today) | 21.0.12, affected |
| `quay.io/strimzi/kafka:1.3.1-1-kafka-4.3.1`,
`quay.io/strimzi/operator:1.3.1-1` (this PR) | 21.0.13.1, fixed |

What changes:

- The vendored chart is 1.3.1 as published, with no local patches. It
keeps Kafka 4.2.1 and 4.3.1, the two versions the `kafka` application
offers, so no tenant has to change `version`.
- The images are pinned to the suffixed rebuild tags (`1.3.1-1`, bridge
`1.2.1-1`). Strimzi moved the plain `1.3.1` tags onto the rebuild, so a
node that pulled the first build would keep the affected JDK under an
unchanged tag. All ten images the chart references exist under the
suffixed tags.
- The chart drops Kaniko (Buildah is the only Connect builder) and
grants the operator `serviceaccounts/token` and cert-manager
`certificates`, for two features that are off by default.
- The example backup scripts fall back to the same Kafka image and
follow it.
- A first commit makes the Kafka backup strategies (the platform's
topic-metadata strategy and the topic-data demo strategy) SigV4-sign
their S3 requests themselves with `openssl` and `sha256sum` instead of
`curl --aws-sigv4`. The Strimzi 1.3.1-1 images ship curl
`7.76.1-43.el9`, whose RHEL backport of the S3 payload handling signs
`x-amz-content-sha256` without sending it, so SeaweedFS answered every
backup upload and download with 403; that is what failed
`kafka-2-backup-roundtrip` and `kafka-3-metadata-roundtrip` on the first
run of this PR. The commit comes first because it works with the Strimzi
1.2 curl as well, so each commit is green on its own.

Not verified here: nothing was run on a live cluster. The check that
matters is the Kafka E2E on this PR, an upgrade of running clusters from
1.2.0 included. The signing was run against SeaweedFS 4.45 on a
non-default port inside both `quay.io/strimzi/kafka:1.2.0-kafka-4.3.1`
and `1.3.1-1-kafka-4.3.1` (metadata backup, restore and cleanup; demo
upload and download of a binary tarball), and the bats suites hold the
signature to the one botocore computes for the same request.

Notes for the reviewer:

- Strimzi 1.3 requires Kubernetes 1.32 or newer on the cluster the
operator runs on.
- Upgrading rolls every Kafka cluster once.
- This changes CRDs, so it does not reach the release lines, which are
on Strimzi 0.45.1 anyway. Those are covered by the JVM flag in #5371.
- #5371 stays useful after this merges only for the release lines; on
`main` the two do not conflict.

### Screenshots

N/A — no UI changes.

### Downstream repositories

Walked the trigger map against the diff: the vendored chart under
`packages/system/kafka-operator`, its wrapper values, the Kafka strategy
script in `packages/system/backupstrategy-controller/files`, the Kafka
backup examples and their bats suites. No package added or renamed, no
`values.schema.json` or README of an app, no version enum
(`packages/apps/kafka/files/versions.yaml` is unchanged), no platform
values, no `hack/` tooling or make target.

- [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
build(kafka-operator): update Strimzi to 1.3.1, whose images carry an OpenJDK with the fix for CVE-2026-114938 (Java4Shell). Every Kafka cluster rolls once on upgrade. Strimzi 1.3 requires Kubernetes 1.32 or newer. Kafka backups now sign their S3 requests in the strategy script, so they keep working with the curl the new Kafka images ship.
```


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

## Summary by CodeRabbit

* **New Features**
* Added support for projected service-account-token volumes, additional
volume ownership settings, and bind-mount options across Kafka
components.
* Added cert-manager support for cluster and client certificate
authorities.
* Expanded Kafka version options and added broker health panels to the
monitoring dashboard.
* **Updates**
* Updated Strimzi operator, Kafka, and Kafka Bridge images. Kubernetes
1.32 or newer is now required.
* S3 backup and restore requests now support signed requests to
custom-port endpoints.
* **Removals**
  * Removed Kaniko executor configuration and documentation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-23 08:01:53 +07:00
Andrey Kolkov d7573c009c fix(ingress-nginx): pick up the nginx rebuild with the HTTP/2 CVE fixes (#5377)
## What this PR does

Moves the ingress-nginx controller to `v1.11.6-cozystack.1`, the same
v1.11.6 controller with its nginx 1.25.5 rebuilt with two HTTP/2 fixes
from the nginx 1.30 stable branch:

| nginx commit | Fixes |
| --- | --- |
|
[`0c87dd1d`](https://github.com/nginx/nginx/commit/0c87dd1db413e440a4e3ef7ee8acc518509e8809)
| CVE-2026-123633, HTTP/2 use-after-free when `worker_connections` run
out |
|
[`b89c4100`](https://github.com/nginx/nginx/commit/b89c4100bf6762a45e4a6463eaf4b70368277c94)
| CVE-2026-123007, HTTP/2 flow control window overflow |

kubernetes/ingress-nginx is archived and will not publish another
1.11.x. The rebuild lives in the fork:
cozystack/ingress-nginx-with-protobuf-exporter#13. It compiles nginx
from upstream's own sources, patches and configure line, applies the two
commits last, and checks the result against the shipped binary.

Checked on the published image (`sha256:1d3f0e01…`, amd64 and arm64):

- `nginx -v` reports 1.25.5 with upstream's configure arguments, and
`nginx -t` passes on the controller's config;
- the nginx binary differs from the one in
`registry.k8s.io/ingress-nginx/controller:v1.11.6`;
- run as `www-data`, nginx binds port 80 and answers 200 over HTTP/2, so
`cap_net_bind_service` survived the rebuild.

`helm unittest` passes for the chart. Not run on a live cluster.

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

### Screenshots

N/A, no UI changes.

### Downstream repositories

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

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

### Release note

```release-note
fix(ingress-nginx): the ingress-nginx controller now runs nginx 1.25.5 rebuilt with the HTTP/2 fixes for CVE-2026-123633 and CVE-2026-123007. nginx still reports version 1.25.5.
```
2026-11-23 08:01:50 +07:00
Aleksei Sviridkin 0b53d53c01 Merge branch 'main' into fix/qdrant-monitoring-tls
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-23 02:58:03 +03:00
Aleksei Sviridkin 91fd8791c1 Merge branch 'main' into fix/cluster-flags-bool-false
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-23 02:53:08 +03:00
Andrey Kolkov 6afe23e32b chore(keycloak): bump Keycloak server to 26.8.2 (#5374)
## What this PR does

Moves Keycloak from 26.6.3 to 26.8.2, the only upstream image rebuilt on
an OpenJDK that fixes CVE-2026-114938 ("Java4Shell").

The CVE is an out-of-bounds write in the AVX-512 VBMI Base64 decoder of
OpenJDK 17.0.6 and later. Keycloak decodes Base64 on requests that
arrive before authentication, so on an x86-64 node with AVX-512 VBMI an
affected instance can be attacked without credentials. Upstream [rebuilt
26.8.2](https://www.keycloak.org/2026/11/java4shell-vulnerability-cve-2026-114938)
and left 26.6 and 26.7 as they were.

| Image | Bundled OpenJDK |
|---|---|
| `quay.io/keycloak/keycloak:26.6.3` (today) | 21.0.11, affected |
| `quay.io/keycloak/keycloak:26.8.2-3` (this PR) | 21.0.13.1, fixed |

What changes:

- `packages/system/keycloak` pins `26.8.2-3`. The suffix matters:
`26.8.2` moves when upstream rebuilds it, and `26.8.2-1` and `26.8.2-2`
still carry the affected JDK.
- `packages/system/keycloak-configure` runs `kcadm.sh` from the same
image and was still on 26.5.2; it moves along so the admin client
matches the server.

### How it was tested

Upgraded a two-replica 26.6.3 instance in place on a dev stand whose
nodes have AVX-512 VBMI, through the same values the release carries:

- The rolling update finished with the HelmRelease ready. The first new
pod ran the Liquibase update and migrated the `master` realm and the
platform realm through 26.7.0, 26.8.0 and 26.8.2.
- While it ran, the old node (Infinispan 16.0.8) and the new one
(16.0.15) shared one cluster view with no compatibility errors; the
final view has both nodes on 16.0.15.
- `java -version` in the pod reports 21.0.13.1.
- 26.8.2 enforces an audience check on the Admin REST API, which was the
main risk for the two admin clients this platform runs. Both pass: the
keycloak-operator, restarted to force a fresh login, reconciled every
resource and created a new realm group with no error and no 401 in its
log; and the `keycloak-configure` hook Job ran `kcadm.sh` from the new
image, with the same read and write calls repeated by hand afterwards.
- OIDC discovery and JWKS answer 200, and the login page of the platform
realm renders for the dashboard client. Submitting the login form was
not exercised.

`helm unittest` passes for both charts.

Notes for the reviewer:

- The database migration is one-way: after the upgrade, rolling the
image back to 26.6.3 is not supported.
- The upgrading guide says one 26.8.2 change (client registration
policies) does not support a rolling upgrade and asks to stop all nodes
first. This chart rolls the two replicas as before; the mixed phase
lasted under a minute in the test and showed no errors, but a deployment
that relies on dynamic client registration during the upgrade window may
see the difference.
- 26.8 also turns on client secret rotation and the SCIM API by default
and stops granting admin roles through identity-provider mappers unless
`allowAdminRoleMapping` is set. None of it is used by the platform's own
realm configuration.
- Custom login themes that override `social-providers.ftl` may need an
update for the redesigned identity-provider buttons.
- For the release lines, where a two-minor jump is not patch-release
material, #5370 adds the JVM flag instead.

### Screenshots

N/A — no UI changes in this repository. The Keycloak login page itself
changes with the upstream release.

### Downstream repositories

Walked the trigger map against the diff: an image tag in
`packages/system/keycloak/values.yaml` and in
`packages/system/keycloak-configure` (values and the template default).
No package added or renamed, no app `values.schema.json` or README, no
platform values key, no variant.

- [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
chore(keycloak): update Keycloak to 26.8.2, whose image carries an OpenJDK with the fix for CVE-2026-114938 (Java4Shell). The upgrade migrates the Keycloak database and cannot be rolled back to 26.6. Custom login themes that override social-providers.ftl should be checked against the redesigned identity-provider buttons.
```


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

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

## Summary by CodeRabbit

* **Updates**
* Updated the default Keycloak version to 26.8.2-3 across the main
service and its administrative job. The email-update configuration also
uses this version by default. Existing image overrides remain available,
so deployments that specify a custom image can continue using that
setting.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-21 18:41:36 +07:00
Andrei Kvapil 64cc6d2ff1 fix(ingress-nginx): pick up the nginx rebuild with the HTTP/2 CVE fixes
The controller image v1.11.6 ships nginx 1.25.5, and the upstream
project is archived, so no 1.11.x with a fixed nginx will come. The
cozystack fork now rebuilds that same nginx with the two HTTP/2 commits
from the 1.30 stable branch (CVE-2026-123633, CVE-2026-123007), and
this moves the controller to that build.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-11-20 21:09:57 +01:00
Andrey Kolkov bd79f08819 build(kafka-operator): vendor Strimzi 1.3.1
The Strimzi 1.2.0 images bundle OpenJDK 21.0.12, which is affected by
CVE-2026-114938, an out-of-bounds write in the AVX-512 VBMI Base64
decoder that a broker reaches in SASL/SCRAM before the client is
authenticated. Strimzi rebuilt only its 1.3.1 images on OpenJDK
21.0.13.1 and does not plan to rebuild 1.2.0.

Vendor the 1.3.1 chart as published. It keeps Kafka 4.2.1 and 4.3.1,
the versions the kafka application offers, adds 4.2.2 and 4.3.2, drops
Kaniko, and grants the operator serviceaccounts/token and cert-manager
Certificates for two features that are off by default.

Pin the images to the suffixed rebuild tags. Strimzi moved the 1.3.1
tags onto the rebuild, so a node that pulled the first build keeps
running the affected JDK under an unchanged tag; 1.3.1-1 does not move.

The example scripts fall back to the same Kafka image and follow it.

Strimzi 1.3 requires Kubernetes 1.32 or newer.

Assisted-by: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
2026-11-20 20:18:32 +07:00
Andrey Kolkov 35634080f4 fix(backups): sign Kafka S3 requests without curl --aws-sigv4
The Kafka topic-metadata strategy and the topic-data demo strategy move
their artifacts to and from S3 with the curl of the Strimzi image they
run in, signed by curl --aws-sigv4. The Strimzi 1.3.1-1 images carry
curl 7.76.1-43.el9, whose RHEL backport of the S3 payload handling
(0044-curl-7.76.1-aws-sigv4-s3-unsigned-payload.patch) adds
x-amz-content-sha256 to the canonical headers and to SignedHeaders but
never sends the header. SeaweedFS rejects every signed request, so both
backup Jobs fail with

    curl: (22) The requested URL returned error: 403

The 7.76.1-40.el9 curl of the Strimzi 1.2 images has a different
defect, a signed Host without the non-default port it sends, which the
--connect-to workaround covered.

Sign the request in the script with openssl and sha256sum, both in the
Strimzi image, and leave curl only the transport. Sending the missing
header from the script would not do: for an upload the -43 build signs
UNSIGNED-PAYLOAD and the -40 build the empty-body hash, so no single
value satisfies both, and a curl that is fixed to send the header would
then send it twice. With the Host signed as curl sends it, the
--connect-to workaround goes too.

The bats suites hold the signature to the one botocore 1.35.99
S3SigV4Auth computes for the same request at a fixed time. Against
SeaweedFS 4.45 on a non-default port, the metadata script's backup,
restore and cleanup and the demo strategy's upload and download pass
in both quay.io/strimzi/kafka:1.2.0-kafka-4.3.1 and
1.3.1-1-kafka-4.3.1, a key with a space and non-ASCII bytes included,
and a wrong secret still gets 403.

Assisted-by: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
2026-11-20 20:18:32 +07:00
Mattia Eleuteri dc74e04f7b fix(kubernetes): apply addons.monitoringAgents.valuesOverride
The monitoringAgents addon has exposed a valuesOverride field since it
was added, and the schema and README document it, but the HelmRelease
template never read it. An override was accepted and stored, the
application stayed Ready, and nothing reached the agents: for example a
second vmagent remote-write URL or an extra Fluent Bit output never
showed up in the tenant cluster. Every other addon with valuesOverride
(coredns, cert-manager, ingress-nginx, VPA, cilium) already merges it.

The defaults move into a cozystack.defaultMonitoringAgentsValues helper
and valuesOverride is merged over them with mergeOverwrite, the pattern
those addons use. Lists and multi-line strings are replaced, not
appended: an override of vmagent.remoteWrite.urls or
fluent-bit.config.outputs has to restate the default destination to
keep it. The helper ends with "{{ end }}" rather than "{{- end }}" so
that the filters block keeps its trailing newline.

With no override, the rendered HelmRelease is semantically identical
to the one before (same values, only toYaml key order). A unit test
sets an override and checks that it replaces urls and outputs while the
defaults it does not touch remain; it fails on the previous template.

Refs: #5258
Fixes: 3c27a1e9bf ("add metrics agents (#461)")
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
2026-11-20 14:09:13 +01:00
Andrey Kolkov 026b015635 fix(opensearch): disable the Base64 intrinsics hit by CVE-2026-114938 (#5373)
## What this PR does

CVE-2026-114938 ("Java4Shell") is an out-of-bounds write in the AVX-512
VBMI Base64 decoder of OpenJDK 17.0.6 and later. OpenSearch decodes the
Basic credentials of a request before it authenticates it, so on an
x86-64 node with AVX-512 VBMI a tenant's cluster can be attacked by
anyone who reaches its HTTP port.

Two of the three versions the `opensearch` application offers bundle an
affected JDK, and OpenSearch has not released a build on a patched one
yet:

| Image | Bundled JDK | Affected |
|---|---|---|
| `opensearchproject/opensearch:3.0.0` | 21.0.7 | yes |
| `opensearchproject/opensearch:2.11.1` | 17.0.8 | yes |
| `opensearchproject/opensearch:1.3.20` | 11.0.25 | no |

This PR starts the nodes with `-XX:-UseBASE64Intrinsics`, the mitigation
[RHSB-2026-018](https://access.redhat.com/security/vulnerabilities/RHSB-2026-018)
recommends: it removes the vulnerable code path and keeps the other
AVX-512 optimizations.

The flag is delivered as a `jvm.options.d` file mounted from a ConfigMap
through `general.additionalVolumes`, because neither obvious route
works:

- `bin/opensearch-env` unsets `JAVA_TOOL_OPTIONS`, so an env var never
reaches the JVM;
- setting `nodePools[].jvm` makes the operator stop sizing the heap from
the memory request and use the string as is.

The operator mounts `general.additionalVolumes` into the node pools and
the bootstrap pod alike, and `restartPods` restarts them when the file
changes.

Verified by starting 3.0.0, 2.11.1 and 1.3.20 with the file mounted:
each server JVM runs with `-XX:-UseBASE64Intrinsics`, and the heap
passed in `OPENSEARCH_JAVA_OPTS` still applies after it. `helm unittest`
passes (156 tests), including a new suite. Not tested through the
operator on a live cluster.

Notes for the reviewer:

- This is a mitigation, not a fix. A version bump has to wait for an
OpenSearch release on a patched JDK.
- Upgrading restarts every OpenSearch cluster once.
- The securityadmin update Job is left alone: it is a client and accepts
no inbound connections. OpenSearch Dashboards is Node.js.
- The commit picks onto `release-1.7` cleanly and conflicts in
`templates/opensearch.yaml` on `release-1.6` (checked with a merge-tree
dry run).

### Screenshots

N/A — no UI changes.

### Downstream repositories

Walked the trigger map against the diff: one template, one new template
and one unit test under `packages/apps/opensearch`; no values key,
`values.schema.json`, README, version enum or default changes.

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

### Release note

```release-note
fix(opensearch): mitigate CVE-2026-114938 (Java4Shell) by starting OpenSearch nodes with -XX:-UseBASE64Intrinsics, which disables the vulnerable OpenJDK Base64 decoder. Every OpenSearch cluster restarts once on upgrade.
```
2026-11-20 17:29:42 +07:00
Andrey Kolkov f4330867ea feat(dashboard): let a login link pick the Keycloak identity provider (#5286)
## What this PR does

A login link into the dashboard can now name the Keycloak identity
provider, so a user who comes from a portal brokered into Keycloak skips
the realm login page:

```
https://dashboard.<host>/oauth2/start?kc_idp_hint=<idp-alias>&rd=/admin/tenants
```

The motivating case is a billing portal registered in the realm as an
OIDC identity provider. Its "Open dashboard" button today lands every
client on "Sign in to <realm>", where they must pick the portal's
provider by hand on every new browser or session. Keycloak skips that
page when the auth request carries `kc_idp_hint`. The gatekeeper,
however, builds the request from a fixed `--login-url`, and
oauth2-proxy's flags forward only `acr_values`, `prompt` and
`approval_prompt` from `/oauth2/start`. Putting the hint into
`--login-url` would force every dashboard login, administrators
included, through that one provider.

oauth2-proxy can forward an allowed parameter through
`providers[].loginURLParameters`, but only in its alpha configuration.
The OIDC gatekeeper therefore now runs from one:

- `templates/gatekeeper-config.yaml` (new, OIDC only) holds the
provider, upstream, listen address and injected headers. The values are
exactly what `oauth2-proxy --convert-config-to-alpha` (v7.12.0) produces
for the previous flags, both the in-cluster Keycloak branch and the
external-discovery branch. On top of those, `kc_idp_hint` is allowed
when it matches `^[A-Za-z0-9._-]+$`. That rule and `clientSecretFile` in
place of the inline `clientSecret` are the only hand-written lines;
everything else, `scope`, `approval_prompt`, `insecureSkipNonce`,
`flushInterval` and `timeout` included, is the converter output
unchanged.
- `templates/gatekeeper.yaml` keeps the flags the alpha configuration
does not own (redirect URL, whitelist domain, email domain, API routes,
cookie options, `--skip-provider-button`, `--ssl-insecure-skip-verify`).
It mounts the config and the `dashboard-client` secret as files
(`clientSecretFile`). A checksum annotation restarts the pod when the
config changes.
- The token-proxy branch (OIDC disabled) is unchanged.

A login without the parameter behaves as before. oauth2-proxy logs a
warning on start that the alpha configuration format may change between
releases.

Tests:
- **Chart suite.** The gatekeeper suite loads the config template as
well, because the deployment checksums it. The "no branding volume" test
now asserts the branding volume is absent, not that the pod has no
volumes. The five tests that read Keycloak URLs from the container args
are removed: those values now sit in the alpha configuration. `helm
unittest .` passes, 23 tests.
- **E2E.** After the gatekeeper rolls out with OIDC enabled, the in-tree
install suite requests `/oauth2/start` through a port-forward and checks
the redirect: `kc_idp_hint=e2e-idp` reaches the `cozy` realm's auth URL,
and a value outside the allow pattern (`e2e%26prompt%3Dnone`) is
dropped. This covers the realm path and the allow rule that the removed
chart tests no longer pin.
- **Gatekeeper login (`hack/dashboard-gatekeeper-login.bats`).** Renders
the chart for a realm other than `cozy`, starts the auth-proxy image
with the rendered args and alpha config, and checks the `/oauth2/start`
redirect: on the in-cluster Keycloak branch the hint reaches that
realm's auth URL, a value outside the allow pattern is dropped, and a
login without it carries none; on the external-discovery branch the
gatekeeper discovers that realm from a local Keycloak stub and passes
the hint. The image is read from the render, so an oauth2-proxy bump
re-checks the alpha configuration. Needs docker, like
`hack/etcd-grpc-alerts.bats`.
- **Real oauth2-proxy v7.12.0 on the rendered config.** Ran with the
rendered args and checked:
  - `/ping` answers OK;
- `/oauth2/start?kc_idp_hint=whmcs` puts `kc_idp_hint=whmcs` into the
Keycloak auth URL;
- `/oauth2/start` without the parameter, or with a value outside the
pattern, does not;
  - a protected path redirects without it;
  - `/apis/*` stays 401;
  - `--ssl-insecure-skip-verify` starts fine alongside `--alpha-config`.
- **Live cluster.** Swapped in the rendered gatekeeper with the
HelmRelease suspended, then reverted:
- a brokered user who was already signed in at the portal went from the
hinted link straight to the dashboard;
  - a plain visit still showed the realm login page;
- a hinted visit without a portal session went straight to the portal's
own login;
- API calls from the console worked, so the `Authorization` header
injection is intact.

### Screenshots

N/A — no console UI changes. The change removes the Keycloak login page
from the hinted flow.

### Downstream repositories

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

The diff touches only the dashboard gatekeeper templates and their
tests. It adds no value, schema, package or platform component. I walked
the trigger map against it, and no entry matches.

### Release note

```release-note
feat(dashboard): a dashboard login link can name the Keycloak identity provider with `/oauth2/start?kc_idp_hint=<alias>`, so users coming from a brokered portal skip the realm login page. The OIDC gatekeeper now runs oauth2-proxy from an alpha configuration kept in a ConfigMap; logins without the parameter are unchanged.
```


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

## Summary by CodeRabbit

* **New Features**
* OIDC-enabled clusters now use updated dashboard sign-in settings,
forwarding identity and token information to the dashboard.
* Authentication requests use Keycloak’s internal URL when configured;
otherwise, logout uses the public Keycloak URL.
  * Sign-in requests include the OpenID, email, and profile scopes.
* Supported identity-provider hints are preserved in sign-in redirects,
while invalid hints are excluded.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-20 17:05:43 +07:00
Andrei Kvapil e11ca91d81 fix(backups): stop leaking MariaDB dumps of stuck runs and torn-down namespaces (#5344)
## What this PR does

Closes #5291. Two paths left a MariaDB dump and its
`k8s.mariadb.com/Backup` behind after the dump cleanup from #5233.

**A run that never completes.** When the operator Backup stays short of
`Complete` past `mariadbDefaultBackupDeadline`, the BackupJob now
deletes it (background propagation, so its Job goes too) before it marks
itself `Failed`, and says so in the failure message. No Cozystack
`Backup` is ever made of such a run, so nothing else deleted it, and
while it stood its window had no end: `contestedMariaDBDump` counted it
as a possible writer of every later dump of the application, and every
later `Backup` was released with `ArtifactNotDeleted`. Deleting the Job
also stops a run that is still going from uploading a dump nobody
tracks. An operator Backup that is `Complete=True` on a reason the
driver does not know has a bounded window and is kept, as before.

The decision is made on the operator Backup read from the API server,
not the cache. A run the operator has just marked complete or failed
goes down the normal path and is not deleted. The delete carries the UID
and resourceVersion that were read, so a run that completes between the
read and the delete is not deleted either. Past the deadline no new run
is created, so a pass that deleted the run and then failed to persist
`Failed` does not start another one on retry. A delete the API server
keeps refusing shows as `Ready=False/OperatorBackupDeleteFailed` on the
BackupJob. The delete also removes the run's pod, so before it the
controller copies what held the pod up into the failure message: an
unschedulable pod, or a container that is waiting or has failed.

The MariaDB driver's other failure exits take the same path: the MariaDB
application was deleted, the MariaDB CR never came back, the strategy
disappeared past its deadline, the strategy no longer renders, the
applicationRef is rejected, or the run could not be created. Past the
deadline, the run is taken from the API server listing and
`ensureMariaDBBackup` is not called, so a cache that has not seen the
run cannot cause a second one to be created. mariadb-operator leaves the
run of a MariaDB that went away at `Complete=False` for good, so if the
application was later recreated under the same name, that run used to
contest every later dump.

The deadline is still 30 minutes from `StartedAt`, but a dump that is
still running at that point is now stopped instead of being left to
finish outside Cozystack.

**Namespace teardown.** mariadb-operator puts no finalizer on its
`Backup`, so during teardown it is usually gone before the Cozystack
`Backup` finalizer runs. When the operator Backup is not found, the
cleanup now:

- takes bucket, prefix and Secret references from the snapshot in
`status.underlyingResources`;
- goes on only for a recorded dump (`k8s.mariadb.com/dump-file`) on the
platform bucket written with the projected platform Secret, reached with
the platform credentials, which do not depend on the namespace;
- keeps the dump, with a `Warning ArtifactNotDeleted`, when another
operator Backup, finished or not, could have written it (the same
`contestedMariaDBDump` check as before);
- retries a failed delete through `retryMariaDBCleanup`, which releases
the `Backup` once the namespace is terminating.

The snapshot and the storage URI now record the storage the run was
created with, whatever its kind, rather than the strategy as rendered
when the run completed. A strategy edited during a run therefore cannot
send the cleanup to the wrong place. The BackupJob looks for its run on
the API server rather than in the cache, so a retry after a failed
status write never starts a second run. A `Running` BackupJob never
starts a run at all, and if its run is gone the job is failed.

A `Backup` with no recorded dump, no snapshot, a dump on another bucket
or written with the tenant's own Secret, or unreadable platform
credentials is released with a `Warning`, as before. A missing operator
CRD keeps the old release path.

The platform-bucket check that `mariadbCleanupConnection` used is now
`mariadbPlatformConnection`, shared by both paths. Its behaviour is
unchanged.

Not covered:
- Operator Backups left behind by BackupJobs that failed before this
change are still there, because terminal BackupJobs are not reconciled
again. Deleting them by hand releases the dumps they hold.
- Deleting a BackupJob that is still running leaves its operator Backup,
which has no ownerRef and no finalizer. This was already the case and is
not addressed here.
- The driver-independent terminal exits in `backupjob_controller.go`
(BackupClass resolution, credentials projection) still fail a BackupJob
without looking at a MariaDB run.
- A run that is stopped at the deadline after it has uploaded its dump
leaves that dump untracked. No `Backup` is ever made of such a run. The
other fail-safe cases listed in the issue (a `Restore` that never
completes, the single `Backup` worker, non-204 DELETE responses,
endpoint moves) are not addressed here.

Tests: `go test ./internal/backupcontroller/...`. The deadline outcome
table now also checks whether the operator Backup was deleted. New
cleanup tests cover a missing operator Backup: the dump deleted with the
platform credentials, already absent, contested by an unfinished run, a
failed delete held for retry, and each case it cannot reach (volume
storage, a recorded name that is not a dump, a snapshot of another
kind). Deadline tests cover a retry after a failed status write, a cache
that trails a completed run or misses a new one, a delete conditional on
the run that was read, a refused delete, and the application or MariaDB
going away mid-run.

### Screenshots

N/A, no UI changes.

### Downstream repositories

I checked the trigger map in `docs/agents/contributing.md` against the
diff. The diff touches `internal/backupcontroller/mariadbstrategy_*.go`
and their tests. It also adds a message helper in
`internal/backupcontroller/backupjob_controller.go` and changes comments
in `internal/backupcontroller/backup_controller.go` and
`packages/system/backupstrategy-controller/templates/rbac.yaml`. No
values, schemas, CRDs, RBAC rules, annotations or telemetry change.

- [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(backups): MariaDB dumps are no longer left in the bucket when a backup run never completes or when a tenant namespace is deleted. A BackupJob that times out now deletes the operator Backup it gave up on, so that run no longer blocks the deletion of later dumps. A Backup whose operator Backup is already gone now deletes its recorded dump from the platform bucket using the platform credentials. A MariaDB backup run that has not completed 30 minutes after its BackupJob started is now stopped.
```


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

## Summary by CodeRabbit

* **Bug Fixes**
* MariaDB backup cleanup now removes a recorded dump from the platform
bucket when its operator Backup is already gone, while leaving contested
or insufficiently verified dumps untouched.
* Failed dump deletions are retried, and cleanup reports when a dump is
already absent.
* Backup jobs are less likely to start duplicate runs during retries,
and completed backups retain the storage configuration used by their
run.
* Failure handling preserves completed runs and includes operator-run
completion details when available.
* Backup jobs now recheck the operator Backup before failing on a
deadline, helping account for runs that completed or failed in the
meantime.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-20 04:59:41 -05:00
Andrey Kolkov 65f0943710 fix(opensearch): disable the Base64 intrinsics hit by CVE-2026-114938
CVE-2026-114938 is an out-of-bounds write in the AVX-512 VBMI Base64
decoder of OpenJDK 17.0.6 and later, reachable on x86-64 hosts with
attacker-supplied Base64. OpenSearch decodes the Basic credentials of a
request before it authenticates it, so a tenant's cluster is exposed to
anyone who can reach its HTTP port.

Two of the three versions this chart offers bundle an affected JDK:
opensearchproject/opensearch:3.0.0 carries 21.0.7 and 2.11.1 carries
17.0.8. 1.3.20 carries 11.0.25, which is not affected. OpenSearch has
not released a build on a patched JDK yet.

Start the nodes with -XX:-UseBASE64Intrinsics, which removes the
vulnerable code path and leaves the other AVX-512 optimizations in
place. It is delivered as a jvm.options.d file mounted from a
ConfigMap, because neither obvious route works: bin/opensearch-env
unsets JAVA_TOOL_OPTIONS, and setting nodePools[].jvm makes the
operator stop sizing the heap from the memory request. The operator
mounts general.additionalVolumes into the node pools and the bootstrap
pod alike.

Rolling this out restarts every OpenSearch cluster once.

Tested with helm unittest, and by starting 3.0.0, 2.11.1 and 1.3.20
with the file mounted: each server JVM runs with the flag, and the heap
passed in OPENSEARCH_JAVA_OPTS still applies.

Assisted-by: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
2026-11-20 16:28:21 +07:00
Andrey Kolkov 0ec0add620 chore(keycloak): bump Keycloak server to 26.8.2
quay.io/keycloak/keycloak:26.6.3 bundles OpenJDK 21.0.11, which is
affected by CVE-2026-114938, an out-of-bounds write in the AVX-512 VBMI
Base64 decoder that Keycloak reaches before authentication. Upstream
fixed it by rebuilding the 26.8.2 image on OpenJDK 21.0.13.1 and did
not rebuild 26.6 or 26.7.

Pin the 26.8.2-3 tag: 26.8.2 moves when upstream rebuilds it, and
26.8.2-1 and 26.8.2-2 still carry the affected JDK.

keycloak-configure runs kcadm.sh from the same image and was still on
26.5.2; move it along so the admin client matches the server.

Tested by upgrading a two-replica 26.6.3 instance in place: the rolling
update migrated the database and both realms to 26.8.2, the old and the
new node shared one cluster while it ran, the keycloak-operator
reconciled every resource against the new Admin API, and the kcadm.sh
hook passed.

Assisted-by: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
2026-11-20 16:23:21 +07:00
Andrey Kolkov 7f31011b99 fix(backups): delete the Velero backup of a failed BackupJob (#5364)
<!-- 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 #5355

A BackupJob whose Velero backup ends `Failed` or `PartiallyFailed`
leaves that `backup.velero.io` object and its data in the backup bucket
(partial resources, logs) until Velero's TTL expires it, 720h by
default. No `Backup` is created for a failed run, and the `Backup`
finalizer was the only code that asked Velero to delete backup data;
deleting the BackupJob does not remove it either, because the Velero
backup is only labelled for the job, not owned by it.

The first commit requests deletion of the failed Velero backup through a
`DeleteBackupRequest`, and turns the reconcile of a `Failed` BackupJob,
which returned at once, into a sweep over the Velero backups still
labelled for the job. That sweep also cleans up backups leaked by
earlier versions after an upgrade. The request creation is shared with
the `Backup` finalizer and named after the Velero backup, so repeated
reconciles converge on one request. The failure message is unchanged.

The second commit narrows that sweep and makes it converge:

- Only `Failed`, `PartiallyFailed` and `FailedValidation` Velero backups
are deleted. A `Completed` one is never touched from a job-level
failure: a job can fail after Velero completed (creating or recording
the `Backup` failed), and that Velero backup may be the only copy of
good data.
- Deletion is requested only after `Failed` is persisted. The strategy
no longer sends the request inline, so a failed status write cannot
leave a retried run without the backup it reports the failure from. The
BackupJob watch has no predicate, so the `Failed` status update itself
triggers the sweep.
- While a failed backup still exists, the job is requeued every 5
minutes. Nothing watches `DeleteBackupRequest`, so this is how a request
Velero processed with errors is noticed and replaced. A backup that is
still running is rechecked every minute.
- Backups that reference the Velero backup are read through the uncached
API reader before anything is deleted.
- The ClusterRole of `backupstrategy-controller` gains `delete` on
`deletebackuprequests`, needed to replace a processed-with-errors
request. The `Backup` finalizer shares the helper, and without the verb
that path would fail with 403.

The third commit makes a deletion that Velero could not finish converge,
and makes it visible:

- A Velero backup in `Deleting` goes through the same request path.
Velero sets that phase before it removes the data and leaves it there
when removal fails, so skipping it left the data in place until the TTL.
- Our own request that Velero processed while the backup still exists is
replaced, whether it carries errors or not. The second case is a backup
that the BSL sync brought back.
- Each replacement emits a `VeleroBackupDeletionFailed` Warning event on
the BackupJob with Velero's `status.errors`, and doubles the wait before
the next replacement, 5 minutes up to 1 hour (enforced from the recorded
attempt time since the fourth commit). The count is kept in the
`backups.cozystack.io/velero-deletion-retries` annotation on the
BackupJob. A missing, read-only or unavailable BSL therefore shows up in
`kubectl describe` instead of being retried silently every 5 minutes.

The fourth commit makes the backoff binding rather than advisory:

- Each request the sweep creates records its time in the
`backups.cozystack.io/velero-deletion-attempted-at` annotation, next to
the retry counter. A request Velero has processed is replaced only once
the backoff for the current retry count has passed since that time.
Writing the annotations triggers a reconcile at once, because the
BackupJob watch has no predicate; that reconcile now only computes the
remaining wait. Before, with a BSL that fails instantly, it could
replace the request again right away.
- A request Velero has not processed yet, and a Velero backup still in
`New` or with no phase, are checked again after as long as they have
already waited: between 5 minutes (1 minute for a running backup) and 1
hour. Waiting emits no event.
- If the job was deleted before the annotations are written, the sweep
stops quietly. Any other error writing them is logged, and the computed
requeue is kept, because the request already exists.

Points for the reviewer:

- The sweep matches on the BackupJob labels, not on the strategy kind,
because a `Failed` job's BackupClass may be gone. The Kubernetes
strategy labels its Velero backup the same way and has the same leak on
failure, so a failed Kubernetes strategy run is cleaned up by the sweep
as well.
- The Velero strategy still treats a `FailedValidation` Velero backup as
in progress and requeues the BackupJob indefinitely. That is unchanged
here; the sweep already treats `FailedValidation` as deletable.
- After the upgrade, the Velero backups of BackupJobs that already
failed are deleted. An operator who wants one of them for a manual
`velero restore` must copy it first.

### 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 — no UI changes.

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

The diff touches Go code in `internal/backupcontroller/` and one chart
file, `packages/system/backupstrategy-controller/templates/rbac.yaml`,
which adds the `delete` verb on `deletebackuprequests` to the
controller's ClusterRole. Walked against the trigger map:

- website: no package, platform value, variant, component, release
asset, ApplicationDefinition, Talos or tooling change. The ClusterRole
is not documented there.
- terraform-provider-cozystack: no app, schema field, enum, default,
`kind`/`plural`, prefix, or `Package`/`Plan`/`RestoreJob` CRD change.
- ansible-cozystack, talm, examples: no installer value, namespace,
variant, platform value, node prerequisite, or object the role waits on.
- ccp, external-apps-example: nothing under `hack/`, no package layout,
`-rd` path, variant, `tags.yaml`, `ApplicationDefinition` CRD or
commit-convention change.
- cozyhr, cozy-proxy, cozystack-telemetry-server, community: none of
their annotations, labels, metrics, `hack/package.mk` targets, PR
template or commit convention change.

No entry applies.

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

### Release note

<!--  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(backups): a BackupJob whose Velero backup ends Failed, PartiallyFailed or FailedValidation now asks Velero to delete that backup and its data in the bucket, instead of leaving them until Velero's TTL expires. A Velero backup that completed is never deleted this way. If Velero cannot carry out the deletion (for example, the backup storage location is missing, read-only or unavailable), the BackupJob gets a `VeleroBackupDeletionFailed` Warning event with Velero's errors, and the deletion is retried at a growing interval of up to one hour. After upgrading, the Velero backups of BackupJobs that already failed are deleted as well; to keep one for a manual `velero restore`, copy it before the upgrade. The backupstrategy-controller ClusterRole gains `delete` on `deletebackuprequests`.
```
2026-11-20 01:07:55 +07:00
Aleksei Sviridkin c98a345aa1 docs(api): clarify health check parsing and evaluation (#4495)
## What this PR does

Clarifies the lifecycle of HelmRelease CEL health checks.

helm-controller parses and validates these expressions and creates a
status reader factory before choosing how to wait. The factory
constructs the concrete status reader when the selected wait path
creates its resource manager. Invalid configuration can therefore stall
the HelmRelease with reason InvalidCELExpression even when the
release.cozystack.io/helm-install-disable-wait annotation is set or the
legacy wait strategy is selected. Once setup succeeds, only
helm-controller's poller evaluates expressions: while a Helm action
waits under the poller strategy, and for Helm hooks, which are still
waited on when the annotation disables wait. Without the annotation, the
legacy strategy never evaluates them. With it, hooks are evaluated
whatever the strategy, because disabling wait takes precedence.

The monitoring template comment now also distinguishes an existing
status object without `updateStatus` from a completely absent top-level
`status` key. The former evaluates the predicates to false, while the
latter can produce an evaluation error and an Unknown result. The poller
continues waiting in both cases.

The CEL expressions and runtime behavior are unchanged. The generated
ApplicationDefinition CRD description was regenerated from the Go field
documentation.

Fixes #4388

### Screenshots

N/A — no UI changes.

### Downstream repositories

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

### Release note

```release-note
NONE
```

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

* **Documentation**
* Clarified when health-check expressions are validated and evaluated
across wait strategies and Helm hooks, including how invalid expressions
can affect Helm releases.
* Explained how missing status fields affect health-check results and
that polling continues until the resource is operational or times out.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-19 19:45:54 +03:00
Adham Kiwan 5c690f96bd docs(gateway): stop saying the route-hostname policy admits hostname-less routes
Since 1.7 cozystack-route-hostname-policy requires spec.hostnames to be
present and non-empty on HTTPRoute, TLSRoute and GRPCRoute in tenant-*
namespaces, so the edge-termination section no longer matches the
platform. The website builds its Gateway reference page from this
README, so the stale sentence would be published as is.

Refs: #4938
Assisted-by: LLM
Signed-off-by: Adham Kiwan <adhamkiwan@outlook.com>
2026-11-19 15:47:11 +02:00
Andrey Kolkov 887453c008 fix(backups): keep completed Velero backups of failed BackupJobs
The failed-job sweep treated a Completed Velero backup as deletable. A
BackupJob can fail after Velero completed, when creating or recording its
Backup fails transiently, and that Velero backup may be the only copy of a
good backup. The sweep now deletes only Failed, PartiallyFailed and
FailedValidation backups, also when several Velero backups reference one
job, and it reads the Backups that may reference them through the uncached
API reader, so a Backup the cache has not seen yet still protects its data.

The Velero strategy no longer requests the deletion before it records the
failure. If that status write failed, Velero removed the backup and the
retried run created a new one, so the failure was lost. The deletion now
comes only from the sweep, which runs on the reconcile that the persisted
Failed phase triggers; the BackupJob watch has no predicate that drops
status updates.

Replacing a request that Velero processed with errors deletes it, and the
backupstrategy-controller ClusterRole only allowed create, get, list and
watch on deletebackuprequests. That Delete failed with 403, and since the
Backup finalizer uses the same helper, a Backup deletion could get stuck
on it. The rule now includes delete.

Nothing watches DeleteBackupRequests, so the sweep did not run again after
Velero processed a request with errors. A Failed job now requeues every
5 minutes while a failed Velero backup of it remains, which replaces such a
request, and every minute while one is still running, instead of every 5
seconds.

Unit tests cover a rejected Failed status write, Completed, Deleting and
FailedValidation backups, a request processed with and without errors, the
UID precondition on the replacement, a Backup visible only to the uncached
reader, and API errors from the helper.

Refs: #5355
Assisted-by: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
2026-11-19 20:44:11 +07:00
Yan Bondarenko a314dacb86 fix(platform): honour a bool false in ingress-enabled and monitoring-enabled
Helm's default treats a bool false as empty, so an unquoted false in
either _cluster flag still rendered _namespace.ingress and the monitoring
redirects. Check for a missing key first and require "true" or a bool
true otherwise.

Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
2026-11-19 12:41:02 +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 693ff070e5 chore(goldpinger): bump vendored chart to 1.2.0 (#4877)
## What this PR does

Update the vendored Goldpinger chart to include upstream Gateway API
support for the work tracked in #4788. HTTPRoute and UDP probing remain
disabled by default.

With the package's current values, the rendered resources differ only in
the image tag and version labels. The DaemonSet selector is unchanged.
The umbrella chart also declares the vendored dependency so Helm can
lint it.

### Screenshots

Not applicable. This PR updates the chart and package metadata; it does
not change the UI source.

### Downstream repositories

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

### Release note

```release-note
chore(goldpinger): bump vendored chart to 1.2.0 (goldpinger 3.11.5); new HTTPRoute and UDP probe options are disabled by default
```
2026-11-18 14:42:27 +03:00
Aleksei Sviridkin 9813d13dcd fix(kamaji): drop kubelet config fields older tenants do not know (#4896)
## What this PR does

Older tenant Kubernetes versions receive kubelet config fields they do
not know. The pinned Kamaji 26.9.4-edge build uses the Kubernetes 1.37
libraries to render `kube-system/kubelet-config`:

| Field | Known since | Rendered for tenants |
| --- | --- | --- |
| `memoryReservationPolicy` | 1.36 | v1.31 to v1.35 |
| `mergeDefaultEvictionSettings` | 1.33 | v1.31 to v1.32 |
| `crashLoopBackOff` | 1.32 | v1.31, as `crashLoopBackOff: {}` |

On a v1.35 tenant, `kubeadm join` logs:

```text
configset.go:176 error unmarshaling configuration schema.GroupVersionKind{Group:"kubelet.config.k8s.io", Version:"v1beta1", Kind:"KubeletConfiguration"}: strict decoding error: unknown field "memoryReservationPolicy"
```

Nodes still join, because kubeadm only logs this and decodes leniently,
dropping the field. Anything that decodes this ConfigMap strictly fails.

The compatibility patch drops these fields when the tenant version
predates them, including fields added by a user JSON patch. Supported
fields are kept. The version checks conservatively treat a pre-release
as older than its minor; early alpha releases can lack that minor's
fields. A running tenant gets the cleaned ConfigMap the next time Kamaji
uploads it.

JSON removals cannot fully replace this on the current build: Kamaji
decodes patched JSON back into a Go struct, restoring a removed
`crashLoopBackOff` as `{}`. The kubernetes chart also does not render
`kubelet.configurationJSONPatches`.

Upstream fixed JSON patch removal in 26.10.4-edge (clastix/kamaji#1347).
With that bump, the chart can render version-dependent removals and
replace this compatibility patch. This PR keeps the fix for 26.9.4-edge.

The regression tests cover field presence for tenants v1.31 to v1.37,
selected pre-releases, user patches, invalid versions, defaults and
`UploadKubeletConfig` with a fake client. The image build runs the tests
of packages touched by its patches.

Tested on Linux:

- Against upstream Kamaji commit
`1c3d84ae94473e94945ad01b2540ec319478bce4`, the new tests fail with the
current main patch in the three compatibility tests. With this patch,
the Go tests in every package touched by the patches pass, and the
Kamaji build succeeds.
- The repository unit lane passes.

I did not run a strict-decoding matrix against each Kubernetes minor for
this version.

### Screenshots

Not a UI change.

### Downstream repositories

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

### Release note

```release-note
fix(kamaji): stop writing kubelet config fields that older tenant Kubernetes versions do not know, such as memoryReservationPolicy on tenants before v1.36, so strict decoders of the kubelet-config ConfigMap no longer fail.
```
2026-11-18 14:42:20 +03:00
Aleksei Sviridkin 1d64d077e3 Merge branch 'main' into issue-4388
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-18 13:38:20 +03:00
Aleksei Sviridkin fd426c7e4b build(monitoring): respin the Alerta image on a patched base (#5334)
Supersedes #5244 and #5333: the same change from an in-tree branch, so
CI can build the new image. Includes main merged in and the test fixture
fix from #5333.

## What this PR does

Alerta 9.1.0 is the latest upstream release, and
`alerta/alerta-web:9.1.0` still ships the Debian packages of its build
day, the compiler toolchain and `-dev` headers it built wheels with, and
Python packages whose fixes landed after the release. The monitoring
chart ran that image by tag, without a digest.

This builds the Alerta image in-tree from the upstream one:

- `images/alerta/Containerfile` starts from `alerta/alerta-web:9.1.0`
pinned by its index digest, upgrades the OS packages, purges the
build-only packages and lifts the affected Python packages within the
ranges the installed packages declare (`pip check` gates the build).
`cryptography` stays below 47 because `pyOpenSSL` requires it; `lxml`
stays on 5.x.
- The result is copied into an empty image so the purged files are
really gone, and the upstream image config (env, user, ports,
entrypoint, command) is restated exactly; `docker-entrypoint.sh` renders
the nginx, uWSGI and Alerta configs from those variables. The image is
752 MB against 1.32 GB upstream; a purge layer on top would have made it
1.78 GB.
- `make image` builds it as `alerta:v9.1.0-cozystack.0` and writes the
digest into `alerta.image`, like the traces collector. Until then the
default is the digest-pinned upstream image.
- The Deployment takes the image from `alerta.image` through
`cozy-lib.image`, so mirrored-registry installs work for Alerta as they
do for Grafana.

Trade-off: `apt-get upgrade` takes whatever Debian has at build time, so
two builds of one revision can differ. That is what a respin is for;
bump `ALERTA_COZYSTACK_REV` to publish a fresh one.

Testing (podman, amd64):

- With `postgres:17-alpine` and the chart's env, Alertmanager v4
webhooks to `/api/webhooks/prometheus`: firing critical → 201 and the
alert open; `event=Heartbeat` → 202 and the heartbeat recorded; resolved
→ 201 and the alert closed. Admin login 200, UI 200, no ERROR in the
logs, and `alerta_telegram`, `alerta_slack`, `alerta_prometheus` import.
Upstream 9.1.0 gives the same results with the same script.
- `trivy rootfs`, CRITICAL and HIGH: 29/940 → 3/76. The three critical
left (sqlite CVE-2025-7458, libxml2 CVE-2026-6653, zlib CVE-2023-45853)
and every remaining Debian HIGH have no Debian 12 fix; the remaining
Python HIGH are cryptography and lxml, held back as above.
- `helm unittest .` (306 tests, including the new
`tests/alerta_image_test.yaml`) and `helm template`.
- arm64 was not built locally; aarch64 cp313 wheels exist for every
upgraded Python package, so the purged toolchain is not needed there.

### Screenshots

No UI changes.

### Downstream repositories

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

(Trigger map walked against the diff: only packages/system/monitoring —
an image build, a values key with no schema, a template line and a test.
No apps/extra package, schema, platform value, hack tooling or CRD
changes.)

### Release note

```release-note
build(monitoring): Alerta now runs a cozystack respin of 9.1.0 on an upgraded Debian base, without the build toolchain and with patched Python dependencies; its image is pinned by digest and follows the cluster images registry.
```


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

## Summary by CodeRabbit

* **Updates**
  * Alerta now runs from a pinned, refreshed container image.
* The Alerta image can be configured, and deployments respect the
configured image registry.
* The default image is replaced with the Cozystack-built image when
using the image build workflow.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-18 13:28:26 +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 8a0c406e15 Merge branch 'main' into fix/kubernetes-coredns-cilium-deadlock
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-18 11:57:13 +03:00
Andrey Kolkov 7145a67568 fix(backups): stop leaking MariaDB dumps of stuck runs and torn-down namespaces
A k8s.mariadb.com/Backup the BackupJob gave up on stayed for good: no
Backup is made of such a run, so nothing deleted it, and while it stood
short of Complete the dump cleanup counted its open window as a possible
writer of every later dump of the application and kept each of them.

Every failure exit of a started BackupJob in the MariaDB driver now goes
through failMariaDBBackupJob: the deadline, the application, MariaDB CR
or strategy going away, a run the operator failed at Complete=False, and
a run that could not be created. It lists the job's runs on the API
server, where the cache can trail a run created or completed a moment
ago, and deletes each one short of Complete under the UID and
resourceVersion it read, so a run that completes in between is handed
to the success path instead. Deleting the run takes its Job and pod, so
what held the pod up is first copied into the failure message. A
Running or expired job takes its run from that listing and never starts
another, so a retry after a failed status write cannot start a second.

During namespace teardown the operator Backup, which carries no
finalizer, is usually gone before the Backup finalizer runs, and the
cleanup, which read the storage from it, left the dump behind. A Backup
that recorded its dump on the platform bucket now has it deleted with
the platform credentials, which do not go with the namespace, reading
the storage from the snapshot in status.underlyingResources; the dump is
still kept when another run could have written it. The snapshot and the
storage URI now record the storage the run was created with rather than
the strategy as rendered at completion, which a strategy edited during
the run would otherwise send the cleanup away from.

Closes: #5291
Assisted-by: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
2026-11-18 14:08:00 +07:00
Aleksei Sviridkin 045f1a9bbc fix(seaweedfs): remove identities left behind by deleted BucketAccesses
Since SeaweedFS 4.08 the S3 gateways move every identity from
/etc/iam/identity.json into /etc/iam/identities/<name>.json, and the
COSI driver up to v0.3.1 revokes only from identity.json. Every
BucketAccess deleted on such a filer left its identity file behind,
with its keys still accepted (seaweedfs/seaweedfs-cosi-driver#11). A
driver that deletes the file on revoke does nothing for the files
already left.

A post-install/post-upgrade hook removes a ba-<uid>.json file when no
BucketAccess in any namespace names it, by uid or by
status.accountID. The uid covers a BucketAccess still being granted,
the accountID one restored with its status. The identity directory is
listed before the BucketAccesses: a BucketAccess exists before its
grant writes a file, so a file seen in the first listing whose
BucketAccess still exists is always named by the second. File ages are
not used, because grants and gateway migrations rewrite left-over
files as well. A failed or empty listing removes nothing. Each removal
is logged and recorded as an Event on the HelmRelease. The hook runs
before the Object Lock hook, so in delete mode a left-over identity is
removed before that hook grants it anything.

A filer published for Client-topology clusters holds identities whose
BucketAccesses live in those clusters, so cosi.orphanIdentities
defaults to auto: report there, delete otherwise. An operator can
force either.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-17 22:07:25 +03:00
Aleksei Sviridkin b7ec3f73a1 test(monitoring): keep a non-first-party ref in the Alerta image test
A ghcr.io/cozystack/cozystack ref in a helm-unittest fixture counts as
a first-party image ref, so the image-ref enumeration contracts in
hack/promote-rewrite-tags_test.bats require its file to be declared.
The test only needs some image string to pass through cozy-lib.image,
so a placeholder registry keeps it out of the release tooling.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-17 18:09:25 +01:00
Aleksei Sviridkin 33d0001991 Merge branch 'main' into feat/monitoring-alerta-respin
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-17 18:09:25 +01:00
Marian Koreniukandeuroprinter 75df8174df build(monitoring): respin the Alerta image on a patched base
Alerta 9.1.0 is the latest upstream release, and alerta/alerta-web:9.1.0
still carries the Debian packages of its build day, the compiler
toolchain and -dev headers it built its wheels with, and Python
packages whose fixes came out after the release. The monitoring stack
ran that image unpinned.

A purge in a layer on top of the upstream image would leave the files
in the lower layers, so the result is flattened into an empty image
and the upstream image config is restated. cryptography stays below 47
because pyOpenSSL requires it, and lxml stays on 5.x.

Assisted-by: LLM
Signed-off-by: Marian Koreniuk <moriarti@cp.if.ua>
Co-authored-by: europrinter <yanshinjuku@gmail.com>
2026-11-17 18:09:25 +01:00
Aleksei Sviridkin c49f58c4a4 fix(seaweedfs): keep Object Lock working for COSI credentials on SeaweedFS 4.48 (#4893)
## What this PR does

Existing bucket credentials need additional Object Lock actions to work
with SeaweedFS 4.48. Since v0.4.0 (#5284), the upstream COSI driver
grants them to new credentials. It does not grant access again for a
ready BucketAccess, so older identities stay unchanged after the driver
update. The custom COSI driver build and its image repository are no
longer part of this PR.

This PR adds a post-install and post-upgrade hook that grants the
actions implied by each identity's Read and Write permissions. Bucket
restrictions and credentials stay unchanged, and Write does not grant
governance bypass. The `anonymous` identity that public-read buckets
share is skipped on purpose. The driver revokes public read by removing
only `Read:<bucket>`, so added Object Lock reads would stay open to
unsigned requests. The hook runs after the release update and does not
guarantee Object Lock access during a server rollout.

The wrapper chart also declares its local dependency so Helm lint can
check it. The chart remains on 4.45. #4879 is stacked on this PR for the
4.48 upgrade.

The hook's bats suite (22 cases), the chart tests and shellcheck pass
locally on 65708a81b8. The Linux unit lane and E2E are pending. Live
cluster validation has not been run.

Known hook limitations remain tracked in #4894. A pod that never starts
can still fail the Helm action. Deletion between the dry run and apply
can leave a keyless identity. Warning Events expire, and the Job stays
behind for its logs.

### Screenshots

Not a UI change.

### Downstream repositories

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

### Release note

```release-note
fix(seaweedfs): grant existing bucket credentials the Object Lock actions required by SeaweedFS 4.48 on install and upgrade, preserving their bucket restrictions and credentials.
```
2026-11-17 18:05:41 +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 d99e960c00 feat(platform): package address-controller and its MetalLB driver (#3382)
## What this PR does

Adds IP addresses as a first-class resource
([cozystack/community#35](https://github.com/cozystack/community/pull/35))
as two optional system packages, off by default and enabled through
`bundles.enabledPackages`:

- **`cozystack.address-controller`** — the class-agnostic core
([cozystack/address-controller](https://github.com/cozystack/address-controller)):
`IPAddressClass` / `IPAddress` / `IPAddressClaim` in
`local.sdn.cozystack.io`, the PVC/PV-binding analog. It owns
claim–address binding, status and reclaim, and never allocates anything
itself.
- **`cozystack.metallb-iad`** — the per-class driver for addresses
announced by MetalLB
([cozystack/metallb-iad](https://github.com/cozystack/metallb-iad)). A
class names an existing `IPAddressPool` with `autoAssign: false` in
`cozy-metallb`, which the admin provisions together with its
advertisement. The driver holds reservations as placeholder Services in
its own namespace, and attaches an address to a Service that names a
claim with the `local.sdn.cozystack.io/ip-address-claim` annotation.

### Packaging

Both are ordinary wrapper packages under `packages/system/`, sourced
from the `cozystack-packages` artifact like every other package. The
upstream chart is vendored verbatim under `charts/` by `make update` at
a pinned commit, since neither project publishes a chart artifact: the
`v0.2.0` release-preparation commits of
[cozystack/address-controller#17](https://github.com/cozystack/address-controller/pull/17)
and
[cozystack/metallb-iad#11](https://github.com/cozystack/metallb-iad/pull/11).
Each controller image is pinned by digest to a `main-<sha>` build
carrying the same controller code: `address-controller:main-90e65ca`,
whose commit differs from #17 only in chart version and docs, and
`metallb-iad:main-1faf937`, whose commit differs from #11 only in chart
version and the address-controller module pin, a purely additive API
change the driver does not use. The pins move to the `v0.2.0` tags and
images once both are released. The images live under
`ghcr.io/cozystack/<name>`, outside the `ghcr.io/cozystack/cozystack/`
repositories the release tooling owns, so promotion and the nightly
mirror pass over them. The core installs its v1alpha1 CRDs with
`upgradeCRDs: CreateReplace`.

### What the wrappers add

- **Tenant access.** The upstream chart is Cozystack-agnostic and grants
only the controller itself. `cozy:addresses`, `cozy:addresses:view` and
`cozy:addresses:admin` aggregate into `cozy:tenant`, `cozy:tenant:view`
and `cozy:tenant:admin` respectively, so a tenant can manage
`IPAddressClaim`s in its own namespace, and the grant exists only while
the package is installed. The cluster-scoped `IPAddress` and
`IPAddressClass` are not granted: `cozy:tenant*` reaches a tenant
through a per-namespace RoleBinding, so a rule for either would never be
consulted. A tenant reads its address from the claim's
`status.addresses[]`.
- **The driver's admission policy, turned on for tenant namespaces.**
MetalLB honours a pin or pool selector from any writer of a Service: the
`metallb.io/` annotations, their `metallb.universe.tf/` predecessors and
`spec.loadBalancerIP`. A tenant cluster's cloud provider copies a guest
Service's annotations and `loadBalancerIP` onto the Service it creates
in the tenant namespace. The upstream `metallb-iad-service-pins` policy
reserves all of these, plus the sharing annotation, to the driver's
ServiceAccount and the cluster-admin groups. An admission policy binds
every principal regardless of RBAC, so the wrapper adds
`cozystack-cluster-admin`, the group Cozystack's OIDC administrators
authenticate as, to the chart's `system:masters` and
`kubeadm:cluster-admins`. The wrapper enables it in `Deny` mode for
namespaces carrying `namespace.cozystack.io/host`, which `tenant-root`
and every tenant namespace have and nothing in `cozy-*` does. Unchanged
values always pass, so the driver's pin on a tenant's own Service does
not lock the rest of that Service.
- **The driver's MetalLB namespace**, `cozy-metallb` instead of the
upstream default `metallb-system`.

### Variant scoping

`cozystack.metallb-iad` depends on `cozystack.address-controller`, which
is opt-in, and on `cozystack.metallb`, which is absent on `isp-hosted`,
on a slim variant that did not opt into it, and wherever
`disabledPackages` names it. The driver is emitted from the
`common-packages` helper only when the includes of MetalLB and of
`cozystack.address-controller` both rendered a Package, so it cannot be
enabled where it would sit in `DependenciesNotReady` forever, and it
follows either dependency automatically if its rules change. The core
carries no MetalLB dependency and remains available everywhere.

### Validation

`helm unittest` covers the aggregation labels and rules on the tenant
roles and the driver's emission, which requires both MetalLB and the
address core. `hack/select-install.sh --validate` passes, and the
selective-install fixture is regenerated from `hack/select-install.sh
--disabled postgres`. The admission policy is upstream's and carries no
render test here.

### Screenshots

Not a UI change.

### Downstream repositories

- [ ] No downstream repository is affected by this change
- [x] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
[cozystack/website#810](https://github.com/cozystack/website/pull/810)
(component cards),
[cozystack/website#811](https://github.com/cozystack/website/pull/811)
(operator guide)
- [ ]
[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 website is the one repository this change reaches:
[cozystack/website#810](https://github.com/cozystack/website/pull/810)
adds the two new platform components to
`guides/platform-stack/_index.md` and
`operations/configuration/licenses.md`, and
[cozystack/website#811](https://github.com/cozystack/website/pull/811)
adds an operator guide under `networking/`. The guide restates both
image refs, so a repin here needs the same edit there.

### Release note

```release-note
feat(platform): add IP addresses as a first-class resource as two optional system packages, `cozystack.address-controller` (IPAddressClass / IPAddress / IPAddressClaim) and its MetalLB driver `cozystack.metallb-iad`. Tenants can reserve an address with an IPAddressClaim. A LoadBalancer Service a tenant Kubernetes cluster creates can name that claim with the `local.sdn.cozystack.io/ip-address-claim` annotation, or draw one through auto-claim once an admin marks an auto-claim class. An admission policy reserves MetalLB's pool, pin and sharing inputs on tenant Services to the driver. The driver is only emitted where MetalLB and the address core are.
```




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

## Summary by CodeRabbit

* **New Features**
* Added address management for requesting and tracking IPv4, IPv6, or
dual-stack addresses, with configurable address classes and lifecycle
status.
* Added the MetalLB IAD driver for address provisioning through MetalLB.
It is included only when the required MetalLB and address-management
components are enabled.
* Added optional admission controls for address claims and protected
MetalLB service settings.
* Added optional address-controller metrics, monitoring, and alerting
resources.
  * Added tenant access roles for viewing and managing address claims.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-17 15:15:03 +03:00
Aleksei Sviridkin a48a2f2599 fix(backups): restore Kafka 3.x topic configs that Kafka 4 rejects
Every Kafka now runs 4.x, and a topic-metadata backup taken on Kafka
3.8 or 3.9 can record message.format.version,
message.downconversion.enable or message.timestamp.difference.max.ms,
which Kafka 4 removed, or a segment.bytes below 1 MiB, the minimum
Kafka 4 raised it to from 14 bytes. A 4.x broker rejects each of them,
so the restore stopped at the first one, leaving that topic
half-configured and every later topic unrestored, and a rerun failed
on the same line.

The restore now skips the removed keys and raises a smaller
segment.bytes to the minimum, each with a warning, and applies the
rest. segment.bytes is read the way Kafka reads it: trimmed, with an
optional sign, leading zeros decimal.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-17 12:22:56 +03:00
Aleksei Sviridkin 0729a6f691 feat(platform): block the platform upgrade while a Kafka lacks KRaft
Only the isp-* variants run the platform migration hook, so on the
default variant nothing checked the Kafka clusters before the new
kafka-operator chart arrived. helm-controller replaces that chart's
CRDs before Helm runs its pre-upgrade hooks, so a guard in the operator
chart would come too late.

The platform chart now refuses to render the cozystack-packages source
while Strimzi still serves v1beta2 and any Kafka lacks KRaft evidence,
with the same evidence rule as migration 61. The check stops once only
the v1 API is served, so a NotReady tenant Kafka cannot block platform
reconciles after the upgrade.

Without the migration hook the chart also refuses while any Strimzi CRD
still stores v1beta2: the API server would reject the v1-only CRDs of
Strimzi 1.2, and the new kafka chart rejects the Kafka 3.x versions that
the migration moves. With the hook the check would block the migration
that narrows the stored versions in the same upgrade.

While v1beta2 is served the chart also refuses while a Kafka
application sets a topic config Kafka 4 removed or a segment.bytes
below the 1 MiB minimum of Kafka 4. The new kafka chart refuses to
render such a topic, which would leave that application on its
pre-upgrade spec, and a Kafka 4 broker whose log holds the small
segment.bytes does not start. segment.bytes is read the way Kafka
reads it: trimmed, with an optional sign, leading zeros decimal.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-17 12:22:56 +03:00
Aleksei Sviridkin 4c71273ca8 chore(kafka): declare bundled chart dependencies
Helm requires bundled subcharts to be declared for chart validation.
Keep their source local so validation uses the vendored versions.
The application icon remains supplied by the generated dashboard metadata.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-17 12:22:55 +03:00
Aleksei Sviridkin f293d64e84 fix(kafka): delete the release's StrimziPodSets on uninstall
On a cluster upgraded from Strimzi 0.x, deleting a Kafka application
leaves its brokers running. kube-controller-manager's garbage collector
first saw the StrimziPodSets under v1beta2 and never updates that
record, so once v1beta2 is no longer served it retries them forever
instead of deleting them, until kube-controller-manager restarts
(kubernetes/kubernetes#102641).

The pre-delete hook now deletes the release's StrimziPodSets after its
node pools, so uninstall no longer depends on garbage collection for
the brokers. An absent CRD is not a failure; any other error fails the
hook like the pool delete does, because Helm never runs it for the
release again.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-17 12:22:55 +03:00
Aleksei Sviridkin a909b733ea chore(kafka, kafka-operator): drop the JVM sizing workaround
The workaround passed MaxRAM and ActiveProcessorCount to every Strimzi
JVM because the JDK 17 in the 0.45 images could not see the container
limits on kernels without CONFIG_MEMCG_V1 (JDK-8347811). The Strimzi
1.2.0 images ship JDK 21.0.12, which carries the fix. On such a kernel,
with a 1Gi limit, Strimzi's heap probe in the Kafka image now
estimates a 495M maximum heap, where the 0.45.1-rc1 image estimated
13.9G.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-17 12:22:54 +03:00
Aleksei Sviridkin 641faa7fde build(kafka-operator): vendor Strimzi 1.2.0
Strimzi 0.45 is out of upstream support. Strimzi 1.x serves only the
v1 API, so the release now replaces the CRDs on upgrade;
helm-controller's default of skipping CRD upgrades would leave the
v1beta2-only CRDs from the first install in place. Strimzi 1.x runs no
ZooKeeper, so the ZooKeeper alert group goes too.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-17 12:22:54 +03:00