Repository navigation
feat(helm)!: configure app via config overlays - #98
Conversation
Replace the config Job, which rewrote the image's config with yq and patched a ConfigMap with namespace admin rights, with a ConfigMap rendered by Helm. It holds a FOCA config overlay (`FOCA_CONFIG_OVERLAY`) generated from `host_name` (HTTPS on port 443, as before) and merged with the new free-form `config` value, which takes precedence. The Deployment mounts it as a directory and rolls on config changes. This also fixes the public URL: the Job set `.endpoints.service` instead of `.custom.endpoints.service`, so `host_name` was never used. Remove `update-config-map.sh` and its tools from the image, and install the app non-editably. Document configuration via overlays for Helm and Docker Compose. CI lints and renders the chart and validates the rendered overlay against the app's config models. Closes #67 BREAKING CHANGE: the chart (version 3.0.0) no longer creates the `app-config` ConfigMap, the config Job, its ServiceAccount and RoleBinding, and drops the `apiServer` value; config changes made to `app-config` must be moved to `config` in the values file. The image no longer contains the app's source in `/app`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Test the config overlay rendered by `helm template` with pytest (when helm is installed, as on GitHub-hosted runners) instead of an inline script in CI: generated values, precedence of `config`, and recursive merging of overlays. Require `host_name`, validate the types of `host_name` and `config` with a values schema, and document that the chart needs an image with FOCA 0.14 or later, which keys it expects unchanged, and that `config` must not contain secrets. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Test the values schema, precedence of later overlays, and that the Deployment mounts the overlay ConfigMap where `FOCA_CONFIG_OVERLAY` points; share the config parsing helper. Install all CI requirements in one step and fail the chart tests if helm is missing. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideHelm chart 3.0.0 now configures the application through a values-driven FOCA overlay mounted by the Deployment, eliminating the privileged patching Job and obsolete RBAC/config resources. The image packages the application and base config directly, while schemas, documentation, rendered-chart tests, and CI validation establish and enforce the new configuration and upgrade contract. Sequence diagram for config-driven deployment rolloutsequenceDiagram
actor Operator
participant Helm
participant Kubernetes
participant App
Operator->>Helm: helm upgrade
Helm->>Kubernetes: Apply <appName>-config ConfigMap
Helm->>Kubernetes: Apply Deployment with checksum/config
Kubernetes->>App: Mount /etc/cloud-registry/overlay.yaml
Kubernetes->>App: Set FOCA_CONFIG_OVERLAY
App->>App: Merge base config with overlay
Kubernetes->>App: Roll pods when checksum changes
Flow diagram for generated and user-provided configurationflowchart TD
Host[host_name] --> Generated[Generated custom.endpoints.service\nHTTPS port 443]
Config[config values] --> Overlay[overlay.yaml]
Generated --> Overlay
Overlay --> Precedence[mergeOverwrite\nconfig takes precedence]
Precedence --> ConfigMap[Rendered ConfigMap]
ConfigMap --> FOCA[FOCA startup overlay]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #98 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 7 7
Lines 224 224
=========================================
Hits 224 224 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Hey - I've reviewed your changes and they look great!
Sourcery assessment
Needs a human reviewer. Upgrading from chart version 2 removes the old app-config ConfigMap, so any hand-edited settings not transferred into the new config values are lost and the app may run with different settings, including authentication settings. The loss is limited to configuration and can be restored if the old values are available, but reverting the chart alone will not recover hand-edited contents.
Summary
Configures the app through Helm values and a FOCA config overlay instead of a Job that patches a ConfigMap (#67).
templates/cloud-registry-configmap.yamlrenders<appName>-configwithoverlay.yaml. It is the merge of:host_name(https://<host_name>:443, as the old Job intended);configvalue, which takes precedence.The Deployment mounts it at
/etc/cloud-registry/, setsFOCA_CONFIG_OVERLAY, and rolls on config changes (checksum/configannotation).app-config, its ServiceAccount, and its RoleBinding to the namespaceadminClusterRole. Also removed:update-config-map.sh, theapiServervalue, and curl, jq and yq plus the extra root steps in the image..endpoints.serviceinstead of.custom.endpoints.service, sohost_namenever took effect.host_nameis required;values.schema.jsonchecks the types ofhost_nameandconfig;values.yamlhas commentedconfigexamples (audience, logging, service info);elixircloud/cloud-registry:20261020, the first published images with FOCA 0.14 (push of dev verified).deployment/README.md: configuration, installation and upgrades, a per-deployment values file outside the repo, nokubectl edit, no secrets inconfig, and that the chart needs a FOCA ≥ 0.14 image;deployment/typo fixed, and a corrected note on host and port.tests/test_config.py: overlay merging (recursive, lists replaced, several overlays, missing file);helm template: the generated URL, precedence ofconfig, thehost_namerequirement, the schema, and the Deployment mount and env matching the ConfigMap.helm lint --strictand the chart tests.Closes #67
Breaking changes
app-config, the config Job, its ServiceAccount or RoleBinding (Helm removes them on upgrade);apiServer;host_name.Config changes made to
app-configmust move toconfigin the values file./app; the app is installed as a package.Deviations from the issue
https://registry.example.org:443/. It can be overridden viaconfig.custom.endpoints.service.appVersionstays 2.0.0; versioning is Release: single version source, traceable images #81.Verification
pytest(with Helm 3.18.6 on PATH): 93 passed.ruff check,ruff format --check,mypy cloud_registry tests: clean.helm lint --strict -f deployment/ci/test-values.yaml: passes.config.yamland the specs.gitleaks dir .: no leaks.host_namerequired, FOCA ≥ 0.14 note, keys the chart expects unchanged, the values schema, and overlay checks as pytest instead of inline CI script.Open questions
None.
🤖 Generated with Claude Code
Summary by Sourcery
Move application configuration from a post-installation patching Job to Helm-managed FOCA overlays and update the chart, image, documentation, and validation for the new deployment model.
New Features:
Bug Fixes:
Enhancements:
Build:
CI:
Deployment:
Documentation:
Tests:
Chores: