Commit Graph

1968 Commits

Author SHA1 Message Date
Andrei Kvapil
094ee6da55 Add AI-agent for changelogs generation
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2025-11-26 20:18:43 +01:00
Andrei Kvapil
f256575fce [docs] Add instructions for addressing AI bot reviewer comments (#1664)
## What this PR does

This PR adds instructions for AI agents on how to handle comments from
AI bot reviewers (like Qodo, Copilot, etc.).

Changes:
- Added new section "Addressing AI Bot Reviewer Comments" to
`docs/agents/contributing.md`
- Instructions on how to get PR comments using `gh pr view --comments`
- Guidelines on evaluating each comment carefully (don't blindly apply
all suggestions)
- Clear criteria for when to apply and when to skip AI bot suggestions
- Emphasis on leaving changes uncommitted for user review

Key principles:
- Evaluate each suggestion based on context, project conventions, and
impact
- Apply legitimate fixes but skip over-engineering or style mismatches
- Leave changes uncommitted so the user can review and decide

### Release note

```release-note
[docs] Add instructions for AI agents on handling AI bot reviewer comments
```



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

## Summary by CodeRabbit

* **Documentation**
* Added guidance for addressing AI bot reviewer comments in the
contributor guide.
  * Introduced comprehensive changelog generation procedures.

* **Chores**
  * Finalized v0.37.0 release.
* Enhanced release automation infrastructure with new tooling scripts
for repository checks and release note uploads.
  * Updated project documentation index.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-11-26 20:15:00 +01:00
Andrei Kvapil
d1ad38dd01 [docs] Add instructions for addressing AI bot reviewer comments
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2025-11-26 20:12:24 +01:00
Andrei Kvapil
bc1fed4079 [docs] Add AI agent documentation structure (#1663)
## What this PR does

This PR adds AI agent documentation structure to help AI coding
assistants work more effectively with the Cozystack codebase.

Changes:
- Added `AGENTS.md` in the root with an overview and agent documentation
table
- Created `docs/agents/` directory with specialized agent instructions:
  - `overview.md` - Project structure and conventions
  - `contributing.md` - Git workflow, commits, and pull requests
  - `releasing.md` - Release process (references `docs/release.md`)
- Organized documentation to make it easy for AI agents to find relevant
instructions

### Release note

```release-note
[docs] Add AI agent documentation structure with instructions for contributing, releasing, and project overview
```
2025-11-26 19:55:33 +01:00
Andrei Kvapil
0b29ffefe0 [docs] Add AI agent documentation structure
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2025-11-26 19:54:24 +01:00
Andrei Kvapil
aa428457db Release v0.38.0 (#1656)
This PR prepares the release `v0.38.0`.

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

## Summary by CodeRabbit

## Chores
* Updated image references and digests across multiple packages from
alpha prerelease versions to stable v0.38.0 releases, including updates
to kubevirt-csi-driver, cozystack-api, cozystack-controller, dashboard
components, kamaji, kubeovn modules, s3manager, and other system
packages.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-11-25 17:34:23 +01:00
cozystack-bot
975011e04e Prepare release v0.38.0
Signed-off-by: cozystack-bot <217169706+cozystack-bot@users.noreply.github.com>
2025-11-25 15:59:42 +00:00
Nikita
0d88aa394a scripts: fix 20 migration (#1653)
## What this PR does
Fixes wait conditions for 20 migration

### Release note
```release-note
Fixed wait condition for 20 migration
```
2025-11-25 18:34:03 +03:00
nbykov0
ec1a150d2c scripts: fix 20 migration
Signed-off-by: nbykov0 <166552198+nbykov0@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-11-25 17:37:16 +03:00
Nikita
cbc6cd2567 [extra] ingress: rm spaces from external ip list (#1652)
## What this PR does
Remove spaces while processing exposed-external-ips list in cozystack
configmap as they 1) are user-specified and 2) lead to an incorrect
resource being created from it.

### Release note
```release-note
Remove spaces while processing exposed-external-ips list in cozystack configmap
```
2025-11-25 16:48:26 +03:00
Andrei Kvapil
fb7e39eaab [cozy-lib] Improve flatten function (#1647)
This patch breaks introduces a helper function in cozy-lib to correctly
handle special case resources when transforming a nested map of limits
and requests to a flat map suitable for use in resourceQuotas. As a
result, admins can now specify any types of resources as resource quotas
for tenants, and they will be correctly transformed to the correct
format for the underlying kubernetes ResourceQuota. In addition to the
previously supported compute resources, such as CPU, memory, and custom
resources, like GPUs, special quota strings such as
"services.loadbalancers" are now correctly handled.

```release-note
[cozy-lib,platform] Support resource quotas for special kubernetes
quotas, such as service.loadbalncer count and others.
```

<!-- 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
[]
```
2025-11-25 14:48:03 +01:00
Andrei Kvapil
9cc348733f [ci,dx] Bump MariaDB operator version (#1646)
Update MariaDB operator to a new version.

```release-note
[ci,dx] Update MariaDB operator version
```

<!-- 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
[]
```

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

* **New Features**
* Support for external MariaDB instances and physical backups management
  * Validation webhook added for physical backups
  * New config option to specify MariaDB image registry/name

* **Updates**
  * MariaDB operator bumped to 25.10.2
  * Default MariaDB version updated from 11.4 to 11.8
* Expanded Kubernetes permissions for endpoint slices and volume
snapshots
  * Pod metadata label added to MariaDB pods

* **Documentation**
  * Updated docs links and version badges in charts README

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-11-25 14:46:50 +01:00
Nikita
00e0f45de3 Increase strimzi memory limit (#1651)
## What this PR does
Increase strimzi memory limit

### Release note
```release-note
Increased strimzi memory limit
```
2025-11-25 16:46:07 +03:00
Andrei Kvapil
b5c264de7d [cozy-lib] Fix malformed ResourceQuota rendering for LoadBalancer services (#1642)
This patch adds special handling for raw Kubernetes ResourceQuota
fields, such as `services.loadbalancers`, preventing them from being
wrapped as `limits.*` or `requests.*` keys by the flatten helper. This
ensures that LoadBalancer quotas render correctly in tenant
specifications.

```release-note
[cozy-lib] Correctly render services.loadbalancers in ResourceQuota without limits.* or requests.* prefixes.
```

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

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

* **Refactor**
* Resource flattening now handles compute and quota keys separately:
compute values are sanitized/flattened, quota-like inputs are emitted
directly as plain YAML.

* **Documentation**
* Added in-template comments and clarified examples for resource
processing behavior.

* **New Features**
* CI now runs unit tests; new test targets and test harnesses added
along with a test chart and test cases for quota handling.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-11-25 14:45:50 +01:00
Andrei Kvapil
4ff60e4539 [linstor] Update Piraeus Operator to v2.10.1 to enable RWX support (#1650)
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>

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

This PR updates Piraeus Operator to enable RWX support released in
https://github.com/piraeusdatastore/piraeus-operator/releases/tag/v2.10.0

### 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
[linstor] Update Piraeus Operator to v2.10.1 to enable RWX support
```

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

## Summary by CodeRabbit

* **New Features**
* Added NFS server component and affinity controller support for
enhanced storage configuration
* Expanded kubectl output with additional status columns for improved
cluster visibility
* Added support for pod labels, annotations, and security context
customization

* **Chores**
  * Updated Helm chart to version 2.10.1
* Updated multiple component versions including CSI provisioner,
snapshotter, DRBD reactor, and other dependencies

* **Documentation**
* Updated README to reference external Helm-based deployment guidelines

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-11-25 14:44:39 +01:00
Andrei Kvapil
294458e7c4 [ci,dx] Add unit tests for cozy-lib (#1643)
## What this PR does

The cozy-lib library package got complicated enough to warrant its own
unit tests. Since unit tests are a "good thing" (tm), a somewhat generic
framework for running all kinds of unit tests was introduced into the CI
pipeline and Makefile targets. For now all it runs is `make test`
against the `packages/{library,apps,system,extra}/*` directories,
wherever a `test` target is present in the Makefile, and for now this is
only for the `cozy-lib` Helm library chart.

### Release note

```release-note
[ci,dx] Introduce a scaffold for running unit tests locally and in CI
and add the first unit tests for the cozy-lib helper Helm chart.
```


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

## Summary by CodeRabbit

* **Tests**
* Integrated Helm chart unit tests into the CI/CD pipeline for automated
validation.
* Established test infrastructure for cozy-lib package with test cases
for quota configuration and resource validation.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-11-25 14:43:55 +01:00
nbykov0
42cb0e6974 [extra] ingress: nospaces for external ip list
Signed-off-by: nbykov0 <166552198+nbykov0@users.noreply.github.com>
2025-11-24 20:31:34 +03:00
nbykov0
73bf0e5f7e Increase strimzi memory limit
Signed-off-by: nbykov0 <166552198+nbykov0@users.noreply.github.com>
2025-11-24 19:57:57 +03:00
IvanHunters
f512061a1c add access to kubeapi from mysql agent
Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
2025-11-24 19:46:21 +03:00
Andrei Kvapil
12db4fc520 [linstor] Update Piraeus Operator to v2.10.1 to enable RWX support
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2025-11-24 10:51:21 +01:00
Timofei Larkin
91ddbb06ef [cozy-lib] Improve flatten function
This patch breaks introduces a helper function in cozy-lib to correctly
handle special case resources when transforming a nested map of limits
and requests to a flat map suitable for use in resourceQuotas. As a
result, admins can now specify any types of resources as resource quotas
for tenants, and they will be correctly transformed to the correct
format for the underlying kubernetes ResourceQuota. In addition to the
previously supported compute resources, such as CPU, memory, and custom
resources, like GPUs, special quota strings such as
"services.loadbalancers" are now correctly handled.

```release-note
[cozy-lib,platform] Support resource quotas for special kubernetes
quotas, such as service.loadbalncer count and others.
```

Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2025-11-21 17:41:21 +03:00
IvanHunters
7d2250be4d [ci,dx] Bump MariaDB operator version
Update MariaDB operator to a new version.

```release-note
[ci,dx] Update MariaDB operator version
```

Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
2025-11-21 14:50:25 +03:00
IvanHunters
a070573af9 fix flatten for tests
Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
2025-11-20 12:01:49 +03:00
IvanHunters
492aef93f5 fix flatten with rabbit recomendation
Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
2025-11-20 10:55:47 +03:00
IvanHunters
23e6cf735a fix flatten with rabbit recomendation
Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
2025-11-20 10:55:47 +03:00
IvanHunters
c5b1177149 fix flatten with rabbit recomendation
Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
2025-11-20 10:55:47 +03:00
IvanHunters
84133ef2d3 [cozy-lib] Fix malformed ResourceQuota rendering for LoadBalancer services
This patch adds special handling for raw Kubernetes ResourceQuota fields,
such as `services.loadbalancers`, preventing them from being wrapped as
`limits.*` or `requests.*` keys by the flatten helper. This ensures that
LoadBalancer quotas render correctly in tenant specifications.

```release-note
[cozy-lib] Correctly render services.loadbalancers in ResourceQuota without limits.* or requests.* prefixes.
```

Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
2025-11-20 10:55:47 +03:00
Timofei Larkin
1c9ae2bec5 [ci,dx] Add unit tests for cozy-lib
## What this PR does

The cozy-lib library package got complicated enough to warrant its own
unit tests. Since unit tests are a "good thing" (tm), a somewhat generic
framework for running all kinds of unit tests was introduced into the CI
pipeline and Makefile targets. For now all it runs is `make test`
against the `packages/{library,apps,system,extra}/*` directories,
wherever a `test` target is present in the Makefile, and for now this is
only for the `cozy-lib` Helm library chart.

### Release note

```release-note
[ci,dx] Introduce a scaffold for running unit tests locally and in CI
and add the first unit tests for the cozy-lib helper Helm chart.
```

Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2025-11-19 17:56:17 +03:00
Timofei Larkin
bdff61eaed Release v0.38.0-alpha.2 (#1639)
This PR prepares the release `v0.38.0-alpha.2`.

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

## Summary by CodeRabbit

* **Chores**
* Updated container image references across system components from
v0.38.0-alpha.1 to v0.38.0-alpha.2, including kubevirt-csi-driver,
cozystack-api, cozystack-controller, dashboard, kamaji, kubeovn, and
related services.
  * Updated corresponding image digests to reflect new component builds.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-11-18 12:26:44 +04:00
cozystack-bot
3d4ad39bce Prepare release v0.38.0-alpha.2
Signed-off-by: cozystack-bot <217169706+cozystack-bot@users.noreply.github.com>
2025-11-18 07:46:42 +00:00
Timofei Larkin
f2f575b450 [dashboard] Introduce VNC console (#1627)
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>

<!-- 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
[dashboard] Introduce VNC console
```

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

## Summary by CodeRabbit

* **New Features**
* Added VNC tab for accessing VirtualMachine and VMInstance resources
directly from the dashboard

* **Chores**
  * Updated base images and builder references
* Enhanced proxy configuration with improved header handling and
extended connection timeouts

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-11-18 11:39:58 +04:00
Timofei Larkin
aba4d2c977 Merge branch 'main' into vnc
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2025-11-18 11:39:34 +04:00
Timofei Larkin
e4021bbf57 [vpc] Fix access to subnet details configmap (#1638)
## What this PR does

The VPC chart incorrectly used the wrong template for the subjects that
should have access to the configmap info resource. This patch grants
this access to all subjects at or above a certain access level, rather
than just at a specific level.

### Release note

```release-note
[vpc] Grant read access to the subnets configmap to all users inside a
tenant.
```

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

## Summary by CodeRabbit

* **Refactor**
* Enhanced role binding generation to better incorporate access level
information in subject configuration and access control setup.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-11-17 20:39:03 +04:00
Timofei Larkin
ef8612e882 [vpc] Fix access to subnet details configmap
## What this PR does

The VPC chart incorrectly used the wrong template for the subjects that
should have access to the configmap info resource. This patch grants
this access to all subjects at or above a certain access level, rather
than just at a specific level.

### Release note

```release-note
[vpc] Grant read access to the subnets configmap to all users inside a
tenant.
```

Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2025-11-17 19:00:41 +03:00
Nikita
32b58dec5f [apps] vpc: fix typo in README (#1637)
## What this PR does
VPC: fixed a typo in README

### Release note

```release-note
VPC: fixed a typo in README
```
2025-11-17 14:51:56 +03:00
Nikita
1bafb7fb4f [apps] vpc: fix typo in README
VPC: fixed a typo in README

Signed-off-by: Nikita <166552198+nbykov0@users.noreply.github.com>
2025-11-17 13:23:45 +03:00
Timofei Larkin
bc61d13ad3 Release v0.38.0-alpha.1 (#1635)
This PR prepares the release `v0.38.0-alpha.1`.
2025-11-14 14:17:36 +04:00
cozystack-bot
972548cab4 Prepare release v0.38.0-alpha.1
Signed-off-by: cozystack-bot <217169706+cozystack-bot@users.noreply.github.com>
2025-11-14 08:45:28 +00:00
Timofei Larkin
bb8d07d384 [vpc,dashboard] Print subnet details as table (#1621)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* VPC subnets are now displayed in the dashboard details view with
dedicated information blocks
* Subnet data is presented with improved formatting and structured
columns for better visibility
  * Access controls updated to support proper subnet data permissions
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-11-14 03:53:17 +04:00
Timofei Larkin
6fdc9b0bad [vpc,dashboard] Expose subnet details in dashboard
## What this PR does

To use the new VPC feature, users need to pass the subnet ID to the VMs
they wish to launch in a given VPC/subnet. As the dashboard cannot
compute the subnet ID in the same manner as the Helm template, a helper
configmap is created, containing the details of the subnets attached to
a given VPC. This configmap is queried by the dashboard frontend to
render those details to the user.

### Release note

```release-note
[vpc,dashboard] Expose subnet details to end-user in the dashboard.
```

Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2025-11-13 19:10:22 +03:00
Timofei Larkin
9c040cd42f [api] Fix representation of dynamic list kinds (#1630)
## What this PR does

This patch fixes an issue with the Cozystack API server that causes it
to respond with the first registered dynamic list kind when listing
dynamic resources. E.g., when running `k get postgreses`, the raw JSON
response from the cozystack API would be

```json
{
  "apiVersion":"apps.cozystack.io/v1alpha1",
  "kind":"BootBoxList",
  "items": [
    {
      "apiVersion":"apps.cozystack.io/v1alpha1",
      "kind":"Postgres",
      ...
    },
    ...
  ],
  ...
}
```

The root cause is the way the `Typer` interface is implemented for the
`runtime.Scheme` where the dynamic types are registered. Since the base
type for all dynamic types is a `&cozyv1alpha1.Application{}`, all types
are registered under the same key and the `Typer` defaults to the first
`GroupVersionKind` that was registered. Only when a correctly formed
`&unstructured.Unstructured{}` is returned by the API, is this resolving
logic circumvented and the `GroupVersionKind` is instead inferred from
the fields of the returned object. Even an `UnstructuredList` is not
acceptable as a return type, instead the `items` key should be directly
set on the underlying `map[string]interface{}`.

This patch implements the changes detailed above. Additionally, the
following features, fixes, and improvements are added:

* Makefile targets to build and run the Cozystack API locally, against a
Kubernetes server in the environment's KUBECONFIG. Debugging with Delve
is also supported.
* CI tests are added to verify the new changes.
* A bug in the registration of the corev1alpha1 types is fixed.
* Updated the `ConvertToTable` function to properly handle list kinds
which might be of the `&unstructured.Unstructured{}` concrete type (not
an `UnstructuredList`).
* The scheme used by the API server's Client and WatchClient is
separated from the scheme used to serve dynamic types.
* The client config for reading the runtime configuration now uses the
controller-runtime, which handles flags and environment variables
properly, unlike `clientcmd`.

### Release note

```release-note
[api] Fix incorrect list kind for list requests to the Cozystack API for
dynamic resources. Add Makefile targets for local testing. Minor schema
building improvements.
```

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

* **Tests**
* Added an end-to-end test validating Kubernetes API kinds for tenants
and ingresses.

* **Chores**
* Improved local development: ignore local API server config, added
run/debug targets with local TLS tooling, and added an OpenSSL config
for CSR generation.

* **Refactor**
* Internal API server and registry storage reworked; may affect
integrations expecting concrete resource types.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-11-13 19:52:50 +04:00
Timofei Larkin
5414d37376 [api] Fix representation of dynamic list kinds
## What this PR does

This patch fixes an issue with the Cozystack API server that causes it
to respond with the first registered dynamic list kind when listing
dynamic resources. E.g., when running `k get postgreses`, the raw JSON
response from the cozystack API would be

```json
{
  "apiVersion":"apps.cozystack.io/v1alpha1",
  "kind":"BootBoxList",
  "items": [
    {
      "apiVersion":"apps.cozystack.io/v1alpha1",
      "kind":"Postgres",
      ...
    },
    ...
  ],
  ...
}
```

The root cause is the way the `Typer` interface is implemented for the
`runtime.Scheme` where the dynamic types are registered. Since the base
type for all dynamic types is a `&cozyv1alpha1.Application{}`, all types
are registered under the same key and the `Typer` defaults to the first
`GroupVersionKind` that was registered. Only when a correctly formed
`&unstructured.Unstructured{}` is returned by the API, is this resolving
logic circumvented and the `GroupVersionKind` is instead inferred from
the fields of the returned object. Even an `UnstructuredList` is not
acceptable as a return type, instead the `items` key should be directly
set on the underlying `map[string]interface{}`.

This patch implements the changes detailed above. Additionally, the
following features, fixes, and improvements are added:

* Makefile targets to build and run the Cozystack API locally, against a
  Kubernetes server in the environment's KUBECONFIG. Debugging with
  Delve is also supported.
* CI tests are added to verify the new changes.
* A bug in the registration of the corev1alpha1 types is fixed.
* Updated the `ConvertToTable` function to properly handle list kinds
  which might be of the `&unstructured.Unstructured{}` concrete type
  (not an `UnstructuredList`).
* The scheme used by the API server's Client and WatchClient is
  separated from the scheme used to serve dynamic types.
* The client config for reading the runtime configuration now uses the
  controller-runtime, which handles flags and environment variables
  properly, unlike `clientcmd`.

### Release note

```release-note
[api] Fix incorrect list kind for list requests to the Cozystack API for
dynamic resources. Add Makefile targets for local testing. Minor schema
building improvements.
```

Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2025-11-13 18:04:33 +03:00
Timofei Larkin
a9818a7ce7 [kubernetes] Cleanup loadbalancer services (#1631)
## What this PR does

Similar to an earlier issue with DataVolumes remaining after deleting
the tenant k8s cluster using them, a similar problem is observed with
LoadBalancer services consuming external IPs. This patch adds another
step to the cleanup Helm hook to delete any such services.

### Release note

```release-note
[kubernetes] Add a cleanup hook to delete LoadBalancer services after
deleting the tenant Kubernetes cluster that they were servicing.
```

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

## Summary by CodeRabbit

* **New Features**
* Added automatic cleanup of LoadBalancer services during resource
deletion workflows.

* **Chores**
  * Updated resource naming conventions for consistency.
* Extended service management permissions in access control
configurations.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-11-13 18:16:58 +04:00
Timofei Larkin
1651d94291 [kubernetes] Cleanup loadbalancer services
## What this PR does

Similar to an earlier issue with DataVolumes remaining after deleting
the tenant k8s cluster using them, a similar problem is observed with
LoadBalancer services consuming external IPs. This patch adds another
step to the cleanup Helm hook to delete any such services.

### Release note

```release-note
[kubernetes] Add a cleanup hook to delete LoadBalancer services after
deleting the tenant Kubernetes cluster that they were servicing.
```

Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2025-11-13 16:27:34 +03:00
Nikita
2b4afde373 [system] multus: update to the latest version (#1628)
## What this PR does
Fixes #1623 

### Release note
```release-note
Multus updated to the latest version to address race condition during startup.
```

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

## Summary by CodeRabbit

* **Chores**
  * Updated kube-multus container to version v4.2.3-thick.
* Increased memory resource allocation from 100Mi to 300Mi for improved
stability and performance.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-11-13 16:13:55 +03:00
Nikita
a5c9bfabee [system] kubeovn: increase limits (#1629)
## What this PR does
Increases kube-ovn-cni limits

### Release note
```release-note
Increased kube-ovn-cni limits so that it is not oomkilled during startup on busy nodes.
```
2025-11-13 16:13:23 +03:00
nbykov0
143832c0b4 [system] kubeovn: increase limits
Signed-off-by: nbykov0 <166552198+nbykov0@users.noreply.github.com>
2025-11-13 14:50:11 +03:00
nbykov0
298206efc7 [system] multus: update to the latest version
Signed-off-by: nbykov0 <166552198+nbykov0@users.noreply.github.com>
2025-11-13 14:24:52 +03:00
Andrei Kvapil
c81b222cf6 [dashboard] Introduce VNC console
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2025-11-13 00:57:40 -05:00
Andrei Kvapil
9d6af84449 [rbac] Fix permissions for high-privilege users (#1622)
## What this PR does

This patch grants "admin" permissions to super-admins, "use" permissions
to admins and super-admins, "view" permissions to "use"-privileged
users, admins, and super-admins. Previously lower-privileged roles were
not assigned to higher-privileged users, so a viewer could excercise
their basic read-only permissions which were not available to
high-privilege users. This patch corrects the template function used to
generate subjects in rolebindings, fixing the issue.

### Release note

```release-note
[rbac] Fix issue of privileged users not having low-privilege read-only
permissions.
```

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

## Summary by CodeRabbit

* **Bug Fixes**
* Updated access level handling in role-based authorization to ensure
proper permission evaluation across tenant environments.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-11-12 09:46:18 -05:00