-
Notifications
You must be signed in to change notification settings - Fork 22
docs(development): describe operator-based and HelmRelease-based package patterns #413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -74,9 +74,15 @@ Core packages do not use Helm to apply manifests; they are intended to be used o | |||||
| ### [system](https://github.com/cozystack/cozystack/tree/main/packages/system) | ||||||
|
|
||||||
| System packages configure the system to manage and deploy user applications. The | ||||||
| necessary system components are specified in the bundle configuration. This can also | ||||||
| include components without an operator, whose installation can be triggered as part | ||||||
| of user applications. | ||||||
| necessary system components are specified in the bundle configuration. | ||||||
|
|
||||||
| System packages include two kinds of components: | ||||||
|
|
||||||
| - **Operators** (e.g., `postgres-operator`, `kafka-operator`, `redis-operator`): Controllers | ||||||
| that know how to manage the full lifecycle of a specific application, including day-2 operations. | ||||||
| - **Upstream Helm charts** for applications without a dedicated operator (e.g., `nats`, `ingress-nginx`): | ||||||
| These charts are placed in system so that apps and extra packages can deploy them | ||||||
| via Flux `HelmRelease` CRs, effectively using FluxCD as the operator. | ||||||
|
|
||||||
| {{% alert color="info" %}} | ||||||
| System packages use Helm to install and are managed by FluxCD. | ||||||
|
|
@@ -86,7 +92,42 @@ System packages use Helm to install and are managed by FluxCD. | |||||
|
|
||||||
| These user-facing applications appear in the dashboard and include manifests to be applied to the cluster. | ||||||
|
|
||||||
| They should not contain business logic, because they are managed by operators installed from system. | ||||||
| Apps charts serve as a high-level API for users. They define only the parameters that | ||||||
| should be exposed and validated through `values.schema.json`, keeping the interface | ||||||
| minimal and secure. Apps charts should not contain business logic for deploying the | ||||||
| application itself — instead they delegate to an operator or to FluxCD. | ||||||
|
|
||||||
| Depending on whether the application has a dedicated operator, apps follow one of two patterns: | ||||||
|
|
||||||
| #### Operator-based pattern | ||||||
|
|
||||||
| When an application has a dedicated operator (e.g., PostgreSQL, MongoDB, Redis, Kafka), | ||||||
| the app chart creates **CRD instances** that the operator manages: | ||||||
|
|
||||||
| ``` | ||||||
| packages/system/postgres-operator/ # Operator Helm chart | ||||||
| packages/apps/postgres/ # App chart creates postgresql.cnpg.io/v1.Cluster CRs | ||||||
| ``` | ||||||
|
Comment on lines
+107
to
+110
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add language specifiers to fenced code blocks. The fenced code blocks showing directory structure should include a language identifier for proper rendering and syntax highlighting. Consider using 📝 Proposed fixFor lines 107-110: -```
+```text
packages/system/postgres-operator/ # Operator Helm chart
packages/apps/postgres/ # App chart creates postgresql.cnpg.io/v1.Cluster CRsIn |
||||||
|
|
||||||
| The operator handles all deployment details and day-2 operations (scaling, backups, failover). | ||||||
| The app chart simply creates the appropriate CRD with values derived from user input. | ||||||
|
|
||||||
| #### HelmRelease-based pattern | ||||||
|
|
||||||
| When an application has no dedicated operator and a Helm chart is the standard deployment | ||||||
| method, the upstream chart is placed in `system/` and the app chart creates a | ||||||
| **Flux `HelmRelease` CR** pointing to it: | ||||||
|
|
||||||
| ``` | ||||||
| packages/system/nats/ # Upstream NATS Helm chart | ||||||
| packages/apps/nats/ # App chart creates helm.toolkit.fluxcd.io/v2.HelmRelease | ||||||
| ``` | ||||||
|
|
||||||
| In this case FluxCD acts as the operator, managing the Helm release lifecycle. The app | ||||||
| chart controls which upstream values are exposed to the user, providing an additional layer | ||||||
| of security — users cannot bypass validation to deploy the chart with arbitrary values. | ||||||
|
|
||||||
| Other examples of this pattern: `extra/ingress`, `extra/seaweedfs`, `extra/monitoring`. | ||||||
|
|
||||||
| ### [extra](https://github.com/cozystack/cozystack/tree/main/packages/extra) | ||||||
|
|
||||||
|
|
@@ -97,6 +138,8 @@ Read more about [Tenant System](/docs/guides/concepts/#tenant-system) on the Cor | |||||
|
|
||||||
| It is possible to use only one application type within a single tenant namespace. | ||||||
|
|
||||||
| Extra packages follow the same two architectural patterns as apps (operator-based or HelmRelease-based). | ||||||
|
|
||||||
| {{% alert color="info" %}} | ||||||
| Apps and extra packages use Helm for application and are installed from the dashboard and managed by FluxCD. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix grammar: use plural form. The phrase should use "applications" (plural) for grammatical correctness. ✏️ Proposed fix-Apps and extra packages use Helm for application and are installed from the dashboard and managed by FluxCD.
+Apps and extra packages use Helm for applications and are installed from the dashboard and managed by FluxCD.📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| {{% /alert %}} | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.