cozystack/packages/apps/postgres/templates
Andrei Kvapil e7b62ca3c8
[platform] Replace Helm lookup with valuesFrom mechanism (#1787)
## What this PR does

Replaces Helm lookup functions with FluxCD valuesFrom mechanism for
passing configuration to HelmReleases. This provides cleaner config
propagation and eliminates the need for force reconcile controllers.

### Changes:

**Platform/Tenant charts:**
- Add Secret `cozystack-values` creation in platform chart (for
tenant-root and system namespaces)
- Add Secret `cozystack-values` creation in tenant chart (for child
namespaces)

**cozystack-api:**
- Add `valuesFrom` references to HelmRelease when creating applications
- Filter keys starting with `_` when returning Application specs
- Validate that user values don't contain `_` prefixed keys

**cozystack-controller:**
- Add validation that HelmRelease contains correct valuesFrom
configuration
- Remove `CozystackConfigReconciler` (no longer needed)
- Remove `TenantHelmReconciler` (no longer needed)

**Helm charts (40+ files):**
- Add helper templates in cozy-lib for `_cluster`/`_namespace` access
- Replace ConfigMap lookups with `.Values._cluster.*`
- Replace Namespace annotation lookups with `.Values._namespace.*`

### Architecture:

```
Secret cozystack-values (in each namespace)
├── _cluster: YAML with data from ConfigMaps (cozystack, cozystack-branding, cozystack-scheduling)
└── _namespace: YAML with namespace service references (etcd, host, ingress, monitoring, seaweedfs)

HelmRelease
└── spec.valuesFrom:
    ├── Secret/cozystack-values → _namespace → .Values._namespace
    └── Secret/cozystack-values → _cluster → .Values._cluster
```

### Release note

```release-note
[platform] Replace Helm lookup functions with FluxCD valuesFrom mechanism for configuration propagation
```

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

* **New Features**
* Helm releases and namespaces now source centralized cluster/namespace
configuration via a new secret (cozystack-values), and many templates
read values from chart-provided _cluster/_namespace entries.

* **Bug Fixes**
* API now rejects application specs containing reserved keys prefixed
with "_" to prevent invalid configurations.

* **Refactor**
* Two background reconciler controllers were removed from startup,
simplifying controller initialization.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-01-09 14:54:01 +01:00
..
.gitkeep Preapare release v0.0.1 2024-02-08 12:04:32 +01:00
_postgresjobs.tpl add rq for pg 2025-06-11 22:48:09 +03:00
_resources.tpl Don't overcommit memory or throttle CPU 2025-05-12 15:59:28 +03:00
_versions.tpl [postgres] Add version management system with automated version updates 2025-12-01 23:56:55 +01:00
backup-secret.yaml [postgres] add backup and restore 2025-06-23 15:38:34 +02:00
backup.yaml wrap cron in quotes to avoid yaml issues 2025-06-23 17:59:05 +03:00
dashboard-resourcemap.yaml bugfix fix pg LB frontend 2025-07-16 11:56:45 +03:00
db.yaml [platform] Replace Helm lookup with valuesFrom mechanism (#1787) 2026-01-09 14:54:01 +01:00
external-svc.yaml [platform] Autodetect RobotLB 2025-07-24 18:55:30 +03:00
init-job.yaml [postgres] Add version management system with automated version updates 2025-12-01 23:56:55 +01:00
init-script.yaml [controller,api] Refactor tenant resource label 2025-10-01 13:24:40 +03:00
regsecret.yaml Preapare release v0.0.1 2024-02-08 12:04:32 +01:00