mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-09 22:13:18 +09:00
Address the two blocking-class findings from the cozy-review pass on
this PR:
(1) Missing PackageSource dependency on cozystack.keycloak-operator
(MAJOR cold-install race).
Without this edge, the monitoring chart can reconcile before the
v1.edp.epam.com CRDs are registered on a fresh cluster — the
`.Capabilities.APIVersions.Has` guard in
templates/grafana/oidc-keycloak.yaml then silently drops all
Keycloak-side objects for mode: System, and Grafana's
auth.generic_oauth block points at a client Keycloak never
provisions. Add the ordering edge, plus a
sources_monitoring_application_dependson_test.yaml regression
guard so a future edit cannot drop it silently.
(2) allow_assign_grafana_admin driven by `.Release.Name ==
monitoring-system` (MINOR fragile coupling).
Replace the release-name sniff with an explicit
`oidc.grafanaAdmin: false` values field, and flip it on for the
platform Grafana release via
Package.spec.components["monitoring-system"].values.oidc.grafanaAdmin
in packages/core/platform/templates/bundles/system.yaml —
mirroring the pattern monitoring-agents already uses for
per-component overrides. Tenant Grafana releases inherit the
chart default false and stay at org-level Admin.
Two new helm-unittest cases in packages/system/monitoring/tests/
lock the values-driven behaviour on both sides
(grafanaAdmin=true → Admin uplift, default → tenant stays at org
Admin), plus bundles_monitoring_grafana_admin_test.yaml in
packages/core/platform/tests/ regression-guards the Package's
component override so the platform release keeps its uplift on
future edits.
Also document the mode-toggle group-membership loss in
docs/oidc-grafana.md — mode: System → CustomConfig/None deletes the
three chart-owned KeycloakRealmGroups; membership is not restored on
toggle-back. Not a bug, but the operator UX cost of the toggle
deserves a bullet in Failure modes.
Regenerated artifacts (cozyvalues-gen + hack/update-crd.sh):
packages/extra/monitoring/values.schema.json
packages/extra/monitoring/README.md
packages/system/monitoring-rd/cozyrds/monitoring.yaml
Test suites still green: packages/system/monitoring 23/23,
packages/core/platform 81/81.
Signed-off-by: Ivan Okhotnikov <xorokhotnikov@gmail.com>
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 |
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 |
[] |
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 docs/oidc-grafana.md 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. |
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.grafanaAdmin |
Promote members of the <clientId>-admin group to server-level GrafanaAdmin (sets allow_assign_grafana_admin: true in [auth.generic_oauth]). Intended for the platform release; tenant Grafana keeps org-level Admin. |
bool |
false |