Skip to content

Conversation

@kvaps
Copy link
Member

@kvaps kvaps commented Jan 6, 2026

Replace HelmRelease-based bundle system with Package resources managed by cozystack-operator. Restructure values.yaml with full configuration support.

What this PR does

  • Restructure values.yaml with full configuration (networking, publishing, authentication, scheduling, branding, resources)
  • Add values-isp-full.yaml and values-isp-hosted.yaml for bundle variants
  • Create templates/packages/isp-full.yaml with Package resources
  • Move PackageSources from sources/ to templates/sources/
  • Remove old bundle files and HelmRelease templates
  • Add hack/migrate-to-version-1.0.sh migration script for converting ConfigMaps to Package resource

Release note

[platform] Migrate from HelmRelease bundles to Package-based deployment

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 6, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @kvaps, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a fundamental shift in how the platform's components are deployed and managed. It transitions from a HelmRelease-driven system to a more modular and operator-managed Package resource model. This change aims to streamline the definition, configuration, and lifecycle management of various platform services, offering greater flexibility and consistency across different deployment variants. The update includes comprehensive restructuring of configuration, new resource definitions for various applications, and a migration path for existing setups.

Highlights

  • Deployment Refactoring: The platform's deployment mechanism has been significantly refactored, moving away from HelmRelease-based bundles to a new system utilizing Package resources managed by the cozystack-operator.
  • Configuration Restructuring: The values.yaml file has been completely restructured to provide a comprehensive configuration for networking, publishing, authentication, scheduling, branding, and resources. New values-isp-full.yaml and values-isp-hosted.yaml files are introduced for specific bundle variants.
  • New Application Definitions: Numerous new ApplicationDefinition files have been added across IaaS, NaaS, and PaaS categories (e.g., bucket, kubernetes, http-cache, clickhouse, mysql), defining how these applications are managed as Package resources.
  • Bundle Definitions: New bundle.yaml files for IaaS, NaaS, and PaaS components, along with system bundle variants (bundle-full.yaml, bundle-hosted.yaml, bundle-minimal.yaml), have been introduced to define the structure and dependencies of these new Package-based deployments.
  • Migration Script: A new migration script, hack/migrate-to-version-1.0.sh, has been added to assist in converting existing cozystack, cozystack-branding, and cozystack-scheduling ConfigMaps into the new Package resource format.
  • HelmRelease Removal: Old HelmRelease templates and bundle files (e.g., distro-full.yaml, paas-full.yaml, helmreleases.yaml) have been removed, signifying the complete transition to the Package-based deployment model.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a significant and well-structured refactoring of the deployment system, migrating from a HelmRelease-based approach to a more modular Package-based system managed by cozystack-operator. The changes are extensive, including a complete overhaul of values.yaml for better configuration management, the introduction of bundle variants, and the creation of a migration script to ease the transition for existing users. This is a great improvement for the project's maintainability. I've identified a critical issue that would break deployments, along with several medium severity issues that should be addressed to improve code quality and robustness. My detailed feedback is in the comments below.

dependsOn: [cilium]
values:
cozystack:
nodesHash: {{ include "cozystack.master-node-ips" . | sha256sum }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The helper cozystack.master-node-ips used here has been removed from packages/core/platform/templates/_helpers.tpl. This will cause the Helm chart rendering to fail. This line needs to be fixed or removed.

# This script converts cozystack, cozystack-branding, and cozystack-scheduling
# ConfigMaps into a Package resource with the new values structure.

set -e
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better script robustness, it's recommended to use set -euo pipefail instead of just set -e.

  • e: exits the script if a command fails.
  • u: exits the script if an unset variable is used.
  • o pipefail: causes a pipeline to return the exit status of the last command in the pipe that returned a non-zero status.

This will make the script safer and prevent unexpected behavior.

Suggested change
set -e
set -euo pipefail

ROOT_HOST=$(echo "$COZYSTACK_CM" | jq -r '.data["root-host"] // "example.org"')
API_SERVER_ENDPOINT=$(echo "$COZYSTACK_CM" | jq -r '.data["api-server-endpoint"] // ""')
OIDC_ENABLED=$(echo "$COZYSTACK_CM" | jq -r '.data["oidc-enabled"] // "false"')
TELEMETRY_ENABLED=$(echo "$COZYSTACK_CM" | jq -r '.data["telemetry-enabled"] // "true"')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The variable TELEMETRY_ENABLED is extracted from the ConfigMap but is not used anywhere in the script. This unused variable should be removed to improve code clarity.

Comment on lines 40 to 41
- matchLabels:
apps.cozystack.io/user-service: "true"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The matchLabels selector apps.cozystack.io/user-service: "true" is very generic. This could lead to unintentionally selecting services from other applications within the same tenant if they happen to use the same label. To prevent such conflicts, it's safer to use a more specific label selector that includes the instance name, for example by adding a label like app.kubernetes.io/instance: "{{ .name }}" to the services created by the vm-instance chart and matching on it here.

Comment on lines 71 to 77
- name: vpc
path: apps/vpc
libraries: [cozy-lib]

- name: virtualprivatecloud
path: apps/vpc
libraries: [cozy-lib]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There appears to be a duplicate artifact definition. Both vpc and virtualprivatecloud point to the same path apps/vpc. Since there is an ApplicationDefinition named virtualprivatecloud.yaml, the vpc artifact seems redundant and should be removed to avoid confusion.

path: extra/ingress
libraries: [cozy-lib]
- name: ingress-system
path: system/ingress
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The path for the ingress-system artifact is system/ingress, which is inconsistent with bundle-full.yaml where it is system/ingress-nginx. Please ensure this path is correct.

@kvaps kvaps changed the title refactor(platform): restructure values and migrate to Package-based d… [platform] Migrate from HelmRelease bundles to Package-based deployment Jan 6, 2026
@kvaps kvaps force-pushed the remove-assets-server branch from 5c8a6e2 to 725f703 Compare January 6, 2026 16:42
@kvaps kvaps force-pushed the restructure-values-and-packages branch 3 times, most recently from 0ee5fb0 to fccd1e8 Compare January 6, 2026 18:56
@kvaps kvaps force-pushed the restructure-values-and-packages branch from 7a73887 to d812b02 Compare January 13, 2026 22:25
Fix getVersion to parse "0.1.4+abcdef" format (with "+" separator)
instead of incorrectly looking for "sha256:" prefix.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@kvaps kvaps changed the base branch from remove-assets-server to show-only-hash-in-api-version January 14, 2026 11:09
@kvaps kvaps force-pushed the restructure-values-and-packages branch from ab73b49 to 282ee7c Compare January 14, 2026 11:41
@kvaps
Copy link
Member Author

kvaps commented Jan 14, 2026

record 282ee7c0bc5e2cde717e30ca1e5cf2ec318c2fb1 as green pipeline before squashing commits

@kvaps kvaps force-pushed the restructure-values-and-packages branch from 282ee7c to da61548 Compare January 14, 2026 14:56
Replace the chart field with chartRef for referencing Helm charts via
ExternalArtifact resources. This enables the Package controller to
manage chart sources centrally.

Changes:
- Add chartRef field to CozystackResourceDefinition spec
- Remove chart field (deprecated)
- Remove validation (moved to controller)
- Update lineage mapper for new field structure
- Regenerate openapi specs

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@kvaps
Copy link
Member Author

kvaps commented Jan 14, 2026

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 14, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@kvaps
Copy link
Member Author

kvaps commented Jan 14, 2026

/retest

@kvaps kvaps marked this pull request as ready for review January 15, 2026 00:49
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. enhancement New feature or request labels Jan 15, 2026
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not be here

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 15, 2026
kvaps and others added 4 commits January 15, 2026 14:14
Remove legacy installer components (cozystack-assets-server,
installer.sh script, cozystack container image) in favor of
cozystack-operator based deployment.

Move migration scripts from scripts/migrations/ to
packages/core/platform/images/migrations/ for containerized execution.

Add grafana-dashboards image for centralized dashboard management.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
Update all CozystackResourceDefinition files to use chartRef
with ExternalArtifact instead of OCIRepository sourceRef.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
Restructure platform bundles from monolithic files to modular
directory structure with separate applicationdefinitions.

Add PackageSources for better dependency management and
migrate from legacy HelmRepositories to new repository format.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
Add dedicated flux-tenants controller with label selector
--watch-label-selector=sharding.fluxcd.io/key=tenants to handle
tenant workloads separately from platform components.

Update all kubernetes app HelmReleases to:
- Use chartRef with ExternalArtifact instead of OCIRepository sourceRef
- Add sharding.fluxcd.io/key=tenants label
- Add cozystack.io/target-cluster-name label

Update fluxinstall to parse multiple YAML manifest files and
use flux service for storage-adv-addr.

Add cozystack-basics package for core tenant/namespace setup.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@kvaps kvaps force-pushed the restructure-values-and-packages branch from da61548 to 22cd8f1 Compare January 15, 2026 13:16
@kvaps kvaps changed the base branch from show-only-hash-in-api-version to main January 15, 2026 13:16
@kvaps kvaps merged commit fd54647 into main Jan 15, 2026
21 of 22 checks passed
@kvaps kvaps deleted the restructure-values-and-packages branch January 15, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants