mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-30 04:06:34 +09:00
## What this PR does This PR adds installation defaults for applications: administrator sets `applicationDefaults` in the platform values, and every application created after that starts from them. Design is in [the proposal in cozystack/community](https://github.com/cozystack/community/pull/116), related to [the worker defaults issue](https://github.com/cozystack/cozystack/issues/3950). The value is keyed by ApplicationDefinition plural (for example `postgreses`) and the platform chart renders it into the `cozystack-application-defaults` ConfigMap in `cozy-system`. The aggregated API merges the entry for the kind under the submitted spec on create, apply-create and dry-run create, and saves the result in HelmRelease values. The order is user values, installation defaults, then developer defaults from the chart schema. Update never applies defaults, so changing the value leaves existing applications alone. The merge goes into objects that declare `properties` and replaces everything else whole: arrays, dictionaries with `additionalProperties`, free-form objects, objects that also take arbitrary keys and objects marked `x-kubernetes-map-type: atomic`. So a node pool that sets its own `registryMirrors` gets no platform mirror entries. Explicit empty values from the user (`{}`, `[]`, `false`, `0`, `""`) win over the installation value. An entry is checked against the application's OpenAPI schema before it is merged. An object that the merge completes is checked as a partial one, so `required` and `minProperties` are not enforced on it and its `oneOf` is not evaluated (CEL rules are not evaluated at all). Whatever is stored whole is checked whole: array rows, dictionary values, free-form and atomic objects. Without that, an entry like a RabbitMQ vhost without `roles` was accepted and stored, and the chart refused to render it. A missing ConfigMap means no defaults and gives no warning. An unreadable ConfigMap, invalid JSON, a bad entry or an unreadable schema does not block the create: defaults are skipped and the response carries a Warning (dry-run too). The generic checks cover the whole map, so one entry that is not an object, or a reserved top-level field in any entry, turns defaults off for every application until it is fixed, while a bad entry of one application only affects that application. The ConfigMap is read through a cache limited to that one object, startup waits up to 30 s for it to sync and a create waits up to 5 s for the read, then both go on without defaults. Some objects take exactly one of their children and the chart refuses two: the worker image of a node pool (`osImage.builtin` or `osImage.factory`), a vm-disk `source`, the `oidc.customConfig` of a kubernetes cluster and of a monitoring stack (`config` or `secretRef`). A default for one child merged into an application that chose another built that spec. These carry the atomic marker now, so the merge replaces them whole, and `values.yaml` tells catalog authors to do the same in their own schemas. The chart guide (`docs/agents/overview.md`) says when the marker fits and when it does not. The `osImage` change is the same hunk as in #5192. The dashboard order page sends one dry-run create when it opens and starts the form and YAML from the returned spec, so the browser reads no ConfigMap and merges nothing. If the preview fails, or gets no answer in 8 s, the form opens with a notice and Retry, and Deploy still works. After a failed preview a dropdown stays empty instead of selecting the cluster default option, so the API applies the platform default to the omitted field. A cleared text field leaves its key out, a dropdown None and a sensitive field are written as `""`. While the server owns defaults the form does not fill schema defaults on its own. Not in this PR: defaults on update, re-rendering existing applications when the value changes, defaults for HelmReleases that controllers create directly, validation when the ConfigMap is saved, previews on every edit in the dashboard. ### Merge order #5190 and #5191 are merged and this branch is rebased on main. #5192 is open and has the same `osImage` marker hunk, so whichever of the two lands second needs one more `make generate` after a rebase. ### Known limits - The dashboard does not show the API Warning. - `null` for a field that has a developer default is saved as `null` through kubectl or Terraform, but the dashboard form shows the developer default. - A number in an integer-or-string field is rejected by the form (same on main), so quantities in an entry have to be quoted, `cpu: "2"`. `values.yaml` says so. - After a failed preview the form still requires a field that has no schema default, even if an entry would supply it. Typing the value or switching to YAML gets around it. - The marker only fits a choice between alternatives that each stand complete. I went through the application charts and rendered every refusal I found that involves two or more fields, and most are not that. A pair that has to be set together (`resources.cpu` with `resources.memory`, `tls.enabled` with `tls.disableNonTLSListeners` in rabbitmq) is completed field by field today, and an atomic object would drop the default half. An object that also holds independent fields an admin would default (`backup` in clickhouse, mariadb, mongodb and postgres, `volume` in seaweedfs) would lose them. Relations between two objects or two top-level fields (`cloudflareProxy` with `proxyProtocol` in the ingress, most of postgres, the kubernetes addons) cannot carry a marker. In all of these a default for one field plus the user's value for another can make the chart refuse the render after the create went through. Catching that needs the relations declared as rules in the schema and the merged spec checked against them, and the API does not evaluate such rules on a user spec yet (#2657), so it is a separate change. A few relations depend on a lookup into the cluster and I could not render them offline. - Clearing an optional text or number field in the order form leaves its key out, so the default comes back. A dropdown set to None, a sensitive field and a dictionary value send an empty string and win. The form keeps its old meaning of clearing a field, same as on main. To override a default with an empty value, set it in the YAML tab (`""`, `0`). Switching from the YAML tab back to the form fills an empty dropdown with its default option again, a None included, so such a value has to be deployed from the YAML tab (https://github.com/cozystack/cozystack/issues/5473). - An entry that cannot be parsed (invalid JSON, a reserved `_` key) turns defaults off for every kind, not only its own, and the Warning on each create names the problem. I did not split it per entry: the failure is loud, the fix is in one place, and splitting touches the parse and cache path for a case only a typo causes. - An atomic object also drops a default for a field nested inside an alternative when the user sets another field of that alternative. A default for `osImage.factory.imageFactoryURL` does not survive a pool that sets `osImage.factory.version`, and the boot disk then comes from the public factory. `talos.imageFactoryURL` is the knob the chart falls back to, it is not atomic, and defaults for it keep working. - A schema that declares a typed property only inside an `allOf` or `anyOf` branch, under a root that takes arbitrary keys, is checked as partial. No schema in the tree looks like that. - An object inside an `allOf`, `anyOf` or `oneOf` branch is closed to unknown keys even when the property it constrains is declared as a dictionary, so a valid entry for such a schema is refused and the create goes on with a Warning (https://github.com/cozystack/cozystack/issues/5474). No schema in the tree looks like that either. - The preview uses the placeholder name `preview`, so it fails when the tenant already has an application of that kind with this name, and the form opens with the notice. - The cache wiring in `pkg/apiserver/apiserver.go` has no unit test, the cache itself has. ### Verification - `make unit-tests` on this head with `LC_ALL=C`, exit code 0 (a kafka bats test on main depends on the locale). - `tsc` and `eslint` in the console are clean. - For the checks below I broke the code on purpose and saw the matching test fail, except the `arrayMinItems` flag of the server form, I could not make it matter. - A run on a test cluster with v1.7.0 is in the comment below. It was on an earlier revision, the stored-whole checks, the extra markers and the cleared-field change came after and are covered by unit tests only. - Not run: `make test-controllers`. - The merge cases asked in review are fixtures of `TestInstallationDefaultsMergeContract` now: a field set inside the alternative a user chose of an atomic object, the same object without the marker, an atomic object nested in one that merges, and an explicit `null` over an installation object. The whole table is in the proposal addendum, https://github.com/cozystack/community/pull/146. Checked cases: - user values `{}`, `[]`, `false`, `0`, `""` are kept, and a node pool with its own `registryMirrors` gets none from the platform - an object with both `properties` and a dictionary, or with preserved unknown fields, is replaced whole - empty and `null` `spec` on create - update after create, apply-update and a field removed on update keep stored values - a broken entry for another application, or an application with no entry and no readable schema, does not touch this create - missing ConfigMap gives no defaults and no warning, invalid JSON, unreadable ConfigMap and a cache that did not sync give a Warning and the create goes on - partial entry: `required`, `minProperties` and object `oneOf` are skipped on an object the merge completes, while unknown fields, wrong types, scalar `oneOf` and array items are still checked - array rows, dictionary values, free-form and atomic objects are checked whole, also when the constraint sits in an `allOf` or `anyOf` branch next to the property, and in these shapes an accepted entry merges into a spec that the application's own schema accepts - every ApplicationDefinition in the tree accepts an entry built from its own developer defaults - an object that lists properties without `type: object` is checked as an object, so an unknown field in it is refused - a pool with `osImage.factory`, a disk with another `source`, a cluster with `oidc.customConfig.secretRef` and a monitoring stack with `oidc.customConfig.config` do not get the other child from the platform, on their real schemas - a node pool that sets `resources.cpu` still gets `resources.memory` from an entry, so the marker does not take away the field-by-field completion of pairs - dashboard: a user with no tenant does not wait on the spinner, switching tenant keeps what was typed, a preview answer that arrives after the tenant changed is dropped, a non-object answer counts as a failed preview, Retry sends the current draft - dashboard: after a failed preview dropdowns in a field, an array row and a dictionary value stay empty, and edits made in YAML come back into the form - `required` inside array rows and dictionary values stays in force when the server owns defaults, and an emptied sensitive field stays `""` ### Screenshots Not captured yet. ### Downstream repositories This PR changes `packages/core/platform/values.yaml`. The docs for the new key are in https://github.com/cozystack/website/pull/828, and the proposal addendum with the merge cases and two decision records is in https://github.com/cozystack/community/pull/146. The Terraform provider may be reached too: it has its own defaults for some sizing fields (storage class, disk size), so installation defaults would not apply to those, while the Talos block fields are left out when unset and do get them. I read the schema, not the expand code. - [ ] No downstream repository is affected by this change - [x] [cozystack/website](https://github.com/cozystack/website) - follow-up: https://github.com/cozystack/website/pull/828 - [ ] [cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack) - follow-up: to check, provider defaults vs installation defaults - [ ] [cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack) - follow-up: - [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up: - [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up: - [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) - follow-up: - [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) - follow-up: - [ ] [cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server) - follow-up: - [ ] [cozystack/external-apps-example](https://github.com/cozystack/external-apps-example) - follow-up: - [ ] [cozystack/examples](https://github.com/cozystack/examples) - follow-up: - [x] [cozystack/community](https://github.com/cozystack/community) - follow-up: https://github.com/cozystack/community/pull/146 ### Release note ```release-note feat(api): add the `applicationDefaults` platform value, installation defaults are applied to new applications under user values, existing applications keep their saved settings, and the dashboard order form starts from the same defaults. ```
Monitoring Hub
Parameters
Common parameters
| Name | Description | Type | Value |
|---|---|---|---|
host |
The hostname used to access Grafana externally (defaults to 'grafana' subdomain for the tenant host). | string |
"" |
Metrics storage configuration
| Name | Description | Type | Value |
|---|---|---|---|
metricsStorages |
Configuration of metrics storage instances. | []object |
[...] |
metricsStorages[i].name |
Name of the storage instance. | string |
"" |
metricsStorages[i].retentionPeriod |
Retention period for metrics. | string |
"" |
metricsStorages[i].deduplicationInterval |
Deduplication interval for metrics. | string |
"" |
metricsStorages[i].storage |
Persistent volume size. | string |
10Gi |
metricsStorages[i].storageClassName |
StorageClass used for the data. | string |
"" |
metricsStorages[i].vminsert |
Configuration for vminsert. | object |
{} |
metricsStorages[i].vminsert.minAllowed |
Minimum guaranteed resources. | object |
{} |
metricsStorages[i].vminsert.minAllowed.cpu |
CPU request. | quantity |
"" |
metricsStorages[i].vminsert.minAllowed.memory |
Memory request. | quantity |
"" |
metricsStorages[i].vminsert.maxAllowed |
Maximum allowed resources. | object |
{} |
metricsStorages[i].vminsert.maxAllowed.cpu |
CPU limit. | quantity |
"" |
metricsStorages[i].vminsert.maxAllowed.memory |
Memory limit. | quantity |
"" |
metricsStorages[i].vmselect |
Configuration for vmselect. | object |
{} |
metricsStorages[i].vmselect.minAllowed |
Minimum guaranteed resources. | object |
{} |
metricsStorages[i].vmselect.minAllowed.cpu |
CPU request. | quantity |
"" |
metricsStorages[i].vmselect.minAllowed.memory |
Memory request. | quantity |
"" |
metricsStorages[i].vmselect.maxAllowed |
Maximum allowed resources. | object |
{} |
metricsStorages[i].vmselect.maxAllowed.cpu |
CPU limit. | quantity |
"" |
metricsStorages[i].vmselect.maxAllowed.memory |
Memory limit. | quantity |
"" |
metricsStorages[i].vmstorage |
Configuration for vmstorage. | object |
{} |
metricsStorages[i].vmstorage.minAllowed |
Minimum guaranteed resources. | object |
{} |
metricsStorages[i].vmstorage.minAllowed.cpu |
CPU request. | quantity |
"" |
metricsStorages[i].vmstorage.minAllowed.memory |
Memory request. | quantity |
"" |
metricsStorages[i].vmstorage.maxAllowed |
Maximum allowed resources. | object |
{} |
metricsStorages[i].vmstorage.maxAllowed.cpu |
CPU limit. | quantity |
"" |
metricsStorages[i].vmstorage.maxAllowed.memory |
Memory limit. | quantity |
"" |
Logs storage configuration
| Name | Description | Type | Value |
|---|---|---|---|
logsStorages |
Configuration of logs storage instances. | []object |
[...] |
logsStorages[i].name |
Name of the storage instance. | string |
"" |
logsStorages[i].retentionPeriod |
Retention period for logs. | string |
1 |
logsStorages[i].storage |
Persistent volume size. | string |
10Gi |
logsStorages[i].storageClassName |
StorageClass used to store the data. | string |
replicated |
Traces storage configuration
| Name | Description | Type | Value |
|---|---|---|---|
tracingStorages |
Configuration of traces storage instances. Empty by default (tracing off): no backend and no trace collector are rendered. Adding an entry provisions a VictoriaTraces backend and, while tracingCollector.enabled is true, deploys the OTLP collector in front of it. A tenant with shared-central tracing (the Tenant's tracingCentral) gets the collector, while tracingCollector.enabled is true, without an entry, which then exports to the shared store; entries still listed keep their store and datasource, so traces stored before the switch stay readable until the entry is removed. | []object |
[] |
tracingStorages[i].name |
Name of the storage instance: a lowercase RFC 1123 label of at most 42 characters. Treat as immutable once a backend exists: the VTCluster/VTSingle, its Services, PVCs and Grafana datasource are all named after it, so renaming an entry deploys a new, empty backend and removes the old one, the same way changing mode does (single mode loses the old PVC, cluster mode leaves the old vtstorage PVCs Bound until the whole Monitoring release is deleted). | string |
"" |
tracingStorages[i].mode |
Deployment mode: "cluster" renders a VTCluster; "single" renders a single-binary VTSingle for edge/dev/small clusters. Treat as immutable once a backend exists: mode selects which Kind is rendered under the same name, so changing it on a running backend re-identifies the object rather than reconfiguring it. Switching from "single" to "cluster" prunes the VTSingle and the operator garbage-collects its PVC (stored traces are lost); switching from "cluster" to "single" (or removing the entry) leaves the vtstorage PVCs Bound and billed until the whole Monitoring release is deleted. The API cannot guard this (transition rules are not available on an array-item field), so this note is the only guard: migrate deliberately, accepting the loss. | string |
cluster |
tracingStorages[i].retentionPeriod |
Retention period for traces. | string |
14d |
tracingStorages[i].storage |
Persistent volume size. | quantity |
10Gi |
tracingStorages[i].storageClassName |
StorageClass used to store the data. | string |
replicated |
tracingStorages[i].retentionDiskUsageBytes |
Optional disk-usage cap as a VictoriaMetrics BytesString (e.g. "8GB" or "8GiB"), bounding disk use on top of the age-based retentionPeriod. Uses byte-suffix grammar (kb/mb/gb/tb, KiB/MiB/GiB/TiB), NOT the Kubernetes-quantity grammar of the sibling storage field, so "8Gi" is rejected by the operator. In cluster mode the cap is per vtstorage replica (replicaCount 2), so the effective total is twice the value. Unset, the store drops its oldest day once its filesystem is 80% full instead, so every store is disk-bounded. Either way VictoriaTraces keeps the last two days, so spans arriving faster than the cap allows for two days can still fill the disk. | string |
"" |
tracingCentralHost |
tenant-root only: accept spans from tenants that turned on shared-central tracing (the Tenant's tracingCentral) into this Monitoring's tracingStorages entry named generic, which must be in cluster mode. Every central tenant then shares that store's disk and retention with tenant-root, and nothing reserves space per tenant: once the store's disk cap is reached (retentionDiskUsageBytes, or 80% of its filesystem) the oldest spans of all of them are evicted together. Each tenant is held to the platform's monitoring.tracingCentralTenantBytesPerSecond, which by default lets one tenant write at most the cap of a default 10Gi store, counted uncompressed and before the tenant's sampling, over the two days VictoriaTraces always keeps, so raise it with the store; several tenants writing at their limit together still can fill it. That bound holds for a tenant whose collector keeps running: each collector pod starts with a full bucket, up to 5 MiB or one second of its share of the rate when that is larger, and any change to the tenant's Monitoring rolls every collector pod, so a tenant that keeps changing it writes that much more on each rollout, for up to ten replicas; closing that needs a limiter with shared state, which the collector does not run. Ignored outside tenant-root. The tenant-root namespace is inside the trust boundary of the shared store, as it is for the metrics of tenants that rely on a parent's monitoring: vmauth pins each central tenant to its own account, but workloads in tenant-root reach the store directly, and one that learns a tenant's account ID (a hash of its namespace name and UID, which its VMUsers carry) can read and write that account. Whoever tenant-root admits to its Grafana is inside it too, since tenant-root's own datasource for the store reaches vtselect without vmauth; who that is follows its Grafana's oidc mode (with System, tenant-root's own groups, which already hold the same access level in every tenant under tenant-root). The render refuses to stop hosting while central tenants remain, but removing the tenant-root Monitoring altogether is not a render and is not refused: turn tracingCentral off on the central tenants first, since until then every Monitoring render of theirs fails, their metrics, logs and alerting changes included. The refusals read each other's objects when they render, so a tenant turning tracingCentral on while tenant-root stops hosting can pass both: that tenant's collector then exports to a vmauth that is gone while every release reports Ready, until its Monitoring renders again. Recover by hosting again; turning that tenant's tracingCentral off instead ends the silent drop, and turning it on again is then refused until tenant-root hosts. |
bool |
false |
Traces collector configuration
| Name | Description | Type | Value |
|---|---|---|---|
tracingCollector |
OpenTelemetry Collector for trace ingestion. With shared-central tracing it refuses spans above the platform's per-tenant write rate: OTLP/HTTP senders retry them, OTLP/gRPC senders drop them, so export over HTTP. It also refuses a request larger than 3 MiB (decompressed) with a 400, which senders do not retry, so keep export batches below that. | object |
{} |
tracingCollector.enabled |
Deploy the OTLP collector. When disabled, applications must send OTLP straight to the traces backend (no central sampling/redaction); with shared-central tracing they have no path to it, so no new spans arrive, while the traces already stored stay readable. The collector fronts a single backend, and the limit holds with shared-central tracing too, since turning that off makes it export to the local entry again: while it is enabled, tracingStorages must hold at most one entry, and adding a second one fails the whole Monitoring render until the extra entry is removed or the collector is disabled. | bool |
true |
tracingCollector.replicas |
Number of collector replicas. Head sampling is trace-id-deterministic, so replicas>1 are safe and remove the single-ingest-path SPOF. With shared-central tracing each replica sends up to two requests at a time against this tenant's write limit of four per vmauth replica, so more replicas do not raise the tenant's throughput; the tenant's write rate (the platform's monitoring.tracingCentralTenantBytesPerSecond) is split across them as well, so a sender whose connection stays on one replica gets that replica's share, and each replica that starts lets through above the rate up to 5 MiB, or one second of its share when that is larger, which is why shared-central tracing allows at most 10 replicas and fails the render above that. | int |
1 |
tracingCollector.samplingPercentage |
Head-sampling percentage applied at the collector before export. | int |
10 |
tracingCollector.redactAttributes |
Span attribute keys to drop before export (the PII/secret control point, e.g. db.statement). | []string |
[] |
tracingCollector.resources |
Resource configuration for the collector. | object |
{} |
tracingCollector.resources.requests |
Resource requests. | object |
{} |
tracingCollector.resources.requests.cpu |
CPU request. | quantity |
100m |
tracingCollector.resources.requests.memory |
Memory request. | quantity |
256Mi |
tracingCollector.resources.limits |
Resource limits. | object |
{} |
tracingCollector.resources.limits.cpu |
CPU limit. | quantity |
1 |
tracingCollector.resources.limits.memory |
Memory limit. | quantity |
1Gi |
Alerta configuration
| Name | Description | Type | Value |
|---|---|---|---|
alerta |
Configuration for the Alerta service. | object |
{} |
alerta.storage |
Persistent volume size for the database. | string |
10Gi |
alerta.storageClassName |
StorageClass used for the database. | string |
"" |
alerta.resources |
Resource configuration. | object |
{} |
alerta.resources.requests |
Resource requests. | object |
{} |
alerta.resources.requests.cpu |
CPU request. | quantity |
100m |
alerta.resources.requests.memory |
Memory request. | quantity |
256Mi |
alerta.resources.limits |
Resource limits. | object |
{} |
alerta.resources.limits.cpu |
CPU limit. | quantity |
1 |
alerta.resources.limits.memory |
Memory limit. | quantity |
1Gi |
alerta.alerts |
Alert routing configuration. | object |
{} |
alerta.alerts.telegram |
Configuration for Telegram alerts. | object |
{} |
alerta.alerts.telegram.token |
Telegram bot token. | string |
"" |
alerta.alerts.telegram.chatID |
Telegram chat ID(s), separated by commas. | string |
"" |
alerta.alerts.telegram.disabledSeverity |
List of severities without alerts (e.g. ["informational","warning"]). | []string |
[] |
alerta.alerts.slack |
Configuration for Slack alerts. | object |
{} |
alerta.alerts.slack.url |
Configuration uri for Slack alerts. | string |
"" |
alerta.alerts.slack.disabledSeverity |
List of severities without alerts (e.g. ["informational","warning"]). | []string |
[] |
alerta.alerts.email |
Configuration for email alerts. Alerts carrying the label notify_email with the string value true are emailed when their severity is in the severities list (default critical and major). A bare YAML boolean does not match. Alerts listed in alertnames are emailed unless matched by an earlier platform route. | object |
{} |
alerta.alerts.email.to |
Recipient address, or several separated by commas. A display name is accepted, such as Oncall <oncall@example.org>, as long as it carries no comma. Quote display names containing punctuation such as :, @, parentheses or ?. RFC 2047 encoded words are not accepted. IP domain literals accept dotted-quad IPv4 only. IPv6 literals are rejected because Go mail parsers disagree on their syntax across versions. ASCII control characters are rejected. Addresses must be literal, so Alertmanager template actions are rejected. The accepted form is deliberately narrower than RFC 5322. The local part must be a dot-atom, with no leading, trailing or doubled dot, and quoted local parts, comments and a mailto: prefix are rejected. An address outside that form fails the render, because Alertmanager parses addresses only when it sends and drops the notification with no record a tenant can read. |
string |
"" |
alerta.alerts.email.from |
Sender address, one only. A display name is accepted. It takes the same narrower form as to, and an address outside it fails the render. |
string |
"" |
alerta.alerts.email.smarthost |
SMTP server as host:port (e.g. "smtp.example.com:465"). A value without a port, an invalid bracketed IP address or a port with leading zeros fails the render. Port 465 uses implicit TLS, other ports use STARTTLS. |
string |
"" |
alerta.alerts.email.authUsername |
Username for SMTP LOGIN/PLAIN authentication. The password is read from the password key of a Secret named alertmanager-email-password in the release namespace, which the platform operator creates. The name is fixed and the Secret is mounted into Alertmanager, so a missing Secret blocks the whole Alertmanager rollout, not only email delivery. The credential in it must belong to this tenant alone. smarthost is chosen by whoever writes the Monitoring, so one relay credential provisioned under the same name in every namespace can be collected by pointing smarthost at a host the tenant controls. |
string |
"" |
alerta.alerts.email.repeatInterval |
Minimum time before a still-firing alert is emailed again, as an Alertmanager duration with units y, w, d, h, m, s, ms in descending order, each at most once, such as 5m, 12h or 1h30m. Delivery is evaluated every 5m, so shorter intervals take effect at 5m and other intervals round up to a multiple of 5m. Zero, a unit out of order and a total beyond what Alertmanager accepts fail the render. Empty keeps the 12h default. |
string |
"" |
alerta.alerts.email.alertnames |
Alert names emailed whether or not the rule carries the notify_email label, with no severity filter. Earlier platform routes still take precedence. Alerts with event="Heartbeat", including Watchdog, go only to Alerta, and alerts with severity none, CDIDefaultStorageClassDegraded and CDINoDefaultStorageClass are blackholed and never reach email. This is the way to opt in alerts the platform ships, since their helm-owned rule definitions cannot be labelled per cluster. Entries must be plain Prometheus alert names such as KubeAPIDown, and anything else fails the render. Empty adds no extra route. |
[]string |
[] |
alerta.alerts.email.severities |
Severities the notify_email route accepts (e.g. ["critical","major","warning"]). Empty keeps the default of critical and major. List every severity in use to email opted-in alerts regardless of severity. Entries must be plain severity names, and anything else fails the render. | []string |
[] |
alerta.alerts.email.template |
Text of an Alertmanager template file that changes how the emails look. Define email.default.subject and email.default.html in it to replace the subject and the HTML body Alertmanager uses for every email, for example to mark the severity or to link to Alerta. The chart stores the text in a ConfigMap named alertmanager-email-template and lists it among the Alertmanager templates, so Alertmanager parses it together with its configuration. A template that does not parse fails that load, a running Alertmanager keeps the configuration it already has and a pod that starts with it does not come up. A template that parses but fails on a notification, for example on a missing key, drops that email. The text must contain at least one define action. Empty keeps the Alertmanager defaults. |
string |
"" |
Grafana configuration
| Name | Description | Type | Value |
|---|---|---|---|
grafana |
Configuration for Grafana. | object |
{} |
grafana.db |
Database configuration. | object |
{} |
grafana.db.size |
Persistent volume size for the database. | string |
10Gi |
grafana.resources |
Resource configuration. | object |
{} |
grafana.resources.requests |
Resource requests. | object |
{} |
grafana.resources.requests.cpu |
CPU request. | quantity |
100m |
grafana.resources.requests.memory |
Memory request. | quantity |
256Mi |
grafana.resources.limits |
Resource limits. | object |
{} |
grafana.resources.limits.cpu |
CPU limit. | quantity |
1 |
grafana.resources.limits.memory |
Memory limit. | quantity |
1Gi |
Vmagent configuration
| Name | Description | Type | Value |
|---|---|---|---|
vmagent |
Configuration for VictoriaMetrics Agent. | object |
{} |
vmagent.externalLabels |
External labels applied to all metrics. | object |
{} |
vmagent.remoteWrite |
Remote write configuration. | object |
{} |
OIDC authentication
| Name | Description | Type | Value |
|---|---|---|---|
oidc |
OIDC authentication for the Grafana instance. See https://cozystack.io/docs/v1.6/operations/services/monitoring/oidc-authentication/ for the operator guide. | object |
{} |
oidc.mode |
Identity mode. None: no OIDC, only the grafana-admin-password Secret works. System: trust the platform cozy realm via a per-instance confidential client and audience binding; zero-config default. CustomConfig: trust a tenant-supplied issuer directly (BYO); cozy is not in the path. |
string |
None |
oidc.customConfig |
Tenant-supplied [auth.generic_oauth] payload; consumed only when mode: CustomConfig. |
object |
{} |
oidc.customConfig.config |
Inline map of [auth.generic_oauth] keys. Written verbatim into the Grafana CR spec.config. Mutually exclusive with secretRef.name. |
object |
{} |
oidc.customConfig.secretRef |
Reference to a Secret holding an auth.ini fragment; mounted under /etc/grafana/oidc and loaded via GF_PATHS_CUSTOM_INI. With shared-central tracing only its auth.ini key is mounted, so the fragment cannot read another key of the Secret with $__file{}. |
object |
{} |
oidc.customConfig.secretRef.name |
Name of an existing Secret in the release namespace whose auth.ini key holds a ready-made [auth.generic_oauth] block. Mutually exclusive with customConfig.config. |
string |
"" |
oidc.users |
Users granted access to this Grafana instance's org. Each entry is reconciled into Grafana org membership + role by a chart-owned post-install/post-upgrade Job. Works for both System and CustomConfig modes; ignored when mode: None. Users not listed here get nothing (no default org role from group mapping). |
[]object |
[] |
oidc.users[i].email |
Email address matched against the email claim from the issuer. The chart pre-provisions a Grafana account with this email so the users-Job can set the org role before the operator's first login (oauth_allow_insecure_email_lookup = true glues the two together). Must match a conservative pattern: local part is [A-Za-z0-9._%+-]+, domain is [A-Za-z0-9.-]+\.[A-Za-z]{2,}. Whitespace, quoted literals, and unusual URL-reserved characters are rejected on schema level so the reconcile-Job's shell handling never has to defend against malformed input. |
string |
"" |
oidc.users[i].role |
Grafana org role to bind: Admin, Editor, or Viewer. Applied to the release's Grafana org (Main Org.); server-level GrafanaAdmin promotion is out of scope for Phase 1. Required — the users-Job POSTs {loginOrEmail, role} to /api/orgs/1/users and PATCHes {role} to converge across re-runs; omitting the field would render role: "null" into the body and fail with HTTP 400. |
string |
{} |
Scheduling parameters
| Name | Description | Type | Value |
|---|---|---|---|
schedulingClass |
Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's allowedSchedulingClasses. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant. |
string |
"" |