Commit graph

2899 commits

Author SHA1 Message Date
Timofei Larkin
482255a7f1 [cozystack-scheduler] Publish SchedulingClass demo
## What this PR does

Publish the scripts used for running the Cozystack scheduler demo at the
community meetup on 19.03.2026.

### Release note

```release-note
[cozystack-scheduler] Add demo scripts to the cozystack-scheduler system
packages.
```
2026-03-20 11:15:52 +03:00
Aleksei Sviridkin
4bdc7241af
[kube-ovn] Fix MASTER_NODES for multi-master generic Kubernetes clusters (#2245)
## What this PR does

Removes the `apiServerEndpoint` fallback for `MASTER_NODES` in the
`isp-full-generic` variant.

When `MASTER_NODES` is not explicitly set (the default), the template
used to parse a single IP from `apiServerEndpoint` and pass it to
kube-ovn. This prevented kube-ovn from discovering all control-plane
nodes, breaking OVN RAFT consensus on multi-master clusters
(`ovn-central` crashed with `host ip X not in env NODE_IPS`).

Now kube-ovn uses its built-in Helm `lookup` to find all control-plane
nodes by the `MASTER_NODES_LABEL`
(`node-role.kubernetes.io/control-plane=true`), correctly discovering
all masters.

Explicit `MASTER_NODES` override via platform values is preserved.

The `isp-full` (Talos) variant is not affected — it uses a separate code
path.

Fixes #2242

### Release note

```release-note
[kube-ovn] Fix multi-master support for generic Kubernetes clusters by letting kube-ovn auto-discover control-plane nodes by label instead of falling back to a single API server IP
```

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

## Summary by CodeRabbit

* **New Features**
* Introduced support for automatic control plane node discovery using
Kubernetes node labels, providing greater flexibility and scalability
options for cluster configurations.

* **Bug Fixes**
* Removed unreliable automatic node configuration fallback logic to
improve overall deployment consistency and predictability. Master nodes
now require explicit configuration or automatic discovery through
Kubernetes node labels.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-19 13:27:14 +03:00
Timofei Larkin
caeb6aac7d
[vpc] Add VPC peering support for multi-tenant environments (#2152)
## Summary

- Add bilateral VPC peering using Kube-OVN's native `vpcPeerings`
mechanism
- Auto-allocate link-local peering IPs (`169.254.0.0/16`)
deterministically from sorted VPC pair hash
- Add static routes support (`staticRoutes`) for fine-grained inter-VPC
routing
- Enrich ConfigMap with peer discovery info
- Add JSON Schema validation with `^tenant-` namespace pattern
enforcement

Closes #2151

## How it works

Each tenant independently declares peers in their VPC spec. The template
computes the remote VPC's internal ID using the same deterministic hash
formula, and derives complementary peering IPs from a sorted pair key.
Kube-OVN only activates the peering tunnel when **both sides** declare
each other — no custom controller needed.

Example (Tenant A):
```yaml
spec:
  subnets:
    - name: web
      cidr: "172.16.0.0/24"
  peers:
    - vpcName: "backend-vpc"
      tenantNamespace: "tenant-beta"
```

## Test plan

- [ ] `helm template` without peers → no `vpcPeerings` in output
(backward compatible)
- [ ] `helm template` with peers → correct `vpcPeerings` with
auto-allocated IPs
- [ ] Reciprocal peering: both sides reference each other with
complementary IPs in same /30
- [ ] Schema rejects `tenantNamespace` not matching `^tenant-`
- [ ] Deploy two VPCs with reciprocal peering on a live cluster →
Kube-OVN activates tunnel
- [ ] Remove one side → peering deactivated

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* **New Features**
* VPC Peering: declare peer VPCs (tenant + name) to enable conditional
peering and automatic per-peer connection entries.
* Per-peer metadata: subnet/config outputs include peer-specific
connection details (remote VPC ID and local connect IP).
* Static Routes: optionally add custom CIDR routes with next-hop IPs for
a VPC.
* Values/schema: configuration and schema now accept peers and routes
arrays.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-19 11:18:57 +04:00
Andrei Kvapil
1f304210be
docs: add changelog for v1.0.6 (#2248)
This PR adds the changelog for release `v1.0.6`.

 Changelog has been automatically generated in
`docs/changelogs/v1.0.6.md`.

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

## Summary by CodeRabbit

## Release Notes v1.0.6

* **Bug Fixes**
  * Resolved multi-node storage volume publication issues
  * Fixed dashboard authentication to properly sync credentials
* Enhanced etcd stability during cluster upgrades to prevent service
interruptions

* **Documentation**
  * Added new guides for authentication configuration
  * Published v1.0 release announcement blog post

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-19 08:00:20 +01:00
Andrei Kvapil
cb622f54ca
docs: add changelog for v1.1.3 (#2238)
This PR adds the changelog for release `v1.1.3`.

 Changelog has been automatically generated in
`docs/changelogs/v1.1.3.md`.

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

## Summary by CodeRabbit

* **Bug Fixes**
* Improved Kubernetes CiliumNetworkPolicy handling for multi-node RWX
scenarios
  * Enhanced Keycloak client secret reconciliation for the dashboard
  * Optimized etcd defrag CronJob behavior during system upgrades

* **Documentation**
  * Updated authentication configuration documentation

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-19 07:59:55 +01:00
Timofei Larkin
55f6882387 [cozy-lib] Add a hexToInt helper
Simplifies parsing sha256 digits to decimals for the VPC peering
feature.

Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2026-03-19 07:29:50 +03:00
cozystack-bot
2237f9114c docs: add changelog for v1.0.6
Signed-off-by: cozystack-bot <217169706+cozystack-bot@users.noreply.github.com>
2026-03-19 01:43:04 +00:00
cozystack-bot
ea82c5e658 docs: add changelog for v1.1.3
Signed-off-by: cozystack-bot <217169706+cozystack-bot@users.noreply.github.com>
2026-03-19 01:43:00 +00:00
Timofei Larkin
f1ba62d4f1
[cozystack-scheduler] Update to v0.2.0 (#2244)
## What this PR does

Update the Cozystack scheduler to its latest version, supporting
automatic placement of label selectors for affinity and topology spread
constraints.

### Release note

```release-note
[cozystack-scheduler] Update Cozystack scheduler to v0.2.0 with support
for reusable affinity terms.
```

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

## Summary by CodeRabbit

* **New Features**
* Added support for configurable default label selector keys to
customize scheduler behavior.

* **Chores**
* Updated scheduler component to version 0.2.0 with refreshed container
image.
  * Enhanced Kubernetes permissions for scheduling class access.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-18 22:07:39 +04:00
Andrei Kvapil
ef4667548c
[platform] Ensure cozystack-packages OCIRepository updates reliably (#2246)
## What this PR does

When only leaf packages change (accounting, dashboard, etc.) but the
platform chart
itself remains unchanged, the Flux ArtifactGenerator produces an
ExternalArtifact with
the same content digest. This prevents the platform HelmRelease from
reconciling, so
`lookup()` in `repository.yaml` never runs and `cozystack-packages`
OCIRepository does
not pick up the new OCI digest.

This PR writes a content-based hash of the working tree state to
`core/platform/.build-revision` before pushing the OCI artifact,
ensuring the platform
chart content always changes on every build.

### Release note

```release-note
[platform] Fixed cozystack-packages OCIRepository not updating when only leaf packages change
```

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

## Summary by CodeRabbit

* **Chores**
* Improved build system infrastructure with enhanced revision tracking
and artifact management configuration.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-18 18:54:39 +01:00
Andrei Kvapil
a3e7a59356
fix(csi): hide disk.img and lost+found from RWX NFS mounts (#2243)
## Changes

Mount the `/data` subdirectory of the NFS export instead of the root
filesystem in `NodePublishVolume`, so tenant pods no longer see internal
LINSTOR/CDI artifacts (`disk.img`, `lost+found`) in their RWX PVC mount
points.

### Backward compatibility

On first mount after upgrade, any existing user files at the NFS root
are automatically migrated into `/data`. Internal artifacts (`disk.img`,
`lost+found`, `data`) are skipped. This is transparent to the user.

### How it works

1. Temp-mount the NFS root to a scratch directory
2. Create `/data` subdirectory if it doesn't exist
3. Move any user files from root into `/data` (migration for pre-fix
volumes)
4. Unmount the temp mount
5. Mount `<nfs-export>/data` at the pod's target path

## Test plan

- [ ] Create a new RWX PVC on a tenant cluster → `ls` shows no
`disk.img` or `lost+found`
- [ ] Write a file from one pod, read it from another pod on a different
node
- [ ] Mount a pre-existing RWX PVC (created before fix) → user data is
migrated into `/data` automatically
- [ ] `go build ./...` passes in
`packages/apps/kubernetes/images/kubevirt-csi-driver/`
- [ ] `make generate` passes at repo root

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

* **Bug Fixes**
* NFS mounts now expose only the data subdirectory, hiding internal
artifacts and avoiding clutter at mount targets.
  * Existing read-only and already-mounted behaviors preserved.
* User files on existing mounts are migrated into the data subdirectory
during transition to avoid data loss; migration failures now cause the
publish to fail to protect data.
* Improved error handling, cleanup, and detailed logging during mount,
migration, and unmount steps.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-18 18:28:54 +01:00
Andrei Kvapil
c689367755
[postgres-operator] Update to v1.27.3 (#2226)
<!-- Thank you for making a contribution! Here are some tips for you:
- Start the PR title with the [label] of Cozystack component:
- For system components: [platform], [system], [linstor], [cilium],
[kube-ovn], [dashboard], [cluster-api], etc.
- For managed apps: [apps], [tenant], [kubernetes], [postgres],
[virtual-machine] etc.
- For development and maintenance: [tests], [ci], [docs], [maintenance].
- 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 `backport` if it's a bugfix that needs to be backported
to a previous version.
-->

## What this PR does
upgrades CNPG operator to v1.27.3

Used chart version 0.27.1. Image in default values set to 1.27.3. The
default App version for this chart is 1.28.1.

### Release note

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

```release-note
[postgres-operator] Update to v1.27.3
```

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

* **New Features**
* Deployment update strategy and topologySpreadConstraints for operator
pods
* Webhook startupProbe support and new database mutation/validation
webhooks
  * Monitoring: added pg_extensions query and target_databases
  * Expanded RBAC to include failoverquorums and image/catalog resources
  * Namespace templating standardized across manifests

* **Bug Fixes**
  * Corrected documentation typo

* **Chores**
* Helm chart bumped to v0.26.1 / appVersion 1.27.1; operator image tag
set to 1.27.3
  * Added SPDX license headers and updated README badges and docs
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-18 18:14:39 +01:00
Kirill Ilin
08676b9c05
fix(installer): add build revision marker to trigger platform reconciliation
When only leaf packages change but the platform chart remains unchanged,
the Flux ArtifactGenerator produces an ExternalArtifact with the same
content digest. This prevents the platform HelmRelease from reconciling,
so lookup() in repository.yaml never runs and cozystack-packages
OCIRepository does not pick up the new OCI digest.

Write a content-based hash of the working tree state to
core/platform/.build-revision before pushing the OCI artifact, ensuring
the platform chart content always changes on every build.

Assisted-By: Claude AI
Signed-off-by: Kirill Ilin <stitch14@yandex.ru>
2026-03-18 21:37:23 +05:00
mattia-eleuteri
4978458a26
fix(csi): fail publish when migration cannot complete
ReadDir and Rename errors during migration are now hard failures
instead of warnings, preventing user data from becoming invisible
behind the /data subpath mount. Tolerate os.IsNotExist on Rename
for concurrent publish calls that already moved the file.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: mattia-eleuteri <mattia@hidora.io>
2026-03-18 16:11:28 +01:00
Timofei Larkin
91e15b343f [cozystack-scheduler] Update to v0.2.0
## What this PR does

Update the Cozystack scheduler to its latest version, supporting
automatic placement of label selectors for affinity and topology spread
constraints.

### Release note

```release-note
[cozystack-scheduler] Update Cozystack scheduler to v0.2.0 with support
for reusable affinity terms.
```

Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2026-03-18 18:05:51 +03:00
mattia-eleuteri
247f89dffd
fix(csi): address review comments on temp mount and error handling
- Use os.MkdirTemp instead of predictable path (fixes race condition/TOCTOU)
- Use defer for cleanup (unmount + remove temp dir)
- Handle os.ReadDir and os.Rename errors with klog warnings
- Log unmount failures instead of ignoring them

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: mattia-eleuteri <mattia@hidora.io>
2026-03-18 15:36:32 +01:00
Aleksei Sviridkin
7c2c804810
fix(kubeovn): let kube-ovn discover master nodes by label on multi-master clusters
Remove the apiServerEndpoint fallback for MASTER_NODES in the
isp-full-generic variant. When MASTER_NODES is not explicitly set,
kube-ovn now uses its built-in Helm lookup to find all control-plane
nodes by the MASTER_NODES_LABEL, correctly discovering all masters
instead of just the single API server IP.

The previous fallback always produced a single IP (the API endpoint),
which broke OVN RAFT consensus on multi-master clusters because
ovn-central was configured with only one node in NODE_IPS.

Explicit MASTER_NODES override is preserved for users who need it.

Fixes: #2242

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-03-18 17:05:09 +03:00
mattia-eleuteri
276879dcf8
fix(csi): restore klog debug statements
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: mattia-eleuteri <mattia@hidora.io>
2026-03-18 15:04:56 +01:00
mattia-eleuteri
4861d59852
fix(csi): hide disk.img and lost+found from RWX NFS mounts
Mount the /data subdirectory of the NFS export instead of the root,
so pods no longer see internal LINSTOR/CDI artifacts (disk.img,
lost+found). On first mount after upgrade, any existing user files
at the NFS root are automatically migrated into /data.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: mattia-eleuteri <mattia@hidora.io>
2026-03-18 15:02:33 +01:00
Timofei Larkin
7ab6283c14
feat(scheduler): integrate SchedulingClass support for tenant workloads (#2223)
## What this PR does

Adds infrastructure support for restricting tenant workloads to specific
data centers (or node groups) via SchedulingClass CRs.

- Adds `schedulingClass` parameter to the Tenant model, inherited by
child
  tenants (children cannot override parent's scheduling constraints)
- Adds `scheduling.cozystack.io/class` label to tenant namespaces
- Adds SchedulingClass dropdown to the Tenant creation form in the
dashboard
- Extends lineage-controller-webhook to inject `schedulerName:
cozystack-scheduler`
and `scheduler.cozystack.io/scheduling-class` annotation into all Pods
in
  namespaces with the scheduling label
- Webhook verifies the referenced SchedulingClass CR exists before
injection;
  if missing (scheduler not installed), pods are left untouched

### Operators without native schedulerName support

The following operators do not support `schedulerName` in their CRDs,
but are still covered by the webhook-based approach since it mutates
pods directly:

- etcd-operator
- redis-operator (spotahome)
- mariadb-operator
- clickhouse-operator (altinity)

### Release note

```release-note
[scheduler] Add SchedulingClass support for tenant workloads.
Administrators can assign a SchedulingClass to a tenant, restricting
where its workloads are scheduled. The lineage-controller-webhook
injects the custom scheduler into all pods in the tenant namespace.
```

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

* **New Features**
* Added a schedulingClass parameter for tenant configuration; it can be
set in values, appears in schema/docs, inherits to namespaces, and is
included in exported tenant manifests.
* When present, the schedulingClass is propagated to namespace metadata
and applied to workloads so scheduler selection and scheduling
annotations reflect the setting.

* **Bug Fixes**
* Improved owner-resolution and labeling so resources and scheduling are
associated more accurately.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-18 16:32:32 +04:00
Timofei Larkin
bdeb3a7e8c feat(lineage-webhook): import scheduling constants from cozystack-scheduler
Import SchedulingClassAnnotation, SchedulingClassLabel, SchedulerName,
and GVR components from the cozystack-scheduler/pkg/apis sub-module
instead of defining them locally. This ensures the webhook and scheduler
stay in sync on label/annotation keys.

Also standardize the namespace label from scheduling.cozystack.io/class
to scheduler.cozystack.io/scheduling-class for consistency with the
scheduler, and resolve scheduling class from the owner Application CR
(via a new SchedulingClass() stub method) before falling back to the
namespace label.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2026-03-18 14:08:29 +03:00
Andrei Kvapil
199ccfc246
[dashboard] Add secret-hash annotation to KeycloakClient for secret sync (#2231)
## What this PR does

Adds a `secret-hash` annotation to the dashboard `KeycloakClient` CRD
resource containing the SHA256 hash of the client secret value.

Without this annotation, if the `dashboard-client` Kubernetes Secret is
recreated with a new value (e.g. after upgrade or reinstall), the
`KeycloakClient` spec remains unchanged, the EDP Keycloak operator skips
reconciliation, and Keycloak retains the stale secret — causing
authentication failures for the dashboard.

With the annotation, any change to the secret value updates the hash in
metadata, triggering operator reconciliation and syncing the new secret
to Keycloak.

This aligns the implementation with cozyportal, where the same pattern
is already used.

### Release note

```release-note
[dashboard] Fix dashboard-client secret desynchronization with Keycloak after upgrades by adding secret-hash annotation to KeycloakClient resource
```

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

## Summary by CodeRabbit

* **Chores**
* Enhanced authentication service configuration metadata tracking to
improve system management and operational reliability.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-18 11:23:23 +01:00
Andrei Kvapil
a0f60d4377
[apps] Add managed OpenSearch service (#1953)
## Summary
- Add `packages/apps/opensearch/` — managed OpenSearch application chart
with multi-version support (v1/v2/v3), TLS, HTTP Basic auth, custom
users, OpenSearch Dashboards, external access, topology spread policies
- Add `packages/system/opensearch-operator/` — wrapper around opster
OpenSearch operator v2.8.0 with sysctl daemonset for `vm.max_map_count`
- Add `packages/system/opensearch-rd/` — ApplicationDefinition for
Cozystack platform integration (dashboard UI, schema validation,
resource exposure)

## Details
- **Versions**: v1 → 1.3.20, v2 → 2.11.1, v3 → 3.0.0
- **Security**: Auto-generated admin credentials, TLS on transport +
HTTP, bcrypt-hashed security config
- **Dashboards**: Optional deployment with TLS, configurable replicas
and resources
- **External access**: LoadBalancer services for OpenSearch (9200) and
Dashboards (5601) with DNS annotations
- **Tests**: Comprehensive Helm test suite (opensearch, security, users)

## Test plan
- [x] `helm template` renders correctly with default values
- [x] `helm template` renders correctly with dashboards, external
access, and custom users enabled
- [ ] Deploy on a test cluster with the operator installed
- [ ] Verify OpenSearch cluster reaches green status
- [ ] Verify Dashboards connectivity
- [ ] Verify external access via LoadBalancer

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* **New Features**
* Managed OpenSearch charts and operator with CRDs, RBAC, external
LoadBalancer services, per-user secrets, security/config secrets,
dashboards, and a sysctl DaemonSet.

* **Documentation**
* New chart READMEs, values.yaml, and JSON schema documenting
configuration, defaults, and version mappings.

* **Tests**
* Extensive manifest tests covering rendering, security, users, storage,
topology, and version selection.

* **Chores**
* Build tooling, Makefiles, packaging ignores, and version update
scripts added.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-18 11:22:00 +01:00
Matthieu
2c34dbc042
[opensearch] Add validation to ensure at least one node role is enabled
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Matthieu <matthieu@hidora.com>
2026-03-18 10:08:12 +01:00
Andrei Kvapil
f1cbb38aa7
[etcd] Add protective limits to defrag CronJob (#2233)
## What this PR does

Adds missing protective limits to the etcd defrag CronJob to prevent job
accumulation during cluster upgrades.

After upgrading CozyStack to v1.1.2, defrag CronJobs accumulated
hundreds of running/failed pods across tenants because etcd was
temporarily unavailable during the upgrade. Without `concurrencyPolicy:
Forbid`, new jobs kept being created hourly while previous ones were
still failing.

Changes:
- `concurrencyPolicy: Forbid` — prevent parallel defrag jobs
- `startingDeadlineSeconds: 300` — don't catch up on missed schedules
older than 5 minutes
- `failedJobsHistoryLimit: 1` — limit failed job retention
- `activeDeadlineSeconds: 1800` — 30 minute timeout per job
- `backoffLimit: 2` — limit retries to 2 instead of default 6

### Release note

```release-note
[etcd] Fix defrag CronJob accumulating hundreds of pods during cluster upgrades by adding concurrencyPolicy, job timeout, and retry limits
```

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

## Summary by CodeRabbit

* **Chores**
* Updated etcd defragmentation job configuration to enhance reliability
and operational stability in production environments. New controls
prevent concurrent job executions to avoid resource contention, enforce
startup and execution deadlines, limit retry attempts for failed
operations, and maintain failure history for improved monitoring and
troubleshooting. These improvements ensure more predictable and stable
defragmentation operations.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-17 17:36:07 +01:00
Matthieu
fc6bb0feea
[opensearch] Regenerate schema after make generate
The required fields in schema are auto-generated by cozyvalues-gen
and must be kept in sync.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Matthieu <matthieu@hidora.com>
2026-03-17 13:33:01 +01:00
Matthieu
bb660b57c7
[opensearch] Address PR review feedback
Remove sysctl DaemonSet in favor of operator's built-in setVMMaxMapCount
init container, fix schema conflicts with required+empty default, fix
update-versions.sh YAML output format, and use $(MAKE) in Makefile.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Matthieu <matthieu@hidora.com>
2026-03-17 11:20:44 +01:00
Kirill Ilin
ed8ba3beec
fix(etcd): add protective limits to defrag CronJob
Without concurrencyPolicy and job limits, the defrag CronJob can
accumulate hundreds of running/failed pods during cluster upgrades
when etcd is temporarily unavailable. This was observed after
upgrading to v1.1.2 where defrag jobs piled up across tenants.

Assisted-By: Claude AI
Signed-off-by: Kirill Ilin <stitch14@yandex.ru>
2026-03-17 13:21:28 +05:00
Kirill Ilin
bb5ee3ea4a
[dashboard] Add secret-hash annotation to KeycloakClient for secret sync
Add secret-hash annotation to the dashboard KeycloakClient CRD resource
so that when the Kubernetes Secret value changes, the operator detects
the CRD update and reconciles the client secret in Keycloak.

Without this annotation, if the dashboard-client Secret is recreated
with a new value (e.g. after upgrade), the KeycloakClient spec remains
unchanged, the operator skips reconciliation, and Keycloak retains the
stale secret — causing authentication failures for the dashboard.

Assisted-By: Claude AI
Signed-off-by: Kirill Ilin <stitch14@yandex.ru>
2026-03-17 12:35:39 +05:00
Dmitrii Popov
845192b933 [postgres-operator] Update to v1.27.3
Signed-off-by: Dmitrii Popov <dmpopof@gmail.com>
2026-03-17 01:59:28 +03:00
Dmitrii Popov
1edbb4af97 [postgres-operator] Update to v1.27.3
Signed-off-by: Dmitrii Popov <dmpopof@gmail.com>
2026-03-17 01:23:39 +03:00
Andrei Kvapil
9fb9354fd2
[kubernetes] Fix CiliumNetworkPolicy endpointSelector for multi-node RWX volumes (#2227)
## What this PR does

When an NFS-backed RWX volume is published to multiple VMs, the
`CiliumNetworkPolicy` `endpointSelector.matchLabels` only included the
first VM. Subsequent `ControllerPublishVolume` calls added
`ownerReferences` but never broadened the selector, causing Cilium to
block NFS egress — mounts hang on all nodes except the first.

This PR switches from `matchLabels` to `matchExpressions` (`operator:
In`) so the selector can list multiple VM names, and rebuilds it
whenever ownerReferences are added or removed.

### Release note

```release-note
[kubernetes] Fixed CiliumNetworkPolicy endpointSelector not being updated when NFS-backed RWX volumes are published to multiple VMs, which caused NFS mounts to hang on all nodes except the first.
```

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

## Summary by CodeRabbit

* **New Features**
* KubeVirt CSI driver now supports selecting and targeting multiple
virtual machines for volume publishing.

* **Improvements**
* Network policy targets are rebuilt automatically when VM ownership
references change, improving correctness and lifecycle handling in
multi-VM scenarios.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-16 17:21:46 +01:00
Andrei Kvapil
23bc8525be
[monitoring] Add inlineScrapeConfig support to tenant vmagent (#2200)
## Summary

- Adds `inlineScrapeConfig` support to the tenant `VMAgent` resource in
`packages/system/monitoring/templates/vm/vmagent.yaml`
- Adds commented usage example in both
`packages/system/monitoring/values.yaml` and
`packages/extra/monitoring/values.yaml`

## Problem

The tenant VMAgent resource does not support custom scrape
configurations. Using `additionalScrapeConfigs` (which references a
Kubernetes Secret) is not viable because tenant users have no access to
create or read Secrets — they can only manage resources under
`apps.cozystack.io`. Instead, `inlineScrapeConfig` accepts inline YAML
directly through Helm values, which is consistent with tenant
permissions.

Relates to #2194

## Usage

```yaml
vmagent:
  inlineScrapeConfig: |
    - job_name: "custom"
      static_configs:
        - targets: ["my-service:9090"]
```

## Test plan

- [ ] `helm template` monitoring with `inlineScrapeConfig` set — block
rendered
- [ ] `helm template` monitoring without it — no `inlineScrapeConfig` in
output
- [ ] Deploy and verify custom scrape targets are picked up by vmagent

```release-note
Add inlineScrapeConfig support to tenant vmagent
```

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

## Summary by CodeRabbit

* **New Features**
* Support for including an inline scrape configuration into VMAgent
monitoring when provided.

* **Documentation**
* Added a commented example showing how to supply an inline scrape job
and targets.
* Reordered remote-write URL entries in monitoring configuration for
clearer ordering.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-16 14:56:15 +01:00
Andrei Kvapil
3fef40e9f7
[dashboard] Add keycloakInternalUrl for backend-to-backend OIDC requests (#2224)
## What this PR does

Adds `authentication.oidc.keycloakInternalUrl` platform value that
allows oauth2-proxy
in the dashboard to route backend calls (token exchange, JWKS, userinfo,
logout) through
an internal cluster URL while keeping browser redirects on the external
Keycloak URL.

When set, oauth2-proxy uses `--skip-oidc-discovery` and explicit
endpoint URLs pointing
to the internal Keycloak service. This avoids external DNS lookups and
TLS overhead for
pod-to-pod communication.

Fully backward-compatible: when the value is empty (default), behavior
is unchanged.

### Release note

```release-note
[dashboard] Added `authentication.oidc.keycloakInternalUrl` platform value to route oauth2-proxy backend requests through internal Keycloak service URL, bypassing external DNS and TLS.
```

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

## Summary by CodeRabbit

* **New Features**
* Added configuration support for an internal KeyCloak URL, enabling
backend authentication requests to be routed through an alternative
endpoint while maintaining existing external URLs for browser
interactions.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-16 14:54:41 +01:00
mattia-eleuteri
cc5ec0b7a3
[kubernetes] Fix CiliumNetworkPolicy endpointSelector for multi-node RWX volumes
When an NFS-backed RWX volume is published to multiple VMs, the
CiliumNetworkPolicy egress rule only allowed traffic from the first VM.
The endpointSelector.matchLabels was set once on creation and never
broadened, causing NFS mounts to hang on all nodes except the first.

Switch from matchLabels to matchExpressions (operator: In) so the
selector can list multiple VM names. Rebuild the selector whenever
ownerReferences are added or removed.

Signed-off-by: mattia-eleuteri <mattia@hidora.io>
2026-03-16 14:45:04 +01:00
Andrey Kolkov
38d58a77dc
Fix/backups (#2149)
<!-- Thank you for making a contribution! Here are some tips for you:
- Start the PR title with the [label] of Cozystack component:
- For system components: [platform], [system], [linstor], [cilium],
[kube-ovn], [dashboard], [cluster-api], etc.
- For managed apps: [apps], [tenant], [kubernetes], [postgres],
[virtual-machine] etc.
- For development and maintenance: [tests], [ci], [docs], [maintenance].
- 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 `backport` if it's a bugfix that needs to be backported
to a previous version.
-->

## What this PR does


### Release note

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

```release-note
[backups] Added fix to roles and changed backupstrategy-controller location
```

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

## Summary by CodeRabbit

* **Chores**
  * Updated backup controller namespace configuration.
* Enhanced backup controller permissions for leader election and event
recording capabilities.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-16 17:31:06 +04:00
Andrei Kvapil
47dbbb9538
feat(linstor): add linstor-csi patches for clone/snapshot relocation (#2133)
## Summary

- Remove merged RWX validation patch (`001-rwx-validation.diff`)
- Add new patch (`001-relocate-after-clone-restore.diff`) that includes:
  - Randomized node selection for snapshot restore
- `linstor.csi.linbit.com/relocateAfterClone` StorageClass parameter to
relocate replicas to optimal nodes after clone
- `snap.linstor.csi.linbit.com/relocate-after-restore`
VolumeSnapshotClass parameter to relocate replicas to optimal nodes
after snapshot restore
- Both parameters are **disabled by default**
- Placing the snapshot restore parameter in VolumeSnapshotClass prevents
unwanted relocation when Velero creates temporary PVCs during data mover
backup

Upstream PRs:
- https://github.com/piraeusdatastore/linstor-csi/pull/418
- https://github.com/piraeusdatastore/linstor-csi/pull/419

## Test plan

- [x] Clone a PVC and verify relocation logic executes
- [x] Restore a PVC from snapshot and verify replicas get migrated to
optimal nodes
- [x] Verified on dev5 cluster (3-node) — snapshot restore triggered
actual migration (node0 → node2)

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

## Release Notes

* **New Features**
* Automatic resource relocation after clone and restore operations
optimizes storage placement and load balancing across nodes.
* RWX block attachment validation with optional disable flag ensures
proper multi-pod access control.

* **Chores**
  * Updated CDI clone strategy to use CSI-clone for improved efficiency.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-16 13:04:24 +01:00
Andrei Kvapil
37050922f2
docs: add changelog for v1.1.2 (#2220)
This PR adds the changelog for release `v1.1.2`.

 Changelog has been automatically generated in
`docs/changelogs/v1.1.2.md`.

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

## Summary by CodeRabbit

* **Bug Fixes**
  * Fixed S3 Manager endpoint alignment with BucketInfo secrets
  * Resolved spurious OpenAPI post-processing errors on startup

* **Documentation**
  * Added troubleshooting guidance for DependenciesNotReady
  * Enhanced installation documentation with Ansible guide
  * Added CA rotation operations documentation
  * Improved backup and recovery guidance
  * Expanded metrics and architecture references
  * Reorganized operator-first installation guidance

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-16 09:38:53 +01:00
Matthieu
2482586127
[opensearch] Fix PR review issues: YAML keys and DaemonSet naming
Fix versions.yaml to use unquoted keys for valid YAML mapping, and
use release-based naming for sysctl DaemonSet to avoid conflicts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Matthieu <matthieu@hidora.com>
2026-03-16 09:30:06 +01:00
Kirill Ilin
689c2a5e4a
feat(dashboard): add keycloakInternalUrl for backend-to-backend OIDC requests
When set, oauth2-proxy skips OIDC discovery and routes all backend calls
(token exchange, JWKS, userinfo, logout) through the internal cluster URL
while keeping browser redirects on the external URL. This avoids external
DNS lookups and TLS overhead for pod-to-pod communication with Keycloak.

Assisted-By: Claude AI
Signed-off-by: Kirill Ilin <stitch14@yandex.ru>
2026-03-16 11:03:55 +05:00
cozystack-bot
7e0a059d34 docs: add changelog for v1.1.2
Signed-off-by: cozystack-bot <217169706+cozystack-bot@users.noreply.github.com>
2026-03-16 01:43:05 +00:00
Kirill Ilin
7c59b6dc51
chore(tenant): generate readme and app definition for schedulingClass support
Signed-off-by: Kirill Ilin <stitch14@yandex.ru>
2026-03-15 22:39:49 +05:00
Kirill Ilin
43d49b6e46
feat(lineage-webhook): verify SchedulingClass CR before injection
Before injecting schedulerName and annotation, the webhook now
checks that the referenced SchedulingClass CR actually exists.
If the CRD is not installed or the CR is missing, injection is
skipped so that pods are not stuck Pending on a non-existent
scheduler.

Assisted-By: Claude AI
Signed-off-by: Kirill Ilin <stitch14@yandex.ru>
2026-03-15 22:33:43 +05:00
Kirill Ilin
1024ee7607
feat(lineage-webhook): inject schedulerName for tenant scheduling
When a namespace carries the scheduling.cozystack.io/class label,
the webhook injects schedulerName=cozystack-scheduler and the
scheduler.cozystack.io/scheduling-class annotation into every Pod.
This covers all workloads in the tenant namespace regardless of
whether the operator CRD supports schedulerName natively.

Assisted-By: Claude AI
Signed-off-by: Kirill Ilin <stitch14@yandex.ru>
2026-03-15 22:27:35 +05:00
Kirill Ilin
6046a31e8c
feat(tenant): add scheduling.cozystack.io/class label to namespace
The label is read by the lineage-controller-webhook to inject
schedulerName and scheduling-class annotation into all pods
in the tenant namespace.

Assisted-By: Claude AI
Signed-off-by: Kirill Ilin <stitch14@yandex.ru>
2026-03-15 22:26:02 +05:00
Kirill Ilin
0387fae62c
feat(dashboard): add SchedulingClass dropdown for Tenant form
Add an API-backed listInput dropdown for the schedulingClass field
in the Tenant creation form. The dropdown lists available
SchedulingClass CRs from cozystack.io/v1alpha1.

Assisted-By: Claude AI
Signed-off-by: Kirill Ilin <stitch14@yandex.ru>
2026-03-15 22:08:01 +05:00
Kirill Ilin
b821c0748e
feat(tenant): add schedulingClass parameter for tenant workloads
Allow administrators to assign a SchedulingClass CR to a tenant.
The schedulingClass is inherited by child tenants and cannot be
overridden once set by a parent.

Assisted-By: Claude AI
Signed-off-by: Kirill Ilin <stitch14@yandex.ru>
2026-03-15 22:00:25 +05:00
Andrei Kvapil
ee8533647b
docs: add changelog for v1.0.5 (#2221)
This PR adds the changelog for release `v1.0.5`.

 Changelog has been automatically generated in
`docs/changelogs/v1.0.5.md`.

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

## Summary by CodeRabbit

* **Bug Fixes**
* Resolved spurious error messages in OpenAPI post-processing for
certain configurations.

* **Documentation**
  * Enhanced troubleshooting guides and installation instructions.
  * Expanded operational procedures for backups and CA rotation.
* Added custom metrics collection guidance and architecture
documentation.
  * Completed comprehensive v1 documentation refresh.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-13 18:30:18 +01:00
cozystack-bot
b3f356a5ed docs: add changelog for v1.0.5
Signed-off-by: cozystack-bot <217169706+cozystack-bot@users.noreply.github.com>
2026-03-13 15:41:31 +00:00
Andrei Kvapil
ffd6e628e2
fix(api): skip OpenAPI post-processor for non-apps group versions (#2212)
## What this PR does

The OpenAPI `PostProcessSpec` callback is invoked for every registered
group-version (apps, core, version, etc.), but the Application schema
cloning logic only applies to `apps.cozystack.io`. When called for other
GVs the base Application schemas are absent, producing a spurious error
on every API server start:

```
ERROR klog Failed to build OpenAPI v3 for group version, "base Application* schemas not found"
```

This PR changes the post-processor (both v2 and v3) to return early
when the base schemas are not found, instead of returning an error.

### Release note

```release-note
[platform] Fix spurious "base Application* schemas not found" error logged on cozystack-api startup
```

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

## Summary by CodeRabbit

* **Bug Fixes**
* Improved error handling for missing OpenAPI schema components. The
system now gracefully continues processing instead of halting when
certain base schemas are unavailable.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-13 16:23:18 +01:00