adorsys / adorsys/status-list-server
Decouple Helm chart from Postgres assumptions and support multi-database
- Langage dominant
- Rust
- Étoiles
- 22
- Forks
- 5
- Merge moyen
- 2 j 11 h
- PR mergées (30 j)
- 47
Description
## Objective
Decouple the Helm chart from hardcoded PostgreSQL assumptions, support other supported database backends (e.g., MySQL) in their latest versions, rename the database password Secret key to a database-agnostic name (`database-password`) with backward compatibility, and generalize `initContainers`.
## Context
Currently, the Helm chart has tight coupling to PostgreSQL:
1. `initContainers` enforces `wait-for-postgres`, hardcoding `{{ .Release.Name }}-postgres...` and nc check on postgres port.
2. The Secret key for database authentication is hardcoded to `postgres-password` in `fallbackSecret`, `secretMounts`, and deployment helpers.
3. Default database environment variables in `deployment.yaml` (`APP_DATABASE__HOST`, `APP_DATABASE__USERNAME`, `APP_DATABASE__NAME`) default to `.Values.postgres` fields even when MySQL is configured.
4. Network policy egress rules only target pods labeled `app.kubernetes.io/name: postgres`.
## Deliverables
- [x] **Database-agnostic Secret key:**
- Support `database-password` across `statuslist-secret`, `secretMounts`, and documentation.
- Retain fallback reading of `postgres-password` from existing cluster Secrets and set both `database-password` and `postgres-password` in `$stringData` to guarantee zero breaking changes for existing deployments and bundled subcharts.
- [x] **Generic initContainers:**
- Replace `wait-for-postgres` with `wait-for-db` in `values.yaml` and `values-local.yaml`.
- Introduce `status-list-server-chart.dbHost` helper that dynamically resolves to the configured host (or defaults to `-mysql` or `-postgres` based on `APP_DATABASE__BACKEND`).
- [x] **MySQL backend support:**
- Add native `mysql:` configuration block in `values.yaml` and `values.schema.json` with latest available versions (e.g. MySQL 8.4 LTS).
- Update `deployment.yaml` to dynamically default `APP_DATABASE__HOST`, `APP_DATABASE__USERNAME`, and `APP_DATABASE__NAME` according to the active backend (`postgres` or `mysql`).
- Document latest supported versions for both PostgreSQL (17) and MySQL (8.4).
- [x] **Network policy adaptability:**
- Update `network-policy.yaml` egress podSelector to match the active backend (`postgres` or `mysql`).
- [x] **Validation & tests:**
- Update and add assertions in `tests/helm_sensitive_env.rs`.
- Verify `helm lint ./helm/chart` passes cleanly.
## Acceptance Criteria
- [x] `helm lint ./helm/chart` passes without errors.
- [x] `cargo test --test helm_sensitive_env` passes.
- [x] Deployments with `--set statuslist.env.APP_DATABASE__BACKEND=mysql` correctly template MySQL host, credentials, initContainers, and network policy egress.
- [x] Existing deployments using `postgres-password` continue to work without breaking changes.
1 day
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.