Commit Graph
8442 Commits
Author SHA1 Message Date
IvanHunters 66cf74f4cb fix(credentials): reject reserved keys in secretLabels
An ApplicationDefinition's credentials.secretLabels is copied over the account marker and the application identity labels, which store.List, store.Prune and the Credential view select the account Secrets by, so a block setting one of those keys would silently make its Secrets unreachable. Validate now refuses such a block.

Assisted-by: LLM
Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
2026-11-17 20:27:41 +03:00
IvanHunters c834848043 fix(monitoring-agents): render extraOutputs through tpl
A SIEM output added to extraOutputs is spliced into config.outputs, which the ConfigMap renders with tpl once, so a template expression inside the appended value, such as the Release.Namespace that the comment's own example uses, reached fluent-bit.conf verbatim and the destination resolved to a literal. Render the value with tpl and the subchart root so the documented expressions resolve.

Assisted-by: LLM
Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
2026-11-17 20:27:41 +03:00
IvanHunters e88d9085b2 fix(apps): keep a racing create's winning Secret on cleanup
Two concurrent creates of one application could leave it with no account Secret. The create that lost the race cleaned up the Secret by name, but ownership of an application's credentials follows its HelmRelease, not a Secret's identity: the winning release can replace or adopt the very Secret the loser seeded, so neither an owner-reference check nor a UID identity check tells the loser's Secret from the winner's. The cleanup now deletes nothing once a HelmRelease for the application exists, which it provably does by the time a create fails with AlreadyExists, and otherwise deletes only the exact object it seeded. Ensure returns the UID it gave each seeded Secret for that last check.

Assisted-by: LLM
Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
2026-11-17 20:27:41 +03:00
Timofei Larkin b26c4ed373 fix(monitoring-agents): indent extra outputs like the rest
The extra outputs were indented again after the block scalar had been dedented, six columns deeper than the VictoriaLogs outputs, and fluent-bit refuses a config whose indentation is inconsistent, which stops every output, not only the added one. The test now pins the indent instead of matching any whitespace.

The credentials and apps defaulting packages join the unit-test target, so their tests run in CI, and the audit-log page names the field the pipeline writes.

Assisted-by: LLM
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
2026-11-17 16:14:48 +03:00
Timofei Larkin 19d183a1d1 fix(api): keep account Secrets of live apps intact
Three ordinary writes replaced or removed account Secrets. A duplicate
create seeded before learning the release existed, so it replaced the
live application's Secrets and then removed its own. Server dry-run
wrote and pruned for real, and a dry-run mint replaced the password.
An update seeded every declared account without a Secret, which after
the conversion swaps a working password for a discarded one.

A create now stops on an existing release before touching a Secret,
and replaces any leftover at an account's name unless a live release
owns it, so the new account always gets a fresh identity and an owner.
Dry-run writes nothing anywhere. An update seeds only the accounts it
adds. A mint requires a declared account even where the Secret
exists, and the write paths read through the uncached client, since a
stale read here is a replaced or recreated Secret.

Assisted-by: LLM
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2026-11-17 12:07:14 +03:00
Timofei Larkin c96b91f67a docs(api): cut comments to what the code cannot say
Comments carry the mechanism, not the rationale; every argument removed
here is in the design proposal or the PR. Where one claim appeared at
several sites, the copy at the site that constrains the code stays.

Assisted-by: LLM
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2026-11-17 12:07:14 +03:00
Timofei Larkin 5b86018cb0 docs(api): say why two password formats hash without a salt
CodeQL flags the SHA-1 and SHA-256 of a password as weak hashing of
sensitive data. Both are the forms the engines store and check against
and accept in no other form, and the design relies on the 32-character
random password rather than on the digest for strength, so the alerts
are dismissed with that reason and the code says it where the hashing
happens.

Assisted-by: LLM
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2026-11-17 12:07:14 +03:00
Timofei Larkin ae29f07a13 feat(api): serve credentials with mint and revoke, and seed accounts
The Credential view lists the account Secrets of the namespace by label
and skips any no live HelmRelease owns, so no kind is served until its
definition carries a credentials block. A mint replaces the stored value
in one conditional write keyed on the Secret's resourceVersion and
returns the plaintext once; a revoke discards it. Both record an Event
on the application, which needs create on events.

The application registry seeds an account Secret per declared account
before it writes the HelmRelease, so the chart can reference them from
the first render, prunes the Secrets of removed accounts after the
write, and refuses to delete an application whose release is suspended,
since Flux skips the uninstall and would leave the database running
with the Secrets gone. The ApplicationDefinition reconciler computes
the per-account valuesFrom entries with the function the API uses, so a
release that predates the block gets them on its next reconcile. Schema
defaulting moves to a package both can import.

A definition declaring a format or an account source that is not built
leaves its kind unserved rather than served with passwords the API
cannot issue. Tenant roles gain get and list on credentials at view and
create on mint and revoke at admin and for the tenant ServiceAccount.
Attribution comes from the kube-apiserver audit log, so the operations
docs get a policy for distributions that ship none, and
monitoring-agents a value for an extra fluent-bit output so a SIEM can
receive the log without dropping the VictoriaLogs outputs.

Assisted-by: LLM
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2026-11-17 12:07:14 +03:00
Timofei Larkin e0d90ab12c feat(api): add Credential kinds and the credentials block
Cozystack generates managed application passwords at Helm render time
and keeps them in a Secret tenants can read again at any time, which a
deployment whose policy requires a credential shown once cannot accept.
The accepted design moves generation into the API: an
ApplicationDefinition declares its accounts and the stored form of a
password in a credentials block, and each account gets a
core.cozystack.io Credential whose mint and revoke subresources take a
TokenRequest-shaped CredentialRequest.

This adds the types, the built-in password formats, which the migration
CLI shares so a converted release and a mint store the same form, and
the account helpers that name the Secrets and read their record.

Design: https://github.com/cozystack/community/blob/main/design-proposals/user-secrets-api/README.md

Assisted-by: LLM
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2026-11-17 11:09:29 +03:00
Aleksei Sviridkin 060686cbc0 fix(cozy-lib): render tenant hugepages quota only as requests (#5189)
## What this PR does

A tenant with `hugepages-2Mi` or `hugepages-1Gi` in `resourceQuotas`
gets both `requests.hugepages-<size>` and `limits.hugepages-<size>` in
`tenant-quota`. Kubernetes accepts huge pages in a ResourceQuota only as
`hugepages-<size>` or `requests.hugepages-<size>`
([`IsStandardQuotaResourceName`](https://github.com/kubernetes/kubernetes/blob/v1.34.1/pkg/apis/core/helper/helpers.go#L245)),
so the apiserver rejects `tenant-quota` and the tenant release fails to
install or upgrade. Huge pages are not counted in `limits.memory`
either, so today a VM whose memory is backed by huge pages runs outside
the tenant quota with no way to bound it.

`cozy-lib.resources.flattenResource` now drops the limits side for
`hugepages-*`, the same way it already does for `storage`, so the quota
carries only `requests.hugepages-<size>`. Both page sizes go through the
same rule. `sanitize` is unchanged: a pod spec still needs equal
requests and limits for huge pages.

`helm unittest .` passes 69 of 69 in `packages/tests/cozy-lib-tests` and
78 of 78 in `packages/apps/tenant`. The new case fails on `main` on both
`limits.hugepages-*` keys. Admission reads hugepages usage from
`requests.*` after #5184, which matches what this renders.

### Screenshots

Not a UI change.

### Downstream repositories

Template change in `cozy-lib`, one new test case and one line in the
hand-written part of `packages/apps/tenant/README.md`. No values key,
schema or default changes. The website tenant reference page is
regenerated from that README on release, so no trigger map entry needs a
manual follow-up.

- [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(cozy-lib): a tenant quota with hugepages-2Mi or hugepages-1Gi now renders only requests.hugepages-<size>, so the tenant installs and its huge pages are bounded.
```


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

## Summary by CodeRabbit

* **Bug Fixes**
* Huge-page quotas now apply only to requests, avoiding unsupported
limit entries in Kubernetes resource quotas. Quota entries for 2 MiB and
1 GiB huge pages are retained as requests, while corresponding limit
entries are omitted.
* **Documentation**
* Clarified that 2 MiB and 1 GiB huge-page resources are represented as
requests in resource quotas, not limits, because Kubernetes does not
support huge-page limits quotas.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-16 22:05:56 +03:00
Aleksei Sviridkin ecca3b2af5 feat(kubernetes): configure per-pool Talos sysctls (#5254)
<!-- 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 an optional `KubernetesNodes.spec.talos.sysctls` string map,
rendered into `machine.sysctls` on that pool's guest workers. This lets
operators configure the user namespaces needed by the Talos gVisor
extension without adding a dedicated API field for each future sysctl.

Replaces the proposal in #4650, following [the suggestion to expose a
general sysctl
map](https://github.com/cozystack/cozystack/pull/4650#issuecomment-6743092045).
This is a new branch from `main`, not a stack on the original PR. The
suggestion is not treated as maintainer consensus on the broader API.

```yaml
spec:
  talos:
    sysctls:
      user.max_user_namespaces: "11255"
```

- Empty or omitted maps preserve the existing rendered machine
configuration and bootstrap hash. A literal `"0"` is an explicit
override; remove the entry to restore the Talos default.
- The existing content-hashed TalosConfigTemplate mechanism updates the
MachineDeployment bootstrap reference when overrides change. No new
rollout mechanism is introduced.
- Both keys and values are YAML-quoted, then shell-escaped for
backslashes, dollars and backticks before entering the unquoted
reconcile Job heredoc. Quoting scalars individually also keeps newlines
and Unicode line separators from breaking the surrounding YAML or
heredoc delimiter.
- Both the generated schema and a render-time guard enforce string
values. The template guard is tested with schema validation disabled
too.
- Regenerates the schema, parameter reference, Go API type/deepcopy and
ApplicationDefinition. The README table alignment change is generator
output.

This changes only the selected pool's guest configuration, not the
management hosts, control plane or other pools. Supported sysctls and
their semantics remain Talos/kernel-dependent; inappropriate settings
can weaken guest isolation or prevent boot. Installing the gVisor
extension, configuring its RuntimeClass and enforcing workload/network
restrictions remain separate steps.

### Validation

- `helm unittest packages/apps/kubernetes-nodes`: 40 suites, 245 tests
and 12 existing snapshots passed, without updating snapshots.
- `bats hack/check-talosconfigtemplate-name-agreement.bats
hack/talos-reconcile-heredoc_test.bats`: all 16 tests passed (5
name-agreement and 11 heredoc tests). Covers Job/Role/MachineDeployment
name agreement, changed and restored hashes, explicit zero, schema and
template type rejection, invalid UTF-8 file inputs, and a literal
round-trip through the actual manifest-producing heredoc under Bash and
Dash. Hostile keys/values include command substitutions, backticks,
variable references, backslashes, quotes, newlines and Unicode
separators; no marker command executes, and runtime placeholders still
expand. The UTF-8 regression was observed failing before the fix with
schema validation disabled; valid Unicode including U+FFFD remains
accepted.
- `bats hack/bats-no-exit-trap.bats hack/bats-no-negated-assert.bats`:
all 32 tests passed.
- Package `make generate` with cozyvalues-gen v1.7.0 and root `make
generate`: repeat runs are idempotent. Root `make manifests` passed.
- `go test ./kubernetesnodes` and `go vet ./kubernetesnodes` in
`api/apps/v1alpha1` passed; the generated API package has no test files.

No live cluster rollout or gVisor execution was tested for this PR.
`make show` could not run because `cozyhr` is unavailable locally;
offline chart rendering is exercised by the Helm and BATS tests above.
Worker replacement and rollback still need staging validation. This
main-branch change is not drop-in support for the release-1.6 nodeGroups
API.

### 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) - the
existing `K8S_NODES` reference imports this package's generated README
at release; no manual docs contract changes.
- [x]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
https://github.com/cozystack/terraform-provider-cozystack/issues/72;
adapt the existing follow-up to the general `talos.sysctls` map after
the upstream API is accepted, rather than implementing the superseded
dedicated field.
- [ ]
[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 other trigger-map entries are unaffected: no management-node
prerequisite, package name, controller contract, tooling, image or
release convention changes. No downstream implementation or live
deployment is included.

### 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(kubernetes): add an optional per-pool KubernetesNodes talos.sysctls string map for Talos worker machine.sysctls overrides, preserving defaults and using the existing bootstrap rollout mechanism.
```


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

## Summary by CodeRabbit

* **New Features**
* Added optional string-valued sysctl overrides for worker nodes in a
pool. The default is empty and preserves existing behavior. Adding,
changing, or removing overrides updates the worker configuration and
rolls the pool.
* **Bug Fixes**
* Invalid sysctl configuration types and invalid UTF-8 values are
rejected during validation.
* **Documentation**
* Documented the setting’s scope, rollout behavior, and compatibility
considerations, including that it does not configure gVisor. Clarified
HTTPS certificate configuration and when it applies.
* **Improvements**
* Adjusted installation waiting behavior and timeout for Kubernetes node
pools. Updated the ordering of displayed configuration options.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-16 21:30:35 +03:00
Aleksei Sviridkin d205f31017 docs(agents): reword the section-banner comment rule (#5336)
## What this PR does

Rewords the comment rule in `docs/agents/contributing.md` that rejects
"section banners", so it describes the content it objects to instead of
a formatting style.

The rule exists to reject a comment that only names the code below it
and adds nothing, such as a heading over a `ClusterRole` whose `kind`
and `name` already say what it is. "Banners a section" reads instead as
an objection to decoration, and it gets applied to the shape:

```yaml
# == addresses view cluster role ==   <- rejected as a banner
# addresses view cluster role         <- passes, though it says exactly as little
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: cozy:addresses:view
```

The reverse also happens: a heading that does orient the reader in a
long file can be rejected for its `==`. Precedent in the tree shows how
unevenly the rule lands.
`packages/system/backup-controller/templates/tenant-clusterroles.yaml`
and
`packages/system/migration-controller/templates/tenant-clusterroles.yaml`
open their roles with `# == … ==` lines, and the rule only ever catches
new code.

The phrase changes in both places it appears:

- **In-code comments** blocker: "banners a section" becomes "merely
names the section below it".
- **Undisclosed machine authorship** tells: "section banners" becomes
"comments that merely name the section below them".

What the rules enforce is unchanged. The same comments are still
rejected; the wording just points a reviewer at the missing substance
rather than at the decoration.

### Screenshots

Not a UI change.

### Downstream repositories

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

The trigger map's entries for this file, in cozystack/ccp and
cozystack/community, cover the commit convention, which this PR does not
touch. Neither repository restates the comment rules.

### Release note

```release-note
docs(agents): the comment rule against section banners now names what it rejects, a comment that merely names the section below it, rather than the banner formatting.
```


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

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

## Summary by CodeRabbit

* **Documentation**
* Updated review-blocker guidance to clarify that comments merely naming
the section below them qualify as blockers, including in the examples.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-16 17:31:17 +03:00
Aleksei Sviridkin 0d239fab81 Merge branch 'main' into feat/kubernetes-nodes-talos-sysctls
The generated cozyrds file is regenerated from the merged values.yaml.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-16 17:17:33 +03:00
Timofei Larkin c55c3928cb docs(agents): reword the section-banner comment rule
The rule is meant to reject a comment that only names the code below it
and adds nothing, such as a heading over a ClusterRole whose kind and
name already say what it is. "Banners a section" reads instead as an
objection to decoration, so it gets applied to the shape: `# == view
role ==` is rejected while `# view role`, which says exactly as little,
passes, and a heading that does orient the reader in a long file can be
rejected for its `==`.

Both places the rule appears, the in-code comments blocker and the list
of machine-authorship tells, now describe the content that is wrong
rather than its formatting. What the rules enforce is unchanged.

Assisted-by: LLM
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2026-11-16 13:28:17 +01:00
Aleksei Sviridkin 416abfd8e2 fix(etcd): scope tenant alerts to their scrape job (#5183)
## What this PR does

scopes every tenant etcd alert to its release scrape job. previously
each release evaluated every tenant, so one failing peer could produce
alerts from unrelated releases. tenant peer RTT is evaluated by the
tenant rules, while the remaining global etcd checks stay in place.

validation: both affected chart test runs pass, 46 tests in 17 suites.
both charts render. an expression-only simulated leader-loss check
against existing metrics selected 18 members across six namespaces
before scoping and only the three intended members afterwards.
thresholds are unchanged.

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

no API fields, metric names, package interfaces or documented
workarounds change.

### Release note

```release-note
fix(etcd): scope tenant etcd alerts to their release and avoid duplicate tenant peer RTT alerts from the global rules
```


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

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

## Summary by CodeRabbit

* **Bug Fixes**
* Etcd alerts now match metrics from the exact etcd scrape job,
including slow HTTP requests, reducing the chance of unrelated metrics
triggering alerts.
* The peer communication latency alert excludes tenant etcd scrape jobs,
which are covered by tenant-specific rules.
* **Tests**
* Added checks to validate etcd alert job matching and tenant-job
exclusions.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-16 15:15:35 +03:00
scooby87 4f813fb6b2 fix(postgres): hold the WAL archive destination for backups no job tracks (#5294)
## What this PR does

Stacked on #5221; review that one first. Once it merges this PR
retargets to `main`.

After #5221 a Postgres BackupJob writes the shared WAL archive
destination only while no other running BackupJob of the application has
a `cnpg.io/Backup` in flight. A `cnpg.io/Backup` that no running
BackupJob tracks was not counted: one created by hand or by a
`ScheduledBackup`, or one whose BackupJob was deleted or had already
finished. A BackupJob using another BackupClass could then rewrite the
destination while CloudNativePG was running such a Backup, leaving its
base backup in one place and the WAL it needs in another, so the backup
could not be restored.

Such a Backup now holds the destination while CloudNativePG executes it,
that is in the `started` and `running` phases
(`BackupStatus.IsExecuting` in CloudNativePG 1.30). While a Backup of a
Cluster is in one of those phases, CloudNativePG's own
`BackupList.CanExecuteBackup` starts no other Backup of that Cluster, so
the hold never lasts longer than the queue the operator already imposes
and needs no separate deadline. A `pending` Backup does not hold,
including one that ran before and was sent back to `pending`:
CloudNativePG starts its base backup over against the destination
current at that time.

These Backups are found by `spec.cluster.name` in the controller's
cache, because a Backup created by hand need carry no label. The waiting
BackupJob reports `Ready=False` with reason `WaitingForUntrackedBackup`
and names the Backup.

### Screenshots

Not applicable: no UI change.

### Downstream repositories

The diff touches only `internal/backupcontroller`: no CRD, values, chart
or naming change, so nothing in the trigger map applies.

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

### Release note

```release-note
fix(postgres): a Postgres BackupJob no longer rewrites the WAL archive destination while CloudNativePG is running a backup of the same cluster that no BackupJob tracks, such as one created by hand or by a ScheduledBackup; it waits with reason WaitingForUntrackedBackup.
```


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

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

## Summary by CodeRabbit

* **Bug Fixes**
* Prevented shared WAL archive destinations from being written while an
untracked backup is actively running.
* Pending and finalizing backups no longer hold the destination, and the
destination becomes available again after the active backup completes.
* Improved handling of backup status and retry conditions when multiple
backups are in progress.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-16 15:05:08 +03:00
Aleksei Sviridkin c15466fb98 feat(monitoring): take an Alertmanager template file for alert emails (#5110)
## What this PR does

The email receiver from #3800 sends the default Alertmanager subject and
HTML body. The subject strings together every common label of the group,
for a stuck DaemonSet it reads like `[FIRING:1]
KubeDaemonSetRolloutStuck prod cozy-linstor (kubernetes-apps
kube-state-metrics linstor-satellite.node1 http
cozy-linstor/linstor-satellite.node1 ...)`, and the body is a table of
labels and annotations. #3800 left subject and body templates out of the
values on purpose, because Alertmanager parses inline templates only
when it sends, so a broken one drops mail with nothing but a log line.

`alerta.alerts.email.template` takes the text of an Alertmanager
template file instead. The chart stores it in the
`alertmanager-email-template` ConfigMap and lists it in
`VMAlertmanager.spec.templates`. The operator (v0.68.4) mounts it, adds
the path to the configuration `templates` and passes the mount to the
config reloader as a watched directory, so Alertmanager parses the file
while loading its configuration. A file that does not parse fails that
load, and a running Alertmanager keeps the configuration it has. A
template that parses but fails on a notification, for example on a
missing key, still drops that email, and the field description says so.
Defining `email.default.subject` and `email.default.html` in the file
replaces the subject and the body of every email, for example to mark
the severity or to link to Alerta.

The text has to contain a `define` action, a value that is not text
fails the render, and `template` counts as a set field for the check
that rejects a partial email configuration.

We run the same setup by hand on three clusters, a ConfigMap plus
`spec.templates` with Alertmanager v0.31.0 and operator v0.68.4, and
mail arrives with the custom subject and body for firing and resolved
alerts. This PR moves it into the chart, so a platform upgrade does not
drop it.

Checks run for this change.

- `helm unittest` 1.1.2, the version CI pins.
`packages/system/monitoring` passes 309 of 309, five of them new,
`packages/extra/monitoring` passes 31 of 31.
- Each part of the change was taken out in turn, no `spec.templates`, no
`define` check, `template` missing from the set fields and the text
trimmed, and each time exactly one new case failed.
- `make generate` in `packages/extra/monitoring` with cozyvalues-gen
v1.7.0 changes the README, the schema and the cozyrd and nothing else,
and a second run leaves the tree unchanged.

### Screenshots

Not a UI change.

### Downstream repositories

Walked the trigger map in `docs/agents/contributing.md` against the
diff. It adds one field to `packages/extra/monitoring` and changes a
template in `packages/system/monitoring`. The Terraform provider does
not model Monitoring. Monitoring is in the website `SERVICES` list, so
its reference page is regenerated from the README on the next tag.
Nothing under `hack/`, the installer or a CRD 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
feat(monitoring): alerta.alerts.email.template takes the text of an Alertmanager template file for alert emails. Define email.default.subject and email.default.html in it to change the subject and the HTML body of every email. The chart stores the file in the alertmanager-email-template ConfigMap, and Alertmanager loads it with its configuration.
```


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

## Summary by CodeRabbit

* **New Features**
* Alertmanager email alerts can use a custom template for the email
subject and HTML body. Leave the template empty to retain the default
format.
* Templates must include a named definition. Invalid templates prevent
configuration from loading or the monitoring pod from starting; errors
while rendering a notification can prevent that email from being sent.

* **Documentation**
* Added guidance on configuring email templates and their validation and
delivery behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-16 14:34:01 +03:00
Aleksei Sviridkin d36b6e55f5 Merge branch 'main' into fix/tenant-quota-hugepages
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-16 13:30:03 +03:00
Aleksei Sviridkin ca0fcb1c05 Merge branch 'main' into fix/etcd-alert-scope-20261102
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-16 13:28:42 +03:00
Aleksei Sviridkin 1e5e532737 Merge branch 'main' into feat/monitoring-email-template
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-16 13:24:49 +03:00
Aleksei Sviridkin 897c5fcf79 docs: add CageForge to ADOPTERS.md (#5188)
## What this PR does

Adds CageForge to the adopters list.

We have been running Cozystack for a while now, both as a bare-metal
installation and on Proxmox VE through the Proxmox integration, and we
contribute the Proxmox-related work back upstream.

## Release note

```release-note
NONE
```

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

## Summary by CodeRabbit

* **Documentation**
* Added CageForge to the Cozystack adopters list, including its website,
contact details, and a brief description of its deployments and
contributions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-16 01:24:02 +03:00
Aleksei Sviridkin d325f1921c Merge branch 'main' into adopters-cageforge
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-16 00:21:47 +03:00
Aleksei Sviridkin 5a5d5cd3d8 fix(tests): reject matcher failures in negative file assertions (#5175)
<!-- Thank you for making a contribution! Here are some tips for you:
- Use Conventional Commits for the PR title: `type(scope): description`
- Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore
- Scopes are not an exhaustive list — pick the most specific scope for
the change and extend the list when a genuinely new area appears.
Examples:
- System components: dashboard, platform, operator, cilium, kube-ovn,
linstor, fluxcd, cluster-api
- Managed apps: postgres, mariadb, redis, kafka, clickhouse,
virtual-machine, kubernetes
- Development and maintenance: api, hack, tests, ci, docs, maintenance
- Breaking changes: append `!` after type/scope (`feat(api)!: ...`) or
add a `BREAKING CHANGE:` footer
- If it's a work in progress, consider creating this PR as a draft.
- Don't hesistate to ask for opinion and review in the community chats,
even if it's still a draft.
- Add the label `kind/backport` if it's a bugfix that needs to be
backported to a previous version.
-->

## What this PR does

Fixes #3700.

Negative file assertions must not pass when the matcher fails or an
artifact is missing. Share `assert_file_lacks_pattern` through the
existing Bats helper, preserving all call sites while removing the 12
divergent copies. The shared implementation accepts absence only when
awk evaluates successfully and explicitly reports no match. It reports
read/evaluation failures regardless of their exit status and validates
the regex even when the artifact is empty.

Regression tests run the assertion under `bash -eu` and cover matching
and non-matching patterns, empty files, invalid regexes, missing paths,
directories, and unreadable files. The tests reproduce false positives
against the previous helper implementations, including a matcher that
prints a no-match result but exits with an error. The test suite
resolves its helper relative to its own directory and also runs outside
the repository root.

### Validation

- Bats 1.14.0: all 471 tests in the regression file and 12 affected
consumer suites pass, with no skips.
- All 462 tests in the 12 affected consumer suites pass under the dash
POSIX compatibility runner.
- All nine helper tests pass from both the repository root and `/tmp`;
independent verification also passes all nine with BusyBox awk v1.35.0.
The previous helper falsely accepts invalid patterns and unreadable
files with that implementation.
- `bash -n hack/test_helper.bash` and `git diff --check` pass.
- An earlier full Bats run executed all 2,491 tests: 2,426 passed and 65
failed. Of these, 56 require Docker and three require `envsubst`,
neither of which is installed in this environment. The remaining six
selector failures also reproduce on the unchanged baseline with the
older local yq; rerunning both selector suites with the CI-pinned,
checksum-verified yq v4.53.3 passes all 110 tests. The full-tree suite
has not been rerun for this corrective revision; its focused checks are
listed above.

### 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(tests): fail negative file assertions on invalid patterns or unreadable artifacts and share the helper across Bats suites.
```


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

## Summary by CodeRabbit

* **Tests**
* Consolidated checks for verifying that files do not contain specified
patterns.
* Expanded coverage to verify behavior for matching and non-matching
patterns, invalid patterns, missing paths, directories, inaccessible
files, and pattern-checking errors.
* Checks now succeed only when the target is a regular file and pattern
evaluation completes successfully without finding a match.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-15 06:00:02 +03:00
Aleksei Sviridkin c1740e7631 test(tests): select resources in absence-only Helm checks (#5174)
## What this PR does

Select the intended resource by kind or name in 23 absence-only Helm
tests: the 21 cases catalogued in #4665, a newer MariaDB backup-script
case, and Kafka's JVM-options case. The requested
kubernetes-nodes/nodegroup and OpenSearch TLS audit found no remaining
unanchored negative-only cases.

Add a diff-based CI guard against new positional selectors in
first-party suites on templates with multiple literal resource blocks.
It preserves single-document uses and unchanged indices, including pure
suite renames; renamed suites are still checked for added index lines.
It follows Helm's template and index precedence, and its fixtures use
portable file writes. The guard runs after the test steps so a guard
failure cannot suppress their results.

The guard is intentionally static: it counts `---`-separated blocks with
a top-level `kind`, not resources produced by helpers or ranges, and
does not evaluate whether whole-document branches are mutually
exclusive. It does not audit vendored suites or existing indices when a
template later gains documents.

Validation:
- `make helm-unit-tests` passes: 106 package test targets, 556 Helm
suite executions, and 4,067 Helm tests, including the dashboard
package’s additional Go checks.
- All 51 focused BATS checks pass. The full BATS sweep initially passed
2,435 of 2,500 cases; six graph-selection failures were then resolved by
using the repository-pinned yq v4.53.3 (127/127 targeted rerun cases
pass). The remaining 56 Docker-dependent and three envsubst-dependent
cases are blocked by missing host prerequisites; no full BATS pass is
claimed. The six yq-related failures also reproduce on the unchanged
base with the older tool and pass with the pinned version.
- All 17 guard regression tests pass, including first-party scope,
inherited index precedence, pure/edited renames, template overrides,
nested default templates, conditional kinds, and multiline index values.
- Missing-target mutations cover all 23 selector changes: original cases
pass against unrelated resources; updated cases fail with `document not
found`.
- Reordered violating-target mutations cover all 22 formerly positional
cases: originals pass against leading unrelated resources; updated cases
find the intended target and fail their content assertion. Kafka's
updated case also passes when the reordered Job remains valid.
- Empty-render mutation confirms that the newer MariaDB backup-script
case previously passed without a document and now fails. Existing
positional cases already fail on an entirely empty render.
- The changed workflow passes the repository-pinned zizmor v1.26.1
offline audit; `git diff --check` is clean.

Closes #4665

### Screenshots

Not applicable (tests and CI only).

### Downstream repositories

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

### Release note

```release-note
NONE
```


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

## Summary by CodeRabbit

* **Chores**
* Pull request checks now flag positional document selections in Helm
tests when they target multi-document templates.
* **Bug Fixes**
* Updated chart tests to select Kubernetes resources by kind or name
rather than document position, keeping assertions focused on the
intended resources.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-15 05:59:52 +03:00
Aleksei Sviridkin da17254bbc fix(kubernetes): bring up a replacement worker before draining the old one (#5153)
<!-- Thank you for making a contribution! Here are some tips for you:
- Use Conventional Commits for the PR title: `type(scope): description`
- Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore
- Scopes are not an exhaustive list — pick the most specific scope for
the change and extend the list when a genuinely new area appears.
Examples:
- System components: dashboard, platform, operator, cilium, kube-ovn,
linstor, fluxcd, cluster-api
- Managed apps: postgres, mariadb, redis, kafka, clickhouse,
virtual-machine, kubernetes
- Development and maintenance: api, hack, tests, ci, docs, maintenance
- Breaking changes: append `!` after type/scope (`feat(api)!: ...`) or
add a `BREAKING CHANGE:` footer
- If it's a work in progress, consider creating this PR as a draft.
- Don't hesistate to ask for opinion and review in the community chats,
even if it's still a draft.
- Add the label `kind/backport` if it's a bugfix that needs to be
backported to a previous version.
-->

## What this PR does

Worker pool MachineDeployments roll out with `maxUnavailable: 1`. CAPI
therefore drains and deletes an old Machine as soon as its replacement
Machine has been created, not once the replacement has joined. Observed
on a one-node pool changing instance type (`s1.large` to `s1.medium`):
the new Machine was created at 13:07:19, the old node was drained and
deleted 17 s later, and the new node was Ready around 13:11, so the pool
had no node for about four minutes. Larger pools lose one node of
capacity at every step of the rollout for the same reason.

This sets `maxUnavailable: 0`, so a node is drained only once its
replacement is up. `maxSurge` stays at the pool ceiling (`maxReplicas`),
with a floor of 1: CAPI rejects a RollingUpdate where both values are 0,
and `maxReplicas: 0` is accepted by the schema.

Exception: a pool with `gpus` keeps `maxUnavailable: 1`. Its replacement
VM may need the very passed-through GPU the old node holds, and with
`maxUnavailable: 0` it would stay Pending and the rollout would never
finish. A Proxmox pool that passes GPUs through its template carries no
`gpus` value, so the chart cannot recognise it: the new optional
`maxUnavailable` value lets such a pool (or any pool) set the strategy
explicitly, and set to 1 restores the drain-first behaviour.

The value is bounded to 0..2147483647, since CAPI decodes it as an
int32. ComputePlane pools render through the same chart, so
`packages/extra/computeplane` exposes `nodeGroups.<pool>.maxUnavailable`
and its allowlist forwards it.

Trade-off: a rollout now needs room for at least one extra VM. A tenant
at its quota stalls the rollout (the new Machine stays Pending) instead
of temporarily shrinking the pool, which is the safer failure.

Tests: `tests/rollout_strategy_test.yaml` (7 cases: the default, the
ceiling, a zero ceiling, a GPU pool, and the explicit override) fails on
`main` without the template change; the render snapshot is updated. Two
more cases cover the int32 maximum, accepted at 2147483647 and refused
one above. `helm unittest packages/apps/kubernetes-nodes`: 252 passed.
`packages/extra/computeplane/tests/cluster_test.yaml` checks that the
wrapper forwards `maxUnavailable` (it fails without the allowlist entry)
and refuses a value above the int32 range: 15 passed.

Backport: on `release-1.6` the same strategy is also rendered by
`packages/apps/kubernetes/templates/cluster.yaml` (the in-chart
`nodeGroups`), and the snapshot file does not exist there, so the
automatic backport cannot apply. A manual backport PR to `release-1.6`
covering both charts follows. `release-1.7` keeps `kind/backport`.


### Screenshots

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

### Downstream repositories

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

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

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

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

- [ ] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [x]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up: cozystack/terraform-provider-cozystack#79 (tracking issue:
the provider change is out of scope here). `cozystack_kubernetes_nodes`
has no attribute for the new `maxUnavailable`, so a Terraform-managed
pool cannot drain first; the provider has no ComputePlane resource yet.
- [ ]
[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): worker pool rollouts (instance type, image or version changes) now bring each replacement node up before draining the old one, instead of removing a node first. A rollout needs room for one extra VM. Pools with GPUs keep the previous behaviour.
```


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

## Summary by CodeRabbit

* **New Features**
* Added a pool-level `maxUnavailable` setting to control how many
workers may be removed before replacements are ready. It defaults to 0
for non-GPU pools and 1 for GPU pools; configured values override these
defaults.
* Proxmox pools passing through GPUs can set `maxUnavailable` to 1 to
help prevent rollouts from waiting indefinitely.
* **Bug Fixes**
* Rolling updates now use at least one surge node, even when the replica
limit is zero.
* **Documentation**
  * Documented rollout settings, defaults, and capacity considerations.
* **Tests**
* Added coverage for defaults, overrides, surge limits, and invalid
values.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-15 02:48:13 +03:00
Aleksei Sviridkin 46cb99df5b fix(controller, platform): give unbounded pool members the root's LimitRange (#5265)
## What this PR does

Since tenant quotas became hierarchical (#3086), an unbounded sub-tenant
(no `resourceQuotas` of its own) shares its parent's pool and receives a
controller-owned `tenant-quota-allocated` ResourceQuota. The tenant
chart, however, renders the `tenant-range-limits` LimitRange only next
to the `tenant-quota` of a tenant that declares `resourceQuotas`, so
these namespaces end up with a quota on `limits.cpu`/`limits.memory` and
no container defaults. Admission then rejects every container that omits
one of those limits.

Pods that predate the quota keep running and fail as soon as they are
recreated. In production this took down CNPG postgres instances with
backups enabled: the `plugin-barman-cloud` sidecar injected by the
barman-cloud plugin sets CPU and memory requests and a memory limit but
no CPU limit, so the instance pod is refused on its next restart. The
same happened to the tenant `kubernetes` app: the `wait-for-kubeconfig`
init container of `cluster-autoscaler`, `kcsi-controller` and the
`bootstrap-token` jobs has no resources, so their ReplicaSets and Jobs
were refused with `failed quota: tenant-quota-allocated: must specify
limits.cpu` in every unbounded sub-tenant hosting a tenant cluster. On a
production cluster, 131 tenant pods currently get their CPU or memory
from the tenant LimitRange (VictoriaMetrics
`config-init`/`config-reloader`, Harbor exporter, MariaDB agent, Strimzi
entity operator, among others), so the defect is not specific to one
chart: any of them breaks once it lands in such a namespace. Workloads
that set every limit explicitly are unaffected.

The controller already decides which namespaces it clamps, so it now
copies the pool root's chart LimitRange into each unbounded member whose
allocated quota bounds `limits.cpu` or `limits.memory` as
`tenant-range-limits-allocated`, keeps it in step with the root, and
deletes it once the namespace leaves the pool (for instance when the
sub-tenant declares its own quota and the chart renders its own
LimitRange). The chart renders its LimitRange under any non-empty
`resourceQuotas`, including one that bounds no compute (#4930), so the
copy is limited to members whose quota bounds a compute limit: elsewhere
it would impose a 128Mi default memory limit the quota never asked for
and refuse pods, virt-launcher among them, that are admitted today. This
keeps the change independent of #4954. The copy has its own name so that
Helm can still create the chart-owned object in that case without an
ownership conflict. The root is the single source of truth for the
defaults, so the values stay defined in
`packages/apps/tenant/templates/quota.yaml` only. The controller gains
`limitranges` RBAC and watches the two LimitRange names so a change
propagates without waiting for the 60 s resync.

Tests: five reconciler cases cover a member under a non-compute quota
(no copy, and a stale one removed), the copy into an unbounded member
(and not into the root), propagation of a change on the root, garbage
collection once the member is bounded (the chart-owned object is left
alone), and a root without a LimitRange. Disabling the copy makes the
first two fail.

### Screenshots

Not a UI change.

### Downstream repositories

Walked the trigger map against the diff. The code touches only
`internal/controller/tenantquota/` and the `cozystack-controller` RBAC
template, but the website's `system-memory-limits.md` states that tenant
namespaces get defaults only from the chart's `tenant-range-limits`,
which this change makes untrue; the follow-up is an issue, since the
page should change once this is merged.

- [ ] No downstream repository is affected by this change
- [x] [cozystack/website](https://github.com/cozystack/website) -
follow-up: cozystack/website#806
- [ ]
[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(controller, platform): sub-tenants without their own resourceQuotas now receive their parent pool's container defaults (LimitRange) alongside the allocated quota, when that quota bounds a CPU or memory limit, so pods that omit such a limit, such as the postgres barman-cloud backup sidecar, are no longer rejected at admission.
```


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

## Summary by CodeRabbit

* **New Features**
* Unbounded pool members now receive their pool’s CPU and memory limit
settings when their allocated quota sets those limits. Pool setting
updates are reflected in members during reconciliation.
* When a member has its own quota, inherited limit settings are removed
while settings configured directly for that member remain unchanged.
* No inherited settings are created when the pool has no limit settings
or the allocated quota does not set CPU or memory limits.
* Existing inherited settings are retained if an update temporarily
fails.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-15 02:33:34 +03:00
Aleksei Sviridkin 90797d9de9 fix(ci): take main's ref for a bare first-party image ref in a drifted file (#5329)
<!-- 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

Closes #5328.

A PR whose merge commit predates a config change to
`packages/system/observability-proxy/values.yaml` fails E2E with
`observability-proxy` in `ImagePullBackOff` on
`observability-proxy:v0.0.0`. `hack/overlay-main-images.sh` skips a file
that differs from the `cozystack-packages:main` artifact in anything but
ref lines, so the bare ref committed for a new image stays, and that tag
was never pushed. The merge commit is fixed when the run starts, so a
rerun, or a PR not pushed to since, drifts on files it never touched.
This comes back every time the proxy's `values.yaml` changes on main,
and it will hit every new image the same way until a release stamps its
ref.

### Behavior changes

- In a drifted values file, a bare first-party ref
(`ghcr.io/cozystack/cozystack/<name>:<tag>`, no digest) under an image
key now takes the artifact line with the same key and indentation, a
digest, and the same first-party image (`.../cozystack/<name>`). Exactly
one such line must exist; none or two leave the ref as committed.
- The rest of a drifted file stays as the PR has it, including every
digest-pinned ref. The drift guard still keeps a PR's chart from running
against an image built for a newer one wherever the committed ref pulls.
- Third-party refs are never replaced. Main can bump one together with
its config, and the committed pair is the one known to work.
- The other digest-less first-party refs in the tree get the same
treatment. `backup-http-client:v1.6.0`, `redis-backup:v1.6.0` and
`kubernetes-backup:v1.6.0` in `backupstrategy-controller` (#4264) are
not on ghcr either, so a drifted run could not pull them before and now
can. `migration-controller:latest` does exist; in a drifted file it now
runs main's image with the PR's older config. That is the trade-off: it
is the same component built from the tree, and a digest-less ref is not
reproducible anyway.
- Packages that took main's images this way are named in their own
`Image overlay bare refs` annotation, and the summary line counts them
as `bare-refs=N`. A rewrite that cannot write the file is counted as
`failed`.
- `docs/agents/image-refs.md` now says how PR CI stamps a bare ref in a
drifted file, instead of only promising that it does.

### Not in this PR

- Pinning a real tag+digest for the proxy in `values.yaml`. The only
pushed tags are nightlies, which retention prunes after 14 builds, and
digests pinned on main are not protected from it, so the pin would break
again within weeks. A release tag appears with release-1.8.
- The other digest-less first-party refs from #4264.
- The split shape (`repository:` + `tag:` without `digest:`), a
single-quoted value, or one followed by a `# comment`. No package writes
a bare first-party ref that way today; such a line stays as committed.

### Tests

New cases in `hack/overlay-main-images_test.bats`: a drifted file takes
the artifact ref for its bare ref and keeps its config; a digest-pinned
sibling stays; no replacement for a different image name, for an
artifact line without a digest, for a third-party ref even when main
pins one, for a third-party image with the same name, or for two
candidate lines; a rewrite that cannot write the file is counted as
failed and leaves no temporary file. The suite passes under bats and
under the POSIX runner with `dash`. The script was also run against an
older copy of the proxy's real `values.yaml`: only the `image:` line
changed.

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

- [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 `hack/overlay-main-images.sh`, its bats file and one
paragraph of `docs/agents/image-refs.md`. Nothing under `hack/` moves or
is renamed and no make target changes (the ccp trigger), and no package,
values key, CRD or naming changes.

### 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(ci): a PR behind main no longer installs a never-pushed placeholder tag for a new first-party image, such as observability-proxy:v0.0.0, when that package's values.yaml changed on main since the PR's merge commit.
```


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

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

## Summary by CodeRabbit

* **Documentation**
* Clarified that PR CI may update eligible, digest-less first-party
image references while preserving other committed configuration.
Third-party references retain their committed tags and digests.
* **Bug Fixes**
* Image references are left unchanged when a matching current-main image
is missing or ambiguous, and failed file updates are reported.
* **Tests**
* Added coverage for reference matching, unchanged configuration, and
failed updates.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-14 20:15:52 +03:00
Aleksei Sviridkin 70f1e170fc chore(cilium): drop externalIPs.enabled and nodePort.enabled (#4953)
## What this PR does

Removes `cilium.externalIPs.enabled` and `cilium.nodePort.enabled` from
`packages/system/cilium/values.yaml`. The vendored Cilium chart (1.20.2)
reads neither key: there is no `externalIPs` value upstream, and from
`nodePort` the templates read only `range`, `addresses`,
`bindProtection`, `autoProtectPortRange`, `directRoutingDevice`,
`enableHealthCheck`, `enableHealthCheckLoadBalancerIP` and
`enableDynamicSourceLookup`. Both features follow
`kubeProxyReplacement`, which stays `true`, so the keys only misled
readers into thinking they toggle anything.

Verified locally:

- `make test` in `packages/system/cilium`: 4 suites, 26 tests pass.
- `helm template` output is byte-identical before and after for the
default values and for each of `values-talos.yaml`,
`values-kubeovn.yaml`, `values-kilo.yaml` and `values-apparmor.yaml`.

Fixes #4816

### 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
chore(cilium): remove the unused externalIPs.enabled and nodePort.enabled values, which the Cilium chart never read; no runtime change.
```


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

## Summary by CodeRabbit

* **Configuration Changes**
* Cilium no longer enables external IP or NodePort service exposure.
LoadBalancer configuration remains enabled. Services relying on external
IPs or NodePorts may need a different exposure method.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-14 16:54:42 +03:00
Maxim Belyy 1597bb6098 fix(ci): keep the drift annotation true when bare refs took main's images
Assisted-by: LLM
Signed-off-by: Maxim Belyy <maximbel2003@gmail.com>
2026-11-14 20:02:29 +07:00
Maxim Belyy 2468b309ee fix(ci): count a failed bare-ref rewrite and word the drift log by result
A rewrite that cannot replace the file now counts as failed and leaves
no temporary file behind, instead of reporting lines as replaced. A
drifted file whose bare refs took main's images no longer logs that it
kept its committed ref.

Assisted-by: LLM
Signed-off-by: Maxim Belyy <maximbel2003@gmail.com>
2026-11-14 19:58:33 +07:00
Maxim Belyy 854a3f40e4 fix(ci): limit the drifted-file bare-ref overlay to first-party images
Main can bump a third-party image together with its config, so a PR
behind it must keep the committed pair rather than take main's image
alone. Only ghcr.io/cozystack/cozystack refs, matched against an
artifact line for the same first-party image, are replaced now.

State the trade-off for first-party refs that do exist, and name the
packages that took main's images in their own annotation.

Assisted-by: LLM
Signed-off-by: Maxim Belyy <maximbel2003@gmail.com>
2026-11-14 19:54:31 +07:00
Maxim Belyy 54b76fcdf1 docs(agents): say how PR CI stamps a bare ref in a drifted file
Assisted-by: LLM
Signed-off-by: Maxim Belyy <maximbel2003@gmail.com>
2026-11-14 19:51:20 +07:00
Maxim Belyy fd15ad282e fix(ci): take the main ref for a bare image ref in a drifted file
A file whose configuration drifted from the cozystack-packages:main
artifact keeps its committed refs. For a digest-pinned ref that runs an
older image; for the bare <repo>:<tag> a new image is first committed
with, it names a tag that was never pushed, so the component cannot
pull. The merge commit CI tests is fixed when the run starts, so a PR
whose merge commit predates a config change to observability-proxy's
values.yaml installed observability-proxy:v0.0.0 and failed E2E.

In a drifted values file, a bare ref under an image key now takes the
artifact line with the same key, the same image name and a digest, when
exactly one exists. The rest of the file stays as the PR has it.

Assisted-by: LLM
Signed-off-by: Maxim Belyy <maximbel2003@gmail.com>
2026-11-14 19:51:20 +07:00
Ahmed Kamal 694943af7f chore(tests): merge main to refresh observability image baseline
Keep unbuilt package configuration aligned with current-main images so
the fork E2E overlay can replace the observability-proxy placeholder.

Signed-off-by: Ahmed Kamal <email.ahmedkamal@googlemail.com>
Assisted-by: LLM
2026-11-14 03:43:56 +02:00
Aleksei Sviridkin eafe1adde5 Merge branch 'main' into feat/kubernetes-nodes-talos-sysctls
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-14 03:55:52 +03:00
Aleksei Sviridkin f8217be501 Merge branch 'main' into chore/cilium-drop-unread-values
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-14 03:55:46 +03:00
Aleksei Sviridkin 3ede7c4d33 feat(observability-proxy): include platform exporter series in the namespace root (#5277)
<!-- Thank you for making a contribution! Here are some tips for you:
- Use Conventional Commits for the PR title: `type(scope): description`
- Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore
- Scopes are not an exhaustive list — pick the most specific scope for
the change and extend the list when a genuinely new area appears.
Examples:
- System components: dashboard, platform, operator, cilium, kube-ovn,
linstor, fluxcd, cluster-api
- Managed apps: postgres, mariadb, redis, kafka, clickhouse,
virtual-machine, kubernetes
- Development and maintenance: api, hack, tests, ci, docs, maintenance
- Breaking changes: append `!` after type/scope (`feat(api)!: ...`) or
add a `BREAKING CHANGE:` footer
- If it's a work in progress, consider creating this PR as a draft.
- Don't hesistate to ask for opinion and review in the community chats,
even if it's still a draft.
- Add the label `kind/backport` if it's a bugfix that needs to be
backported to a previous version.
-->

## What this PR does

Builds on #5219 and #5220, both merged.

The namespace metrics root
`/apis/cozystack.io/v1alpha1/namespaces/<ns>/metrics/...` now also
returns series that a platform exporter attributes to `<ns>`. Example:
the ClickHouse operator's exporter runs in `cozy-clickhouse-operator`.
vmagent scrapes it without `honorLabels`, so its series carry
`namespace="cozy-clickhouse-operator"`, and the tenant namespace the
exporter reported moves to `exported_namespace="<ns>"`. Until now, any
client of the namespace root (kubectl, automation, the console) never
saw those series.

### Behavior changes

- Namespace root, every endpoint (`query`, `query_range`, `series`,
`labels`, `label/<name>/values`):
  - was: one proxy-set `extra_filters[]={namespace="<ns>"}`;
- now: two values, `{namespace="<ns>"}` and
`{namespace=~"cozy-.*",exported_namespace="<ns>"}`. vmselect ORs them.
- Label APIs without a client `match[]`: the proxy already repeats the
scope in `match[]` for `-search.ignoreExtraFiltersAtLabelsAPI`; it now
repeats both values. vmselect ANDs every `match[]` with every
`extra_filters[]`. Each cross pair is narrower than one of its halves,
so the result is still exactly the union.
- Client `extra_filters`, `extra_filters[]` and `extra_label` are still
dropped.
- New flag `--metrics-platform-namespace-prefix` (default `cozy-`) and
chart value `observabilityProxy.metrics.platformNamespacePrefix`. An
empty value turns the second branch off and restores the single-value
scope. The proxy quotes the prefix and anchors it, so the value is
matched literally and cannot become a wider regex. The flag accepts only
namespace name characters, because any other value would match no
namespace and silently drop the exporter series.
- Exporter series keep `namespace="cozy-..."`. A query that also selects
`namespace="<ns>"` excludes them; select them by `exported_namespace` or
by the exporter's own labels (for ClickHouse, `chi`).
- The branch is not specific to ClickHouse. For example,
kube-state-metrics in the platform monitoring namespace sets
`exported_namespace` from `metadata.namespace` on the Flux
`gotk_resource_info` series
(`packages/system/monitoring-agents/values.yaml`), so a namespace root
now also returns the state of that namespace's own HelmReleases and
Kustomizations. This is the namespace's own data, but it is a visible
change with the default prefix.
- Queries grouped `by (namespace)` can now return an extra group
labelled with the exporter's platform namespace. The exporter's series
also carry its own target labels (`pod`, `instance`, `job`) into the
tenant's results.
- An empty scope is refused with 500 instead of forwarding a request
without `extra_filters[]`.
- The application roots of #5220 are not affected: they replace the
scope with their own selectors.

### Threat model

1. **Scrape path.** vmagent sets `namespace` from service discovery,
while `exported_namespace` is whatever the exporter wrote. Any tenant
pod can write a `namespace` label, which arrives as
`exported_namespace`, so the extra branch only trusts it on series
scraped from platform namespaces. Tenant roles
(`packages/system/cozystack-basics/templates/clusterroles.yaml`) grant
no access to `operator.victoriametrics.com` and no verbs on `Namespace`.
A tenant can therefore neither run a target in `cozy-*` nor point a
scrape object at one.
2. **Remote-write writers.** A tenant's nested Kubernetes cluster runs
its own vmagent, which remote-writes into the same store when the tenant
has no monitoring of its own, and the labels it writes are not enforced.
Inside that cluster the tenant can create `cozy-*` namespaces or any
other, so it can already write `namespace="<any ns>"` and pass the
existing single filter. This is an existing limitation that this PR
neither introduces nor widens: anything that can write
`namespace="cozy-x",exported_namespace="<ns>"` can write
`namespace="<ns>"` directly. Closing it needs enforcement on the write
path and is out of scope here.
3. **Impact of a forged series.** The scope only adds series to a
namespace's results; it never lets a caller read another namespace. A
forged series can spoil or flood another namespace's graphs, up to the
series limits that answer 422.

### Rejected alternatives

- **Bare `{exported_namespace="<ns>"}`.** Every namespace is scraped by
default, so any tenant pod could inject series into another namespace's
root.
- **Relabeling the ClickHouse operator's scrape so that `namespace`
carries the tenant namespace.** It fixes one exporter at a time, each in
its own chart, and it changes the label set of every existing series,
which splits their history at the change and breaks any query that
selects them by the operator's namespace. The proxy-side branch covers
every platform exporter and leaves stored series as they are.
- **Scraping the ClickHouse pods directly.** The metric names differ
from the operator's exporter, so the shipped ClickHouse dashboard
(`dashboards/clickhouse/altinity-clickhouse-operator-dashboard.json`),
which reads the exporter's `chi_clickhouse_*` series, would have to be
rewritten.
- **A free regex flag instead of a prefix.** One typo (`.*`) would trust
`exported_namespace` from every namespace.

### Tests

- Table of namespace-root requests: exactly two `extra_filters[]` values
in order with the default prefix, one value with an empty prefix, on all
five endpoints. Client `extra_filters[]` still dropped.
- A model of vmselect's selection (OR over `extra_filters[]`, AND with
each `match[]`) shows that `namespace=cozy-x, exported_namespace=<ns>`
is visible, and that `namespace=tenant-y, exported_namespace=<ns>` and
`namespace=xcozy-a, ...` are not.
- Escaping of `<ns>` in `exported_namespace`, literal prefix quoting,
empty scope refused, flag validation, and a chart test that an empty
value reaches the binary as an explicit empty flag.

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

- [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 `cmd/observability-proxy`,
`internal/observabilityproxy` and the system package
`packages/system/observability-proxy` (a new value and flag, no app,
platform values, CRD, `hack/` or naming change). None of the triggers in
`docs/agents/contributing.md` under "Downstream Repositories" apply.

### 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(observability-proxy): the namespace metrics root also returns series that exporters in platform (`cozy-*`) namespaces attribute to the namespace through `exported_namespace`, such as the ClickHouse operator's. The prefix is set by `--metrics-platform-namespace-prefix` / `observabilityProxy.metrics.platformNamespacePrefix`; an empty value disables it.
```


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

## Summary by CodeRabbit

* **New Features**
* Metrics queries now include series attributed to a tenant namespace by
exporters in platform namespaces with the configured prefix. The default
prefix is `cozy-`; setting it to an empty value disables this behavior.
* Namespace scoping is applied across supported metrics endpoints,
including label lookups.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-14 02:44:48 +03:00
Aleksei Sviridkin b34f0c378f fix(vpa): shorten the admission webhook timeout to 5s (#5242)
## What this PR does

The VPA admission controller registers its Pod CREATE webhook in every
namespace with `failurePolicy: Ignore` and a 30s timeout. When its pod
is down and the Service IP blackholes (a cold start after a full cluster
shutdown, before the CNI is back), each Pod creation waits the full 30s
on top of the other webhooks and fails with `context deadline exceeded`.
That includes the CNI's own DaemonSet pods, so the cluster cannot
recover without deleting the webhook configuration by hand.

Seen on Cozystack (Talos, 3 nodes) after a full shutdown and power-on:
the Cilium DaemonSet stayed at 1/3 and Kube-OVN's `ovn-central` could
not reach quorum until `vpa-webhook-config` was deleted. Once it was
deleted, everything recovered, and VPA re-registered its webhook on
start.

A mutation takes milliseconds; 5s keeps slow responses working and keeps
the total wait of the sequential Pod CREATE webhooks well inside the
request deadline. Uses the admission controller's documented
`--webhook-timeout-seconds` flag through the chart's `extraArgs`.

Refs #3125 (this covers the VPA part of it; `lineage` and
`linstor-scheduler-admission` are separate). Supersedes #4903, rebased
onto current `main` (no conflicts); `helm unittest` of the chart passes.

### Screenshots

No UI change.

### Downstream repositories

Walked the trigger map: the diff is one value in
`packages/system/vertical-pod-autoscaler/values.yaml` (a system package,
no app schema, no platform value, no tooling).

- [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:

### Release note

```release-note
[vpa] Shorten the VPA admission webhook timeout to 5s so pod creation does not stall cluster-wide while the admission controller is unreachable.
```


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

## Summary by CodeRabbit

* **Configuration**
* The vertical pod autoscaler admission controller now uses a 5-second
webhook timeout.
* Configuration comments clarify the timeout and its behavior during Pod
creation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-14 02:39:24 +03:00
Ahmed Kamal b1e067f6e1 chore(tests): merge upstream main into resource selector branch
Preserve the Helm selector guard alongside main's independently gated
backport tests when refreshing the branch's upstream base.

Validated with actionlint and 31 focused Bats tests.

Signed-off-by: Ahmed Kamal <email.ahmedkamal@googlemail.com>
Assisted-by: LLM
2026-11-14 00:58:47 +02:00
Aleksei Sviridkin 7e069356b9 Merge branch 'main' into feat/kubernetes-nodes-talos-sysctls
Generated files (types, README, schema, cozyrds) are regenerated from
the merged values.yaml.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-14 00:43:22 +03:00
Aleksei Sviridkin aa1448e20b docs(agents): add development principles to AGENTS.md and agent docs (#4859)
<!-- 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. -->

The same mistakes kept coming back in reviews of agent-written changes.
A failure was blamed on whatever changed just before it, with no
mechanism behind the claim. Commands ran against the current kubectl
context while the work moved between the management cluster and tenant
clusters. Prose edits got invented failing tests, and behavior changes
landed without any.

References and review feedback were the other source. Review corrections
were stacked as new commits instead of rewriting the change. Closing
keywords went into commits for partial fixes, while the PR itself did
not link the issue. Feedback in review bodies and conversation comments
was missed because only inline threads were read. A rerun of the fork
E2E workflow was taken as proof that an unmerged edit to that workflow
works.

I wrote these down as rules, so a review does not have to teach the same
thing again. They go into `AGENTS.md` and `docs/agents/`, which agents
and people both read, and the PR template now asks to link the issue a
PR addresses.

This also fixes my earlier advice on negated Bats assertions: such an
assertion can pass silently, but `bats` does fail it when it is the last
command of the test.

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

The ccp package commit template and the community contributor guide
restate parts of these rules. Both follow-ups are open issues, to be
done once this lands.

<!--
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:
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [x] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
[issue #29](https://github.com/cozystack/ccp/issues/29)
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [x] [cozystack/community](https://github.com/cozystack/community) -
follow-up: [issue
#125](https://github.com/cozystack/community/issues/125)

### 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
docs(agents): write recurring review findings down as agent rules covering root-cause evidence, explicit cluster targets, tests for behavior changes, commit and issue references, and review feedback outside inline threads.
```
2026-11-14 00:42:14 +03:00
Aleksei Sviridkin c93af24ea2 Merge branch 'main' into fix/vpa-admission-webhook-timeout
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-11-14 00:42:05 +03:00
Aleksei Sviridkin 06ca603f4f feat(platform): expose Keycloak truststores through platform values (#5144)
## What this PR does

Fixes #5140.

#5039 added `truststores` to the Keycloak chart, but that capability was
not reachable through the administrator-owned platform Package: the
system bundle rendered `Package cozystack.keycloak` without a components
override. This PR adds the optional
`authentication.oidc.keycloakTruststores` platform value and forwards it
unchanged to `spec.components.keycloak.values.truststores` on that child
Package.

Administrators can configure it under `spec.components.platform.values`
on `Package cozystack.cozystack-platform`:

```yaml
authentication:
  oidc:
    keycloakTruststores:
      - configMapName: organization-ca
        key: ca.crt
      - secretName: partner-ca
        key: certificates.pem
```

When OIDC is enabled and the list is non-empty, the complete list is
forwarded, including entry order, explicitly selected keys, and entries
that omit `key` so the chart's `ca.crt` default remains effective. When
the value is unset or explicitly empty, the platform continues to use
the default Package helper without introducing `spec.components`. When
OIDC is disabled, the value is ignored because no Keycloak Package is
emitted.

The platform layer only forwards references; it does not create Secrets
or ConfigMaps. Referenced objects and keys must already exist in
`cozy-keycloak`, and the Keycloak chart remains responsible for
validation and mounting. Its existing semantics are unchanged: trust
applies server-wide across all realms, only public certificate material
should be supplied, and changing an object's contents requires a
Keycloak restart or a versioned object reference to reload the
truststore.

### Validation

- `make test` in `packages/core/platform`: all 295 tests pass. The new
suite covers unset, empty and null defaults, complete list forwarding,
false-y malformed values, both `isp-full` and `isp-slim`, and disabled
OIDC; removing the forwarding path or restoring truthiness-based empty
checks makes the regression suite fail.
- `make test` in `packages/system/keycloak`: all 121 tests pass.
- With the system bundle and OIDC enabled, the unset render is
byte-identical to `upstream/main`. The explicitly empty case is
separately verified to omit `spec.components`; malformed false-y values
reach the Keycloak chart and are rejected by its existing `truststores
must be a list` validation.
- `make generate` has no target in `packages/core/platform`; there are
no generated platform schema artifacts to update.
- `make show` could not run because `cozyhr` is unavailable. A direct
`helm template` render of the system bundle was checked in a temporary
chart copy with `templates/repository.yaml` removed because its `lookup`
requires a live source. This verifies rendering and forwarding, not a
live-cluster deployment or an end-to-end Keycloak TLS connection.

### Screenshots

Not applicable; no UI changes.

### Downstream repositories

Changing `packages/core/platform/values.yaml` directly triggers the
website's hand-written platform-package reference. The existing
cozystack/website#765 follow-up covers both the chart-level value and
this platform configuration path, including
`content/en/docs/next/operations/configuration/platform-package.md`; no
other downstream trigger applies to 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/issues/765 (covers the
platform value and platform-package reference as well as the chart-level
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:

### Release note

```release-note
feat(platform): add `authentication.oidc.keycloakTruststores` so administrators can forward existing Secret or ConfigMap CA references from the platform Package to the bundled Keycloak server for private-CA LDAPS, external identity-provider, and SMTP TLS connections.
```


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

## Summary by CodeRabbit

* **New Features**
* Added the `authentication.oidc.keycloakTruststores` setting for
configuring additional CA certificates from Secrets or ConfigMaps in
`cozy-keycloak`. Certificate entries default to `ca.crt`, and configured
certificates apply across all Keycloak realms.
* The setting defaults to an empty list. Configured truststores are
passed to Keycloak when OIDC is enabled; when OIDC is disabled, the
setting is ignored and existing Keycloak package settings remain
unchanged.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-14 00:40:57 +03:00
Aleksei Sviridkin 233dee7049 docs(vpc): generate README parameters from values.yaml (#4944)
<!-- Thank you for making a contribution! Here are some tips for you:
- Use Conventional Commits for the PR title: `type(scope): description`
- Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore
- Scopes are not an exhaustive list — pick the most specific scope for
the change and extend the list when a genuinely new area appears.
Examples:
- System components: dashboard, platform, operator, cilium, kube-ovn,
linstor, fluxcd, cluster-api
- Managed apps: postgres, mariadb, redis, kafka, clickhouse,
virtual-machine, kubernetes
- Development and maintenance: api, hack, tests, ci, docs, maintenance
- Breaking changes: append `!` after type/scope (`feat(api)!: ...`) or
add a `BREAKING CHANGE:` footer
- If it's a work in progress, consider creating this PR as a draft.
- Don't hesistate to ask for opinion and review in the community chats,
even if it's still a draft.
- Add the label `kind/backport` if it's a bugfix that needs to be
backported to a previous version.
-->

## What this PR does

`packages/apps/vpc/Makefile` is the only app Makefile that calls
`cozyvalues-gen` without `-r README.md`, and it has been that way since
the app was added, so the README's Parameters table was hand-written and
never regenerated. It still documents `subnets` as `map[string]object`
and omits `peers` and `routes`, and the README example uses the map
form, which `values.schema.json` rejects since #2052 made `subnets` a
list. That README is also the source of the website's VPC reference
page, so the published example is the invalid one.

This adds `-r README.md`, regenerates the table with cozyvalues-gen
v1.7.0 (the version CI uses), and rewrites the example as a list. `make
generate` in `packages/apps/vpc` leaves the CRD and Go types unchanged,
and the new example validates against the VPC `openAPISchema`. The draft
#4813 edits this `values.yaml`, so once this lands its `make generate`
will update the README as well.

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

The website's VPC page is regenerated from this README by the release
bot, so it needs no separate change.

### 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
docs(vpc): document subnets, peers and routes in the VPC README as the list-based parameters the chart accepts.
```


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

## Summary by CodeRabbit

* **Documentation**
* Updated the VPC configuration guide to describe subnet entries,
including names, CIDR ranges, and optional allowed source ranges.
* Added guidance for configuring VPC peers with a remote VPC name and
tenant namespace, and routes with a destination range and next-hop IP.
  * Revised the subnet example to use a list of named entries.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-14 00:40:51 +03:00
Mattia Eleuteri 2568db67b1 Merge branch 'main' into fix/kubernetes-nodes-surge-before-drain
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
2026-11-13 22:40:18 +01:00
Aleksei Sviridkin 5dbfa1cfad fix(linstor): restore snapshots on a schedulable node (#5309)
## What this PR does

When linstor-csi restores a snapshot (a PVC with a `VolumeSnapshot` data
source, as the Velero data mover creates for every backup), it restores
it on exactly one node, and the new volume is pinned there. Two things
go wrong in how that node is chosen.

- The candidate filter is `slices.Contains(preferredNodes, snapNode)`,
but `preferredNodes` is the output of `SortByPreferred`, which holds
every node and only orders them. The filter therefore never filters, and
the node the scheduler selected for a `WaitForFirstConsumer` volume
(`preferredNodes[0]`) gets no priority. When the snapshot is not on that
node, the pod's `PreBind` fails with `node affinity doesn't match` and
needs another scheduling round. That happens even when the selected node
does hold the snapshot.
- `NodeAvailable` only checks that the LINSTOR satellite is `ONLINE`. A
cordoned Kubernetes node passes. A volume restored there can never be
used, because no new pod can be scheduled on that node: the pod stays
`Pending` until the node is uncordoned. On a production cluster with two
storage nodes cordoned ahead of a reboot, this failed 42 of 44 restores
that landed on those nodes, while 0 of 777 restores on the other nodes
failed. Each failure surfaced as a Velero `DataUpload` ending in
`timeout on preparing data upload`, although the snapshot also existed
on two schedulable replicas.

Patch `003-snapshot-restore-node-selection.diff` makes the controller:

- restore on the scheduler-selected node when it holds the snapshot;
- otherwise pick a random snapshot node, keeping the spreading that
`001-relocate-after-clone-restore.diff` introduced, but skip cordoned
nodes as long as another node holds the snapshot. When only cordoned
nodes hold it, behaviour is unchanged.

Cordon state is read from the Kubernetes `Node` object
(`spec.unschedulable`), through the in-cluster typed client that
`utils.KubernetesClient` already provides. The `linstor-csi-controller`
ServiceAccount already has `get` on `nodes` for the
external-provisioner. Outside Kubernetes, or when the lookup fails,
every node counts as schedulable, as before.

Tests: `TestLinstor_reconcileSnapshotResourcesSkipsCordonedNodes`
reproduces the production case through `reconcileSnapshotResources` with
mocked LINSTOR providers. Without the cordon check, 16 of 50 restores
landed on the cordoned node; with it, none do. `TestSelectRestoreNode`
covers the selected node, the cordoned selected node, only-cordoned
snapshot nodes, the preferred-node fallback and the spreading. The
Dockerfile runs `go test` in `pkg/client` as part of the image build.

### Downstream repositories

The diff only adds a patch under
`packages/system/linstor/images/linstor-csi/patches/`. I walked the
trigger map against it and found no entry that it matches.

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

### Release note

```release-note
fix(linstor): restore a snapshot on the node the scheduler selected when it holds the snapshot, and never on a cordoned node while another node holds it, so pods using a volume restored from a snapshot (such as Velero data mover backups) no longer stay Pending while a storage node is cordoned
```


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

## Summary by CodeRabbit

* **Bug Fixes**
* Snapshot restores now avoid cordoned nodes when another usable node is
available and prioritize preferred nodes when possible.
* Restore selection remains available when Kubernetes node information
is missing or lookup errors occur.
* When no preferred or schedulable node is available, restores can fall
back to any available node.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-14 00:13:49 +03:00
myasnikovdaniil a427ceb582 ci: run only the backport-batch tests for a backport-batch change (#5287)
## What this PR does

Stacked on #5288, merge that one first.

PR touching only `cmd/backport-batch` was treated as code change, so it
rebuilt every image, installed platform in e2e sandbox and ran full
chainsaw suite plus whole unit lane. #5283 (one-line test fix) spent 3.5
hours in that e2e and hit job timeout. And backport-batch go tests were
running on every code PR, whatever it touched.

- plan job `code` output is now false when every changed path is under
`docs/`, `cmd/backport-batch/` or `cmd/api-gate/` (CI-only tools, no
image builds them). Builds, finalize and e2e are skipped and `E2E Tests`
posted green, same as for docs-only PRs. `e2e-fork.yaml` skips on same
prefixes, `hack/gate-concurrency-contract.bats` fails if two lists
diverge.
- `hack/build-matrix.sh` and `hack/select-e2e.sh` don't escalate to full
rebuild or full suite because of these two dirs, so mixed PR is scoped
by its other paths. Other `cmd/` dirs still escalate.
- `test-backport-batch` removed from `make unit-tests`. Checks job runs
it only when diff touches path from `cmd/backport-batch/test-inputs.txt`
(tool itself, in-repo packages it imports, docs pages its tests read,
`go.mod`, `go.sum`). `TestInputsListed` compares this list with `go list
-deps -test` and fails when import is missing there.
- new `docs` output keeps bats lane for docs changes and drops it for
tool-only ones.
- includes test fix from #5283 (pin run attempt in
`TestReportDedupAndTrust`), this PR replaces it.

### Screenshots

### 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
ci: changes only in docs/, cmd/backport-batch/ or cmd/api-gate/ don't build images and don't run e2e anymore, backport-batch tests run only when their inputs change.
```

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

## Summary by CodeRabbit

* **Bug Fixes**
* CI now skips builds, E2E tests, and full-pipeline checks for changes
limited to documentation and designated CI-only tools.
* Backport-batch tests run when relevant files change, without being
included in the general unit-test target.
* Changes to other command-line tools continue to trigger the
appropriate build and E2E checks.

* **Documentation**
* Clarified how documentation, dashboard, and backport-batch changes
affect test selection.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-13 23:40:56 +03:00
myasnikovdaniil aa36d3fad6 fix(kubernetes)!: remove the talos block and other leftovers of the worker pool split (#5191)
## What this PR does

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

### Kubernetes

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

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

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

### KubernetesNodes

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

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

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

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

### The rule

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

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

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

## Summary by CodeRabbit

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

* **Documentation**
* Updated guidance for cluster and worker-pool settings, storage,
upgrades, and version compatibility.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-14 00:34:44 +05:00
Maxim Belyy b24a9b4cb9 Merge branch 'main' into feat/observability-proxy-exported-namespace
Resolve the overlap with the per-application roots: the namespace root
keeps its platform exporter branch, the application root still replaces
the whole scope with its own selectors, and the label APIs mark the
repeated scope so that replacement reaches match[] as well.

Assisted-by: LLM
Signed-off-by: Maxim Belyy <maximbel2003@gmail.com>
2026-11-14 00:49:51 +07:00
Aleksei Sviridkin 4f7eb63447 feat(observability-proxy): serve per-application logs and metrics (#5220)
## What this PR does

Depends on #5219. This PR is stacked on that branch; the description
covers only what it adds on top.

Adds the per-application roots to the observability proxy, as described
in the design proposals [Tenant application
logs](https://github.com/cozystack/community/pull/95) and [Tenant
resource-consumption
metrics](https://github.com/cozystack/community/pull/94):

```text
/apis/apps.cozystack.io/v1alpha1/namespaces/<ns>/<plural>/<name>/log/select/logsql/<endpoint>
/apis/apps.cozystack.io/v1alpha1/namespaces/<ns>/<plural>/<name>/metrics/api/v1/<endpoint>
```

This lets the console show the logs and resource consumption of one
application rather than of the whole namespace.

What is added:

- Plural-to-Kind mapping from an informer over `ApplicationDefinitions`.
The Kind is looked up only after the `SubjectAccessReview` (`get
<plural>/log` or `get <plural>/metrics`), so an unauthenticated caller
cannot probe which plurals exist. An unknown plural answers `404`; an
unsynced cache or a plural declared by two kinds answers `503`.
- Logs: a second `extra_stream_filters` value with the application Kind
and name, on top of the unchanged namespace filter. VictoriaLogs ANDs
the two, on every endpoint including `tail`.
- Metrics: the forced `extra_filters[]` becomes an OR of three branches,
each still bound to the namespace:
  1. series carrying the application identity labels;
  2. series of the application's pods, found through `kube_pod_labels`;
3. series of the application's PVCs, found through
`kube_persistentvolumeclaim_labels`.
- The pod and PVC lookups cap the number of names
(`--metrics-app-max-pods`, `--metrics-app-max-pvcs`); over the cap
answers `422`. A failed pod or PVC lookup fails the request (`502`, or
`504` on the deadline) rather than answer without the application's
series, and so does a lookup that vmselect marks `isPartial`, since a
storage node that did not answer leaves names out (a partial list
already over the cap still answers `422`); vmselect's series-limit
refusal of a lookup is passed through as `422`. A query that reads
further back than `--metrics-app-lookback` (default 720h, chart value
`observabilityProxy.metrics.appLookback`), or by an unknown amount, and
a query whose samples lie at a time the lookup cannot cover answer `422`
on the application root; this includes every query with an `@` modifier,
`WITH` with a negative offset, and offsets that are not plain durations.
The namespace root still serves them. `rollup_candlestick`, a backslash
or a `#` comment outside a string, an offset directly followed by a
minus (compound durations such as `-1h-30m` or `1h-2h`), and a subquery
step that is not a plain duration are refused as well. The lookup
reaches past the evaluation time by any negative offset and by two steps
per subquery level.
- Application routes require read access to the namespace root as well
as the application subresource; a grant narrowed with `resourceNames`
alone answers `403`.
- The proxy's ClusterRole gains `list`/`watch` on
`cozystack.io/applicationdefinitions`. No tenant RBAC change is needed:
the `view` role already allows `get` on every `apps.cozystack.io`
resource and subresource.
- `/readyz` now also waits for the `ApplicationDefinitions` cache, so a
missing CRD or RBAC rule keeps the whole proxy unready, namespace roots
included.

#### Data comes from the identity labels

The application roots find data only through identity labels added by
three PRs that are now in main:

- #5215 `feat(monitoring-agents)`: export PVC labels from
kube-state-metrics (PVC branch).
- #5216 `feat(monitoring)`: stamp application identity on scraped series
(identity branch).
- #5217 `feat(monitoring-agents)`: keep application identity in
container log streams (logs root).

Merge after #5219.

The pod branch does not depend on them, because `kube_pod_labels`
already exports all pod labels. Logs and series written before those
changes rolled out carry no identity and are reachable only through the
namespace root.

#### Security condition: a convenience filter, not an isolation boundary

The application roots narrow the namespace roots; they do not isolate
applications from each other. Each application route therefore requires
two grants: the application subresource (`get <plural>/log` or `get
<plural>/metrics`) and read access to the namespace root (`list
cozystack.io/logs` or `cozystack.io/metrics` in the namespace). A grant
narrowed with `resourceNames` alone is refused. Every tenant role that
can read applications already has both. The application scope cannot
isolate yet because:

1. The lineage webhook keeps `apps.cozystack.io/application.*` labels
that a user sets on a pod or PVC that has no application owner, so such
an object can claim another application's identity.
2. The webhook's `objectSelector` skips any object created with
`internal.cozystack.io/managed-by-cozystack`, pods included, so forged
labels on such an object are never examined.
3. The pod and PVC branches match by name over the lookup window, so an
object that reuses the name of another application's recently deleted
pod or PVC pulls that object's older series into scope.

The proposed fix (a separate change to the lineage webhook) is to strip
the identity labels when no owner resolves, and to stop skipping CREATE
requests for objects carrying the managed-by label.

#### Other known gaps

- PVCs created from a StatefulSet's `volumeClaimTemplates` usually get
no lineage labels, so their volume series are not in the application
scope.
- ingress-nginx series intentionally carry no application identity, so
they are reachable only through the namespace root.
- A request for an application that does not exist answers `200` with an
empty result rather than `404`: the proxy checks authorization, not
existence. Nothing leaks; whether a `404` is wanted is open for review.

#### How it was tested

- `go test -race` and `go vet` for the proxy packages, including a
narrowed-grant test (access to application `a` only): every application
path for `b` answers `403` and no request reaches the store. Name
escaping in the pod and PVC branches is covered for regex metacharacters
and quotes.
- helm-unittest for `observability-proxy` (new RBAC rule).
- Verified on a test cluster, with the three identity PRs above applied:
the application logs root of a Redis instance returned only that
instance's lines and none from a neighbouring pod in the same namespace;
its application metrics root returned only the Redis pods' series.

### Screenshots

No UI changes.

### Downstream repositories

- [ ] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
- [ ]
[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:

Downstream: no trigger matched. Candidate: none affected, because the
diff on top of #5219 is confined to the proxy's Go code and its own
chart RBAC; it reads `ApplicationDefinitions` but does not change their
semantics or the CRD. The security condition above may deserve a note in
the design proposals in `cozystack/community`, which is not a
trigger-map item.

### Release note

```release-note
feat(observability-proxy): add per-application logs and metrics roots under `/apis/apps.cozystack.io/v1alpha1/namespaces/<ns>/<plural>/<name>/{log,metrics}/`, scoped by application identity labels. Data appears for logs and series collected after the application identity changes to Fluent Bit, VMAgent and kube-state-metrics are rolled out.
```


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

## Summary by CodeRabbit

* **New Features**
* Added a tenant-aware observability proxy for logs and metrics, with
namespace and application scoping, access checks, and per-user request
limits.
* Enabled the proxy in the system package bundle and routed console log
and metrics requests through it.
* Added live log streaming and health, readiness, and metrics endpoints.
* **Bug Fixes**
* Invalid or excessive query parameters are rejected; requests with
uncertain application-metric scope are refused rather than returning
incomplete results.
* **Tests**
* Added end-to-end and integration coverage for tenant isolation,
console routing, access controls, and log streaming.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-13 20:47:10 +03:00