Repository navigation
Deployment: pin MongoDB, add DB auth, probes #68
Copy link
Copy link
Closed
Labels
priority: mediumMedium priorityMedium prioritytype: deliveryRelated to packaging, deployment etc.Related to packaging, deployment etc.type: securityRelated to securityRelated to securityworkload: hoursLikely takes hours to resolveLikely takes hours to resolve
Description
Why?
Besides config handling (#67), the Helm chart and Compose setup have several deployment issues:
- MongoDB version: the chart uses
mongo:noble, which currently resolves to MongoDB 8.x. MongoDB 8.0 refuses to start on Linux kernels 6.19 to 7.0.13 (SERVER-121912), which affects some current nodes and GitHub runners. The tag is also unpinned, so a redeploy can silently jump to a new major version and its data format.docker-compose.yamlusesmongo:3.6ondev(end of life). - MongoDB without authentication: the chart creates no Secret and starts MongoDB without credentials. FOCA ≥ 0.14 reads
MONGO_URI(orMONGO_USERNAME/MONGO_PASSWORD) from the environment, but nothing sets them. - No probes: the app Deployment has no readiness or liveness probes, so traffic is routed to pods before they can serve, and hung pods are not restarted.
- MongoDB rollout strategy:
templates/mongo-deploy.yamlusesstrategy: RollingUpdate(25% surge), but MongoDB's data volume is aReadWriteOncePVC (templates/mongo-pvc.yaml). On every rollout (e.g. an image change), the new pod starts while the old one still holds the volume: on another node it hangs onMulti-Attach error, on the same node twomongodprocesses compete for the same data directory. - Init script:
templates/mongo-init-script.yamlcreates theservicesandservice_infocollections with their indexes, duplicating thedbsection ofconfig.yaml. FOCA already creates configured collections and indexes on startup. Once access control lands (Cloud Registry backend: public read access, service ownership, ECP_CLN:ADMIN admin role #62), thepolicy_rulescollection would be missing from the script. - Small leftovers: the config Job's container is named
certbotand the script logs "WES APP NAME" (copied from other charts);README.mdrefers todeployments/instead ofdeployment/.
How?
- Pin MongoDB to a major version that runs on current kernels (e.g.
mongo:7.0) in both the chart (mongodb.image) anddocker-compose.yaml, and document how to upgrade an existing data directory (upgrade one major version at a time, setfeatureCompatibilityVersionin between). - Add optional MongoDB authentication:
- values
mongodb.auth.enabledandmongodb.existingSecret(no credentials in values files); - the MongoDB Deployment gets
MONGO_INITDB_ROOT_USERNAME/MONGO_INITDB_ROOT_PASSWORDfrom the Secret; - the app gets
MONGO_URI(or username and password) from the same Secret viasecretKeyRef.
- values
- Add readiness and liveness probes to the app container (e.g. HTTP
GET /ga4gh/registry/v1/service-info), and a readiness probe to MongoDB. - Set
strategy: type: Recreateon the MongoDB Deployment, so the old pod releases the volume before the new one starts. - Check whether the init script is still needed now that FOCA creates collections and indexes on startup; remove it if not, otherwise keep it in sync (
policy_rules). - Fix the leftovers listed above.
Acceptance criteria
- MongoDB image pinned to a supported major version in chart and Compose; upgrade notes in the deployment docs.
- With auth enabled and a Secret provided, MongoDB requires credentials and the app connects with them; no credentials appear in ConfigMaps or values.
- App and MongoDB have probes;
kubectl rollout statuswaits for a ready app. - Changing the MongoDB image rolls out without a
Multi-Attacherror or a secondmongodon the same volume. - The init script is removed or matches the configured collections.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority: mediumMedium priorityMedium prioritytype: deliveryRelated to packaging, deployment etc.Related to packaging, deployment etc.type: securityRelated to securityRelated to securityworkload: hoursLikely takes hours to resolveLikely takes hours to resolve
Activity
feat(helm)!: pin MongoDB, add auth and probes